use of org.mule.tck.core.streaming.SimpleByteBufferManager in project mule by mulesoft.
the class InputStreamToByteArrayTestCase method transformCursorStreamProvider.
@Test
public void transformCursorStreamProvider() throws Exception {
InputStream inputStream = new ByteArrayInputStream(DONKEY.getBytes());
CursorStreamProvider provider = new InMemoryCursorStreamProvider(inputStream, InMemoryCursorStreamConfig.getDefault(), new SimpleByteBufferManager());
assertThat(transformer.transform(provider), equalTo(DONKEY.getBytes()));
}
use of org.mule.tck.core.streaming.SimpleByteBufferManager in project mule by mulesoft.
the class FunctionExecutionTestCase method xpathWithDefaultNode.
@Test
public void xpathWithDefaultNode() throws Exception {
InputStream stream = getDocumentStream();
InMemoryCursorStreamProvider streamProvider = new InMemoryCursorStreamProvider(stream, InMemoryCursorStreamConfig.getDefault(), new SimpleByteBufferManager());
Object value = flowRunner("xpathWithDefaultNode").withVariable("xmlPayload", streamProvider).run().getMessage().getPayload().getValue();
assertThat(value, is("xpathWithDefaultNode"));
}
use of org.mule.tck.core.streaming.SimpleByteBufferManager in project mule by mulesoft.
the class PetStoreSerializableParameterTestCase method cursorStreamProviderParameter.
@Test
public void cursorStreamProviderParameter() throws Exception {
InputStream inputStream = new ByteArrayInputStream(DONKEY.getBytes());
CursorStreamProvider provider = new InMemoryCursorStreamProvider(inputStream, InMemoryCursorStreamConfig.getDefault(), new SimpleByteBufferManager());
Message message = flowRunner("dynamicSerializableParameter").withVariable("animal", provider).run().getMessage();
assertThat(message.getPayload().getValue(), is(DONKEY));
}
Aggregations