use of org.apache.camel.Exchange in project camel by apache.
the class MinaUdpUsingTemplateTest method testSendingRawByteMessage.
@Test
public void testSendingRawByteMessage() throws Exception {
MockEndpoint endpoint = getMockEndpoint("mock:result");
endpoint.expectedMessageCount(1);
String toSend = "ef3e00559f5faf0262f5ff0962d9008daa91001cd46b0fa9330ef0f3030fff250e46f72444d1cc501678c351e04b8004c" + "4000002080000fe850bbe011030000008031b031bfe9251305441593830354720020800050440ff";
byte[] in = fromHexString(toSend);
template.sendBody("mina:udp://127.0.0.1:{{port}}?sync=false", in);
assertMockEndpointsSatisfied();
List<Exchange> list = endpoint.getReceivedExchanges();
byte[] out = list.get(0).getIn().getBody(byte[].class);
for (int i = 0; i < in.length; i++) {
assertEquals("The bytes should be the same", in[i], out[i]);
}
assertEquals("The strings should be the same", toSend, byteArrayToHex(out));
}
use of org.apache.camel.Exchange in project camel by apache.
the class MinaVMTransferExchangeOptionTest method testMinaTransferExchangeOptionWithoutException.
@Test
public void testMinaTransferExchangeOptionWithoutException() throws Exception {
Exchange exchange = sendExchange(false);
assertExchange(exchange, false);
}
use of org.apache.camel.Exchange in project camel by apache.
the class MinaVMTransferExchangeOptionTest method testMinaTransferExchangeOptionWithException.
@Test
public void testMinaTransferExchangeOptionWithException() throws Exception {
Exchange exchange = sendExchange(true);
assertExchange(exchange, true);
}
use of org.apache.camel.Exchange in project camel by apache.
the class MinaTransferExchangeOptionTest method testMinaTransferExchangeOptionWithoutException.
@Test
public void testMinaTransferExchangeOptionWithoutException() throws Exception {
Exchange exchange = sendExchange(false);
assertExchange(exchange, false);
}
use of org.apache.camel.Exchange in project camel by apache.
the class MinaTransferExchangeOptionTest method testMinaTransferExchangeOptionWithException.
@Test
public void testMinaTransferExchangeOptionWithException() throws Exception {
Exchange exchange = sendExchange(true);
assertExchange(exchange, true);
}
Aggregations