Examples of ensureReady()


Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()

        .subject("payload");


    stream().create(generateStreamName(), "%s | %s", httpSource, mailSink);

    httpSource.ensureReady().postData("Woohoo!");
    MimeMessage result = mailSink.waitForEmail();

    Assert.assertEquals("Woohoo!\r\n", result.getContent());
    Assert.assertEquals("Woohoo!", result.getSubject());
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()


    stream().create(streamName, "%s | rabbit", httpSource);
    stream().create(generateStreamName(), "rabbit --queues=%s | %s", streamName, fileSink);

    httpSource.ensureReady().postData("hello rabbit");
    assertThat(fileSink, eventually(hasContentsThat(equalTo("hello rabbit"))));
  }

  @AfterClass
  public static void cleanupQueues() {
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()

  public void testTcpSink() throws Exception {
    TcpSink tcpSink = newTcpSink().start();
    HttpSource httpSource = newHttpSource();

    stream().create(generateStreamName(), "%s | %s", httpSource, tcpSink);
    httpSource.ensureReady().postData("Hi there!");

    // The following CRLF is b/c of the default tcp serializer
    // NOT because of FileSink
    assertThat(tcpSink, eventually(tcpSinkReceived("Hi there!\r\n")));
  }
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()

    // use the tap channel as a sink. Not very useful currently but will be once we allow users to create pub/sub
    // channels
    // stream().create(getRandomStreamName(), "%s > %s.transform",
    // httpSource2, getTapName(streamName));

    httpSource.ensureReady().postData("Dracarys!");

    assertThat(sink, eventually(hasContentsThat(equalTo("DRACARYS!"))));

    assertThat(tapsink3, eventually(hasContentsThat(equalTo("Dracarys!"))));
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()

        "%s > transform --expression=payload.replaceAll('r','.') | %s", getTapName(streamName), tapsink3);

    stream().create(generateStreamName(),
        "%s.filter > transform --expression=payload.replaceAll('A','.') | %s", getTapName(streamName), tapsink5);

    source.ensureReady().postData("Dracarys!");

    assertThat(sink, eventually(hasContentsThat(equalTo("DRACARYS!"))));

    assertThat(tapsink3, eventually(hasContentsThat(equalTo("D.aca.ys!"))));
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()

    String streamName = generateStreamName();
    stream().create(streamName, "%s | flibble: transform --expression=payload.toUpperCase() | %s", source, sink1);
    stream().create(generateStreamName(),
        "%s.flibble > transform --expression=payload.replaceAll('a','.') | %s", getTapName(streamName), sink2);

    source.ensureReady().postData("Dracarys!");

    assertThat(sink1, eventually(hasContentsThat(equalTo("DRACARYS!"))));

    assertThat(sink2, eventually(hasContentsThat(equalTo("DRACARYS!"))));
  }
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()

    source1.ensureReady().postData("stillup");
    assertThat(sink, eventually(hasContentsThat(equalTo("Dracarys!testingstillup"))));

    stream().create(generateStreamName(), "%s > %s", source3, queue);
    source3.ensureReady().postData("newstream");
    assertThat(sink, eventually(hasContentsThat(equalTo("Dracarys!testingstillupnewstream"))));
  }

  @Test
  public void testJsonPath() throws IOException {
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()

    HttpSource source = newHttpSource();
    FileSink sink = newFileSink().binary(true);
    stream().create(generateStreamName(),
        "%s | transform --expression='#jsonPath(payload, \"$.foo.bar\")' | %s",
        source, sink);
    source.ensureReady().postData("{\"foo\":{\"bar\":\"123\"}}");
    assertThat(sink, eventually(hasContentsThat(equalTo("123"))));
  }

  @Test
  public void testDestroyTap() {
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()

    HttpSource source = newHttpSource();
    FileSink sink = newFileSink().binary(true);

    stream().create(streamName, "%s | transform --expression=\"'${xd.stream.name}'\" | %s", source, sink);

    source.ensureReady().postData("whatever");
    assertThat(sink, eventually(hasContentsThat(equalTo(streamName))));
  }
}
View Full Code Here

Examples of org.springframework.xd.shell.command.fixtures.HttpSource.ensureReady()

    final HttpSource httpSource = newHttpSource();
    stream().create(generateStreamName(), "%s | redis --topicExpression='''%s'''", httpSource,
        topicName);
    Thread.sleep(1000);
    final String stringToPost = "test";
    httpSource.ensureReady().postData(stringToPost);
    latch.await(3, TimeUnit.SECONDS);
    assertEquals(0, latch.getCount());
    container.stop();
  }
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.