本文整理汇总了Java中org.mule.transport.NullPayload类的典型用法代码示例。如果您正苦于以下问题:Java NullPayload类的具体用法?Java NullPayload怎么用?Java NullPayload使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NullPayload类属于org.mule.transport包,在下文中一共展示了NullPayload类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testFlowPublisher2
import org.mule.transport.NullPayload; //导入依赖的package包/类
@Test
public void testFlowPublisher2() throws Exception
{
//Allow servers to start
Thread.sleep(1000);
RunTcpTest t1 = new RunTcpTest(PUBLISHER1_PORT, CONNECTOR_NAME);
t1.start();
RunTcpTest t2 = new RunTcpTest(PUBLISHER2_PORT, CONNECTOR_NAME);
t2.start();
runFlowWithPayloadAndExpect("testFlowPublisher2", NullPayload.getInstance(), PAYLOAD);
t1.join();
Assert.assertEquals(PAYLOAD, t1.getResult());
t2.join();
Assert.assertEquals(PAYLOAD, t2.getResult());
}
示例2: testFlowPublisher1
import org.mule.transport.NullPayload; //导入依赖的package包/类
@Test
public void testFlowPublisher1() throws Exception
{
//Allow servers to start
Thread.sleep(1000);
RunTcpTest t1 = new RunTcpTest(PUBLISHER1_PORT, CONNECTOR_NAME);
t1.start();
runFlowWithPayloadAndExpect("testFlowPublisher1", NullPayload.getInstance(), PAYLOAD);
t1.join();
Assert.assertEquals(PAYLOAD, t1.getResult());
}
示例3: runFlowAndExpect
import org.mule.transport.NullPayload; //导入依赖的package包/类
/**
* Run the flow specified by name and assert equality on the expected output
*
* @param flowName The name of the flow to run
* @param expect The expected output
*/
protected <T> void runFlowAndExpect(String flowName, T expect) throws Exception
{
Flow flow = lookupFlowConstruct(flowName);
MuleEvent event = getTestEvent(NullPayload.getInstance());
MuleEvent responseEvent = flow.process(event);
Assert.assertEquals(expect, responseEvent.getMessage().getPayload());
}
示例4: DxTransformer
import org.mule.transport.NullPayload; //导入依赖的package包/类
public DxTransformer() {
super();
transformerPool = new GenericObjectPool(new PooledDxTransformerFactory());
transformerPool.setMinIdle(MIN_IDLE_TRANSFORMERS);
transformerPool.setMaxIdle(MAX_IDLE_TRANSFORMERS);
transformerPool.setMaxActive(MAX_ACTIVE_TRANSFORMERS);
registerSourceType(DataTypeFactory.create(org.w3c.dom.Node.class));
registerSourceType(DataTypeFactory.create(InputSource.class));
registerSourceType(DataTypeFactory.create(NullPayload.class));
contextProperties = new HashMap<String, Object>();
}
示例5: testMessage
import org.mule.transport.NullPayload; //导入依赖的package包/类
protected DefaultMuleMessage testMessage() {
MuleEvent testEvent;
try {
testEvent = MuleTestUtils.getTestEvent(NullPayload.getInstance(), new DefaultMuleSession(), context());
} catch (Exception e) {
throw new RuntimeException(e);
}
RequestContext.setEvent(testEvent);
return new DefaultMuleMessage(NullPayload.getInstance(), muleContext);
}
示例6: getResponse
import org.mule.transport.NullPayload; //导入依赖的package包/类
public T getResponse() {
// TODO: I would rather return EmptyResponse instead of null! - sporcina (Oct.12, 2013)
// return null instead of NullPayload to ensure the caller (e.g. acceptance tests) is not exposed to Mule constructs
return (response instanceof NullPayload) ? null : response;
}
示例7: testFlow
import org.mule.transport.NullPayload; //导入依赖的package包/类
@Test
public void testFlow() throws Exception
{
runFlowAndExpect("testRecord", NullPayload.getInstance());
// wish there was a way to verify it was recorded
}
示例8: doConvert_responseNotAvailable_defaultUsed
import org.mule.transport.NullPayload; //导入依赖的package包/类
@Test
public void doConvert_responseNotAvailable_defaultUsed() {
String logOutput = logWithPayload(ContentLengthConverter.CONVERSION_STRING, NullPayload.getInstance());
assertThat(logOutput, is(DEFAULT_VALUE));
}
示例9: doConvert_responseNotAvailable_defaultUsed
import org.mule.transport.NullPayload; //导入依赖的package包/类
@Test
public void doConvert_responseNotAvailable_defaultUsed() {
String logOutput = logWithPayload(StatusCodeConverter.CONVERSION_STRING, NullPayload.getInstance());
assertThat(logOutput, is(DEFAULT_VALUE));
}
示例10: logWithSession
import org.mule.transport.NullPayload; //导入依赖的package包/类
protected String logWithSession(String conversionString, MuleSession session) throws Exception {
MuleMessage message = testMessage();
MuleEvent testEvent = MuleTestUtils.getTestEvent(NullPayload.getInstance(), session, context());
RequestContext.setEvent(testEvent);
return logSpecifierWithDefault(conversionString, message);
}