public class BPESpringComponentTest extends SpringTestSupport {
private static transient Log log = LogFactory.getLog(BPESpringComponentTest.class);
public void test() throws Exception {
ServiceMixClient client = new DefaultServiceMixClient(jbi);
MessageExchange me = client.createInOutExchange();
me.setService(new QName("urn:logicblaze:soa:loanbroker", "LoanBrokerService"));
me.setOperation(new QName("getLoanQuote"));
me.getMessage("in").setContent(new StringSource(
"<getLoanQuoteRequest xmlns=\"urn:logicblaze:soa:loanbroker\"><ssn>1234341</ssn>"
+ "<amount>100000.0</amount><duration>12</duration></getLoanQuoteRequest>"));
long t0 = System.currentTimeMillis();
client.sendSync(me);
long t1 = System.currentTimeMillis();
if (me.getError() != null) {
throw me.getError();
}
assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
String out = new SourceTransformer().contentToString(me.getMessage("out"));
log.info(out);
log.info("Time: " + (t1 - t0));
client.done(me);
}