/** * Test that the <code>Message.clearProperties()</code> method deletes all the properties of the * Message. */ @Test public void testClearProperties_1() { try { TextMessage message = senderSession.createTextMessage(); message.setStringProperty("prop", "foo"); message.clearProperties(); Assert.assertEquals( "sec. 3.5.7 A message's properties are deleted by the clearProperties method.\n", null, message.getStringProperty("prop")); } catch (JMSException e) { fail(e); } }
/** * Test that the <code>Message.clearProperties()</code> method does not clear the value of the * Message's body. */ @Test public void testClearProperties_2() { try { TextMessage message = senderSession.createTextMessage(); message.setText("foo"); message.clearProperties(); Assert.assertEquals( "sec. 3.5.7 Clearing a message's property entries does not clear the value of its body.\n", "foo", message.getText()); } catch (JMSException e) { fail(e); } }