org.objectweb.jtests.jms.conform.message.properties
Class MessagePropertyTest

java.lang.Object
  extended byTestCase
      extended byorg.objectweb.jtests.jms.framework.JMSTestCase (src) 
          extended byorg.objectweb.jtests.jms.framework.PTPTestCase (src) 
              extended byorg.objectweb.jtests.jms.conform.message.properties.MessagePropertyTest

public class MessagePropertyTest
extends PTPTestCase (src)

Test the javax.jms.Message properties.
See JMS Specification, §3.5 Message Properties (p.32-37)

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jtests.jms.framework.PTPTestCase (src)
admin, ctx, receiver, receiverConnection, receiverQCF, receiverQueue, receiverSession, sender, senderConnection, senderQCF, senderQueue, senderSession
 
Constructor Summary
MessagePropertyTest(java.lang.String name)
           
 
Method Summary
static Test suite()
          Method to use this class in a Test suite
 void testClearProperties_1()
          Test that the Message.clearProperties() method deletes all the properties of the Message.
 void testClearProperties_2()
          Test that the Message.clearProperties() method does not clear the value of the Message's body.
 void testGetBooleanProperty()
          Test that an attempt to get a boolean property which does not exist returns false
 void testGetByteProperty()
          Test that an attempt to get a byte property which does not exist throw a java.lang.NumberFormatException
 void testGetDoubleProperty()
          Test that an attempt to get a double property which does not exist throw a java.lang.NullPointerException
 void testGetFloatProperty()
          Test that an attempt to get a float property which does not exist throw a java.lang.NullPointerException
 void testGetIntProperty()
          Test that an attempt to get a int property which does not exist throw a java.lang.NumberFormatException
 void testGetLongProperty()
          Test that an attempt to get a long property which does not exist throw a java.lang.NumberFormatException
 void testGetObjectProperty()
          Test that a null value is returned by the Message.getObjectProperty() method if a property by the specified name does not exits.
 void testGetPropertyNames()
          Test that the Message.getPropertyNames() method does not return the name of the JMS standard header fields (e.g.
 void testGetShortProperty()
          Test that an attempt to get a short property which does not exist throw a java.lang.NumberFormatException
 void testGetStringProperty()
          Test that a null value is returned by the Message.getStringProperty() method if a property by the specified name does not exits.
 void testPropertyIteration()
          Test that the Message.getPropertyNames() method returns an empty java.util.Enumeration if there is no properties.
 void testSetObjectProperty_1()
          if a property is set as a Float with the Message.setObjectProperty() method, it can be retrieve directly as a double by Message.getFloatProperty()
 void testSetObjectProperty_2()
          Test that any other class than Boolean, Byte, Short, Integer, Long, Float, Double and String used in the Message.setObjectProperty() method throws a javax.jms.MessageFormatException.
 
Methods inherited from class org.objectweb.jtests.jms.framework.PTPTestCase (src)
setUp, tearDown
 
Methods inherited from class org.objectweb.jtests.jms.framework.JMSTestCase (src)
fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessagePropertyTest

public MessagePropertyTest(java.lang.String name)
Method Detail

testSetObjectProperty_2

public void testSetObjectProperty_2()
Test that any other class than Boolean, Byte, Short, Integer, Long, Float, Double and String used in the Message.setObjectProperty() method throws a javax.jms.MessageFormatException.


testSetObjectProperty_1

public void testSetObjectProperty_1()
if a property is set as a Float with the Message.setObjectProperty() method, it can be retrieve directly as a double by Message.getFloatProperty()


testGetObjectProperty

public void testGetObjectProperty()
Test that a null value is returned by the Message.getObjectProperty() method if a property by the specified name does not exits.


testGetStringProperty

public void testGetStringProperty()
Test that a null value is returned by the Message.getStringProperty() method if a property by the specified name does not exits.


testGetDoubleProperty

public void testGetDoubleProperty()
Test that an attempt to get a double property which does not exist throw a java.lang.NullPointerException


testGetFloatProperty

public void testGetFloatProperty()
Test that an attempt to get a float property which does not exist throw a java.lang.NullPointerException


testGetLongProperty

public void testGetLongProperty()
Test that an attempt to get a long property which does not exist throw a java.lang.NumberFormatException


testGetIntProperty

public void testGetIntProperty()
Test that an attempt to get a int property which does not exist throw a java.lang.NumberFormatException


testGetShortProperty

public void testGetShortProperty()
Test that an attempt to get a short property which does not exist throw a java.lang.NumberFormatException


testGetByteProperty

public void testGetByteProperty()
Test that an attempt to get a byte property which does not exist throw a java.lang.NumberFormatException


testGetBooleanProperty

public void testGetBooleanProperty()
Test that an attempt to get a boolean property which does not exist returns false


testGetPropertyNames

public void testGetPropertyNames()
Test that the Message.getPropertyNames() method does not return the name of the JMS standard header fields (e.g. JMSCorrelationID.


testPropertyIteration

public void testPropertyIteration()
Test that the Message.getPropertyNames() method returns an empty java.util.Enumeration if there is no properties.
If there are some, test that it properly return their names.


testClearProperties_2

public void testClearProperties_2()
Test that the Message.clearProperties() method does not clear the value of the Message's body.


testClearProperties_1

public void testClearProperties_1()
Test that the Message.clearProperties() method deletes all the properties of the Message.


suite

public static Test suite()
Method to use this class in a Test suite