InOut me = d.createInOutExchange();
me.getInMessage().setContent(new StringSource("<hello>world</hello>"));
File f = new File(getClass().getResource("servicemix.jpg").getFile());
ByteArrayOutputStream baos = new ByteArrayOutputStream();
FileUtil.copyInputStream(new FileInputStream(f), baos);
DataSource ds = new ByteArrayDataSource(baos.toByteArray(), "image/jpeg");
DataHandler dh = new DataHandler(ds);
me.getInMessage().addAttachment("image", dh);
client.sendSync(me);
assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
assertEquals(1, me.getOutMessage().getAttachmentNames().size());