use of ca.uhn.hl7v2.model.v25.message.MDM_T02 in project camel by apache.
the class HL7MLLPCodecLongTest method createRouteBuilder.
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("mina2:tcp://127.0.0.1:" + getPort() + "?sync=true&codec=#hl7codec").process(new Processor() {
public void process(Exchange exchange) throws Exception {
assertEquals(70010, exchange.getIn().getBody(byte[].class).length);
MDM_T02 input = (MDM_T02) exchange.getIn().getBody(Message.class);
assertEquals("2.5", input.getVersion());
MSH msh = input.getMSH();
assertEquals("20071129144629", msh.getDateTimeOfMessage().getTime().getValue());
exchange.getOut().setBody("some response");
}
}).to("mock:result");
}
};
}
use of ca.uhn.hl7v2.model.v25.message.MDM_T02 in project camel by apache.
the class HL7MLLPNettyCodecLongTest method createRouteBuilder.
protected RouteBuilder createRouteBuilder() throws Exception {
return new RouteBuilder() {
public void configure() throws Exception {
from("netty4:tcp://127.0.0.1:" + getPort() + "?sync=true&encoder=#hl7encoder&decoder=#hl7decoder").process(new Processor() {
public void process(Exchange exchange) throws Exception {
assertEquals(70010, exchange.getIn().getBody(byte[].class).length);
MDM_T02 input = (MDM_T02) exchange.getIn().getBody(Message.class);
assertEquals("2.5", input.getVersion());
MSH msh = input.getMSH();
assertEquals("20071129144629", msh.getDateTimeOfMessage().getTime().getValue());
exchange.getOut().setBody("some response");
}
}).to("mock:result");
}
};
}