Package org.springframework.xd.test.fixtures

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


  /**
   * 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


  /**
   * 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

*/
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

    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

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

  }

  @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

  }

  @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

    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

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

  /**
   * Test a stream that is simply one processor module connecting two named channels.
   */
  @Test
  public void testProcessorLinkingChannels() throws Exception {
    FileSink sink = newFileSink().binary(true);
    HttpSource source = newHttpSource(9314);

    String streamName0 = generateStreamName();
    String streamName1 = generateStreamName();
    String streamName2 = generateStreamName();
View Full Code Here

TOP

Related Classes of org.springframework.xd.test.fixtures.FileSink$FileSinkContentsMatcher

Copyright © 2018 www.massapicom. 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.