props.put("objectParam", new Apple());
props.put("doubleParam", 12345.6);
props.put("integerParam", 12345);
props.put("longParam", (long) 123456789);
props.put("booleanParam", Boolean.TRUE);
MuleMessage msg = new DefaultMuleMessage(context.getMessageAsString(), props, muleContext);
msg.addAttachment("test1", new DataHandler(new DataSource()
{
public InputStream getInputStream() throws IOException
{
return null;
}
public OutputStream getOutputStream() throws IOException
{
return null;
}
public String getContentType()
{
return "text/plain";
}
public String getName()
{
return "test1";
}
}));
return msg;
}
else
{
MuleMessage msg = context.getMessage();
assertEquals("param1", msg.getInboundProperty("stringParam"));
final Object o = msg.getInboundProperty("objectParam");
assertTrue(o instanceof Apple);
assertEquals(12345.6, 12345.6, msg.<Double>getInboundProperty("doubleParam", 0d));
assertEquals(12345, msg.<Integer>getInboundProperty("integerParam", 0).intValue());
assertEquals(123456789, msg.<Long>getInboundProperty("longParam", 0L).longValue());
assertEquals(Boolean.TRUE, msg.getInboundProperty("booleanParam", Boolean.FALSE));
assertNotNull(msg.getInboundAttachment("test1"));
}
return null;
}