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

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.objectweb.jtests.jms.framework.JMSTestCase
              extended by org.objectweb.jtests.jms.framework.PTPTestCase
                  extended by org.objectweb.jtests.jms.conform.message.properties.MessagePropertyTest
All Implemented Interfaces:
junit.framework.Test

public class MessagePropertyTest
extends PTPTestCase

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

Version:
$Id: MessagePropertyTest.java,v 1.1 2007/03/29 04:28:34 starksm Exp $
Author:
Jeff Mesnil (jmesnil@inrialpes.fr)

Field Summary
 
Fields inherited from class org.objectweb.jtests.jms.framework.PTPTestCase
admin, ctx, receiver, receiverConnection, receiverQCF, receiverQueue, receiverSession, sender, senderConnection, senderQCF, senderQueue, senderSession
 
Constructor Summary
MessagePropertyTest(java.lang.String name)
           
 
Method Summary
static junit.framework.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
setUp, tearDown
 
Methods inherited from class org.objectweb.jtests.jms.framework.JMSTestCase
fail, getProviderProperties
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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 junit.framework.Test suite()
Method to use this class in a Test suite



Copyright © 2010 JBoss, A division of Red Hat. All Rights Reserved.