try { msg.getDoubleProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
}
public void testByteConversion() throws Exception
{
Message msg = new EmptyMessageImpl();
msg.setByteProperty("prop", (byte)123);
assertEquals(123,msg.getByteProperty("prop"));
assertEquals(123,msg.getShortProperty("prop"));
assertEquals(123,msg.getIntProperty("prop"));
assertEquals(123,msg.getLongProperty("prop"));
assertEquals("123",msg.getStringProperty("prop"));
try { msg.getBooleanProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
try { msg.getFloatProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
try { msg.getDoubleProperty("prop"); fail("Should have failed"); } catch (MessageFormatException e) { /* OK */ }
}