Examples of FileSink


Examples of org.graphstream.stream.file.FileSink

  public void write(FileSink output, String filename) throws IOException {
    output.writeAll(this, filename);
  }

  public void write(String filename) throws IOException {
    FileSink output = FileSinkFactory.sinkFor(filename);
    if (output != null) {
      write(output, filename);
    } else {
      throw new IOException("No sink writer for " + filename);
    }
View Full Code Here

Examples of org.springframework.xd.test.fixtures.FileSink

  /**
   * This tests that options passed in the definition of a composed module are kept as first level defaults.
   */
  @Test
  public void testComposedModulesValuesInDefinition() throws IOException {
    FileSink sink = newFileSink().binary(true);
    HttpSource httpSource = newHttpSource();
    compose().newModule("filterAndTransform",
        "filter --expression=true | transform --expression=payload.replace('abc','...')");
    stream().create(generateStreamName(), "%s | filterAndTransform | %s", httpSource, sink);
    httpSource.ensureReady().postData("abcdefghi!");
View Full Code Here

Examples of org.springframework.xd.test.fixtures.FileSink

  /**
   * This tests that options passed at usage time of a composed module are override definition values.
   */
  @Test
  public void testComposedModulesValuesAtUsageTime() throws IOException {
    FileSink sink = newFileSink().binary(true);
    HttpSource httpSource = newHttpSource();
    compose().newModule("filterAndTransform",
        "filter --expression=false | transform --expression=payload.replace('abc','...')");
    String options = String.format(
        "--filter%sexpression=true --transform%sexpression=payload.replace('def','...')", OPTION_SEPARATOR,
View Full Code Here

Examples of org.springframework.xd.test.fixtures.FileSink

*/
public class RouterSinkTests extends AbstractStreamIntegrationTest {

  @Test
  public void testUsingExpression() {
    FileSink fileSink = newFileSink().binary(true);
    HttpSource httpSource = newHttpSource();
    String queue1 = generateQueueName();
    String queue2 = generateQueueName();

    stream().create(generateStreamName(), "%s > transform --expression=payload+'-foo' | %s", queue1, fileSink);
View Full Code Here

Examples of org.springframework.xd.test.fixtures.FileSink

    assertThat(fileSink, eventually(hasContentsThat(equalTo("a-foob-bar"))));
  }

  @Test
  public void testUsingScript() {
    FileSink fileSink = newFileSink().binary(true);
    HttpSource httpSource = newHttpSource();

    stream().create(generateStreamName(), "queue:testUsingScript1 > transform --expression=payload+'-foo' | %s", fileSink);
    stream().create(generateStreamName(), "queue:testUsingScript2 > transform --expression=payload+'-bar' | %s", fileSink);
    stream().create(generateStreamName(),
View Full Code Here

Examples of org.springframework.xd.test.fixtures.FileSink

public class MailCommandTests extends AbstractStreamIntegrationTest {

  @Test
  public void testImapPoll() throws Exception {
    PollingMailSource pollingMailSource = newPollingMailSource();
    FileSink fileSink = newFileSink().binary(true);

    pollingMailSource.ensureStarted();

    stream().create(generateStreamName(), "%s | %s", pollingMailSource, fileSink);
View Full Code Here

Examples of org.springframework.xd.test.fixtures.FileSink

  }

  @Test
  public void testImapIdle() throws Exception {
    NonPollingImapSource mailSource = newNonPollingMailSource();
    FileSink fileSink = newFileSink().binary(true);

    mailSource.ensureStarted();

    stream().create(generateStreamName(), "%s | %s", mailSource, fileSink);
View Full Code Here

Examples of org.springframework.xd.test.fixtures.FileSink

  }

  @Test
  public void testDefaultOptions() {
    HttpSource httpSource = newHttpSource();
    FileSink fileSink = newFileSink().binary(true);

    String streamName = generateStreamName();
    Queue queue = new Queue(streamName);
    rabbitAdmin.declareQueue(queue);
    queues.add(streamName);
View Full Code Here

Examples of org.springframework.xd.test.fixtures.FileSink

    if (!new File("/tmp/").exists()) {
      return;
    }

    FileSource source = newFileSource();
    FileSink sink = newFileSink().binary(true);

    source.appendToFile("Hi there!");
    stream().create(generateStreamName(), "in: %s | out: %s", source, sink);
    assertThat(sink, eventually(hasContentsThat(equalTo("Hi there!"))));
View Full Code Here

Examples of org.springframework.xd.test.fixtures.FileSink

public class TcpModulesTests extends AbstractStreamIntegrationTest {

  @Test
  public void testTcpSource() throws Exception {
    TcpSource tcpSource = newTcpSource();
    FileSink fileSink = newFileSink().binary(true);
    stream().create(generateStreamName(), "%s | %s", tcpSource, fileSink);

    // Following \r\n is because of CRLF deserializer
    tcpSource.ensureReady().sendBytes("Hello\r\n".getBytes("UTF-8"));
    assertThat(fileSink, eventually(hasContentsThat(equalTo("Hello"))));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.