Examples of sendPayload()


Examples of org.springframework.xd.dirt.test.process.SingleNodeProcessingChain.sendPayload()

  public void processingChain() {
    String processingChainUnderTest = "transform --expression='payload.toUpperCase()' | filter --expression='payload.length() > 4'";

    SingleNodeProcessingChain chain = chain(application, "eezypeasy", processingChainUnderTest);

    chain.sendPayload("hello");
    String result = (String) chain.receivePayload(RECEIVE_TIMEOUT);
    assertEquals("HELLO", result);

    chain.sendPayload("a");
    result = (String) chain.receivePayload(RECEIVE_TIMEOUT);
View Full Code Here

Examples of org.springframework.xd.dirt.test.process.SingleNodeProcessingChain.sendPayload()

    chain.sendPayload("hello");
    String result = (String) chain.receivePayload(RECEIVE_TIMEOUT);
    assertEquals("HELLO", result);

    chain.sendPayload("a");
    result = (String) chain.receivePayload(RECEIVE_TIMEOUT);
    assertNull(result);

    chain.destroy();
  }
View Full Code Here

Examples of org.springframework.xd.dirt.test.process.SingleNodeProcessingChain.sendPayload()

    String processingChainUnderTest = String.format("%s --prefix=%s --suffix=%s", moduleName, prefix, suffix);

    SingleNodeProcessingChain chain = chain(application, streamName, processingChainUnderTest);

    chain.sendPayload("hello");
    String result = (String) chain.receivePayload(RECEIVE_TIMEOUT);
    assertEquals(prefix + "hello" + suffix, result);

    chain.destroy();
  }
View Full Code Here

Examples of org.springframework.xd.dirt.test.process.SingleNodeProcessingChain.sendPayload()

    String processingChainUnderTest = String.format("%s --prefix=%s --prefixOnly=true", moduleName, prefix);

    SingleNodeProcessingChain chain = chain(application, streamName, processingChainUnderTest);

    chain.sendPayload("hello");
    String result = (String) chain.receivePayload(RECEIVE_TIMEOUT);
    assertEquals(prefix + "hello", result);

    chain.destroy();
  }
View Full Code Here

Examples of org.springframework.xd.dirt.test.process.SingleNodeProcessingChainProducer.sendPayload()

    StreamDefinition tap = new StreamDefinition("testtap", "tap:stream:dateToDateTime.0 > queue:tap");
    integrationSupport.createAndDeployStream(tap);
    NamedChannelSink sink = new SingleNodeNamedChannelSinkFactory(integrationSupport.messageBus()).createNamedChannelSink("queue:tap");

    chain.sendPayload(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));

    Object payload = sink.receivePayload(RECEIVE_TIMEOUT);
    assertNotNull(payload);
    assertTrue(payload instanceof DateTime);
View Full Code Here

Examples of org.springframework.xd.dirt.test.source.NamedChannelSource.sendPayload()

    NamedChannelSource source = new SingleNodeNamedChannelSourceFactory(integrationSupport.messageBus()).createNamedChannelSource("queue:mqttsource");
    NamedChannelSink sink = new SingleNodeNamedChannelSinkFactory(integrationSupport.messageBus()).createNamedChannelSink("queue:mqttsink");

    Thread.sleep(1000);
    source.sendPayload("hello");
    Object result = sink.receivePayload(1000);

    assertEquals("hello", result);
    source.unbind();
    sink.unbind();
View Full Code Here

Examples of org.springframework.xd.dirt.test.source.NamedChannelSource.sendPayload()

    MessageBus messageBus = integrationSupport.messageBus();

    NamedChannelSource source = new SingleNodeNamedChannelSourceFactory(messageBus).createNamedChannelSource("queue:producer");
    NamedChannelSink sink = new SingleNodeNamedChannelSinkFactory(messageBus).createNamedChannelSink("queue:consumer");

    source.sendPayload("ping");
    String result = (String) sink.receivePayload(5000);
    assertEquals(expected, result);

    source.unbind();
    sink.unbind();
View Full Code Here

Examples of org.springframework.xd.dirt.test.source.NamedChannelSource.sendPayload()

    MessageBus messageBus = integrationSupport.messageBus();

    NamedChannelSource source = new SingleNodeNamedChannelSourceFactory(messageBus).createNamedChannelSource("queue:producer");
    NamedChannelSink sink = new SingleNodeNamedChannelSinkFactory(messageBus).createNamedChannelSink("queue:consumer");

    source.sendPayload("hello");
    String result = (String) sink.receivePayload(RECEIVE_TIMEOUT);
    assertEquals("HELLO", result);

    source.sendPayload("a");
    result = (String) sink.receivePayload(RECEIVE_TIMEOUT);
View Full Code Here

Examples of org.springframework.xd.dirt.test.source.NamedChannelSource.sendPayload()

    source.sendPayload("hello");
    String result = (String) sink.receivePayload(RECEIVE_TIMEOUT);
    assertEquals("HELLO", result);

    source.sendPayload("a");
    result = (String) sink.receivePayload(RECEIVE_TIMEOUT);
    assertNull(result);

    source.unbind();
    sink.unbind();
View Full Code Here

Examples of org.springframework.xd.dirt.test.source.NamedChannelSource.sendPayload()

    NamedChannelSink bar1sink = sinkFactory.createNamedChannelSink("queue:bar1");
    NamedChannelSink bar2sink = sinkFactory.createNamedChannelSink("queue:bar2");
    NamedChannelSource source = new SingleNodeNamedChannelSourceFactory(bus).createNamedChannelSource(TOPIC_FOO);

    source.sendPayload("hello");

    final Object bar1 = bar1sink.receivePayload(10000);
    final Object bar2 = bar2sink.receivePayload(10000);
    assertEquals("hello", bar1);
    assertEquals("hello", bar2);
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.