use of org.springframework.test.annotation.DirtiesContext in project camel by apache.
the class BindySimpleKeyValuePairTabUnmarshallTest method testUnMarshallMessage.
@Test
@DirtiesContext
public void testUnMarshallMessage() throws Exception {
result.expectedMessageCount(1);
result.assertIsSatisfied();
Order order = result.getReceivedExchanges().get(0).getIn().getBody(Order.class);
Assert.assertTrue(order.getHeader().toString().contains("FIX.4.1, 9: 20, 34: 1 , 35: 0, 49: INVMGR, 56: BRKR"));
Assert.assertTrue(order.toString().contains("BE.CHM.001, 11: CHM0001-01, 22: 4, 48: BE0001245678, 54: 1, 58: this is a camel - bindy test"));
Assert.assertTrue(order.getTrailer().toString().contains("10: 220"));
}
use of org.springframework.test.annotation.DirtiesContext in project camel by apache.
the class BindySimpleCsvIntegerMarshallTest method testMarshallMessage.
@Test
@DirtiesContext
public void testMarshallMessage() throws Exception {
MyOrder order = new MyOrder();
order.setInstrument("XX23456789");
order.setQuantity(12345678);
order.setPrice(new BigDecimal("400.25"));
result.expectedBodiesReceived("XX23456789,12345678,400.25\r\n");
template.sendBody(order);
result.assertIsSatisfied();
}
use of org.springframework.test.annotation.DirtiesContext in project camel by apache.
the class BindyImpliedTest method testMarshall.
// *************************************************************************
// TEST
// *************************************************************************
@Test
@DirtiesContext
public void testMarshall() throws Exception {
Record rec = new Record();
rec.setField1(123.45);
rec.setField2(67.89);
rec.setField3(11.24F);
rec.setField4(33.45F);
rec.setField5(new BigDecimal(60.52));
rec.setField6(new BigDecimal(70.62));
mresult.expectedBodiesReceived("1234567.89 112433.45 605270.62\r\n");
mtemplate.sendBody(rec);
mresult.assertIsSatisfied();
}
use of org.springframework.test.annotation.DirtiesContext in project camel by apache.
the class BindyImpliedTest method testUnMarshall.
@Test
@DirtiesContext
public void testUnMarshall() throws Exception {
utemplate.sendBody("1234567.89 112433.45 605270.62");
uresult.expectedMessageCount(1);
uresult.assertIsSatisfied();
// check the model
Exchange exc = uresult.getReceivedExchanges().get(0);
Record data = exc.getIn().getBody(Record.class);
Assert.assertEquals(123.45D, data.getField1(), 0D);
Assert.assertEquals(67.89D, data.getField2(), 0D);
Assert.assertEquals(11.24F, data.getField3(), 0.001);
Assert.assertEquals(33.45F, data.getField4(), 0.001);
Assert.assertEquals(60.52D, data.getField5().doubleValue(), 0.001);
Assert.assertEquals(70.62D, data.getField6().doubleValue(), 0.001);
}
use of org.springframework.test.annotation.DirtiesContext in project camel by apache.
the class BindyNumberTest method testMarshall.
// *************************************************************************
// TEST
// *************************************************************************
@Test
@DirtiesContext
public void testMarshall() throws Exception {
DataModel rec = new DataModel();
rec.field1 = new BigDecimal(123.45);
rec.field2 = new BigDecimal(10.00);
rec.field3 = new BigDecimal(10.00);
rec.field4 = new Double(10.00);
rec.field5 = new Double(10.00);
mresult.expectedBodiesReceived("1234510.00 1010.00 10\r\n");
mtemplate.sendBody(rec);
mresult.assertIsSatisfied();
}
Aggregations