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

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.MessagePropertyConversionTest

public class MessagePropertyConversionTest
extends PTPTestCase (src)

Test the conversion of primitive types for the javax.jms.Message properties.
See JMS Specification, §3.5.4 Property Value Conversion and the corresponding table (p.33-34).
The method name testXXX2YYY means that we test if a property which has been set as a XXX type can be read as a YYY type, where XXX and YYY can be boolean, byte, short, long, float double or String.

          ---------------------------------------------------------------|
          | boolean | byte | short | int | long | float | double | String| 
 |-----------------------------------------------------------------------|
 |boolean |    X                                                     X   |
 |byte    |            X       X      X     X                        X   |
 |short   |                    X      X     X                        X   |
 |int     |                           X     X                        X   |
 |long    |                                 X                        X   |
 |float   |                                         X       X        X   |
 |double  |                                                 X        X   |
 |String  |    Y       Y       Y      Y     Y       Y       Y        X   |
 |-----------------------------------------------------------------------|
 
A value set as the row type can be read as the column type.
The unmarked cases must throw a javax.jms.MessageFormatException
The cases marked with a Y should throw a java.lang.MessageFormatException if the String is not a correct representation of the column type (otherwise, it returns the property).

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
MessagePropertyConversionTest(java.lang.String name)
           
 
Method Summary
static Test suite()
          Method to use this class in a Test suite
 void testBoolean2Boolean()
          if a property is set as a boolean, it can also be read as a boolean.
 void testBoolean2Byte()
          if a property is set as a boolean, to get is as a byte throws a javax.jms.MessageFormatException.
 void testBoolean2Double()
          if a property is set as a boolean, to get is as a double throws a javax.jms.MessageFormatException.
 void testBoolean2Float()
          if a property is set as a boolean, to get is as a float throws a javax.jms.MessageFormatException.
 void testBoolean2Int()
          if a property is set as a boolean, to get is as a int throws a javax.jms.MessageFormatException.
 void testBoolean2Long()
          if a property is set as a boolean, to get is as a long throws a javax.jms.MessageFormatException.
 void testBoolean2Short()
          if a property is set as a boolean, to get is as a short throws a javax.jms.MessageFormatException.
 void testBoolean2String()
          if a property is set as a boolean, it can also be read as a String.
 void testByte2Boolean()
          if a property is set as a byte, to get is as a boolean throws a javax.jms.MessageFormatException.
 void testByte2Byte()
          if a property is set as a byte, it can also be read as a byte.
 void testByte2Double()
          if a property is set as a byte, to get is as a double throws a javax.jms.MessageFormatException.
 void testByte2Float()
          if a property is set as a byte, to get is as a float throws a javax.jms.MessageFormatException.
 void testByte2Int()
          if a property is set as a byte, it can also be read as an int.
 void testByte2Long()
          if a property is set as a byte, it can also be read as a long.
 void testByte2Short()
          if a property is set as a byte, it can also be read as a short.
 void testByte2String()
          if a property is set as a byte, it can also be read as a String.
 void testDouble2Boolean()
          if a property is set as a double, to get is as a boolean throws a javax.jms.MessageFormatException.
 void testDouble2Byte()
          if a property is set as a double, to get is as a byte throws a javax.jms.MessageFormatException.
 void testDouble2Double()
          if a property is set as a double, it can also be read as a double.
 void testDouble2Float()
          if a property is set as a double, to get is as a float throws a javax.jms.MessageFormatException.
 void testDouble2Int()
          if a property is set as a double, to get is as an int throws a javax.jms.MessageFormatException.
 void testDouble2Long()
          if a property is set as a double, to get is as a long throws a javax.jms.MessageFormatException.
 void testDouble2Short()
          if a property is set as a double, to get is as a short throws a javax.jms.MessageFormatException.
 void testDouble2String()
          if a property is set as a double, it can also be read as a java.lang.String.
 void testFloat2Boolean()
          if a property is set as a float, to get is as a boolean throws a javax.jms.MessageFormatException.
 void testFloat2Byte()
          if a property is set as a float, to get is as a byte throws a javax.jms.MessageFormatException.
 void testFloat2Double()
          if a property is set as a float, it can also be read as a double.
 void testFloat2Float()
          if a property is set as a float, it can also be read as a float.
 void testFloat2Int()
          if a property is set as a float, to get is as a int throws a javax.jms.MessageFormatException.
 void testFloat2Long()
          if a property is set as a float, to get is as a long throws a javax.jms.MessageFormatException.
 void testFloat2Short()
          if a property is set as a float, to get is as a short throws a javax.jms.MessageFormatException.
 void testFloat2String()
          if a property is set as a float, it can also be read as a String.
 void testInt2Boolean()
          if a property is set as a int, to get is as a boolean throws a javax.jms.MessageFormatException.
 void testInt2Byte()
          if a property is set as a int, to get is as a byte throws a javax.jms.MessageFormatException.
 void testInt2Double()
          if a property is set as a int, to get is as a double throws a javax.jms.MessageFormatException.
 void testInt2Float()
          if a property is set as a int, to get is as a float throws a javax.jms.MessageFormatException.
 void testInt2Int()
          if a property is set as an int, it can also be read as an int.
 void testInt2Long()
          if a property is set as an int, it can also be read as a long.
 void testInt2Short()
          if a property is set as a int, to get is as a short throws a javax.jms.MessageFormatException.
 void testInt2String()
          if a property is set as an int, it can also be read as a String.
 void testLong2Boolean()
          if a property is set as a long, to get is as a boolean throws a javax.jms.MessageFormatException.
 void testLong2Byte()
          if a property is set as a long, to get is as a byte throws a javax.jms.MessageFormatException.
 void testLong2Double()
          if a property is set as a long, to get is as a double throws a javax.jms.MessageFormatException.
 void testLong2Float()
          if a property is set as a long, to get is as a float throws a javax.jms.MessageFormatException.
 void testLong2Int()
          if a property is set as a long, to get is as an int throws a javax.jms.MessageFormatException.
 void testLong2Long()
          if a property is set as a long, it can also be read as a long.
 void testLong2Short()
          if a property is set as a long, to get is as a short throws a javax.jms.MessageFormatException.
 void testLong2String()
          if a property is set as a long, it can also be read as a String.
 void testShort2Boolean()
          if a property is set as a short, to get is as a boolean throws a javax.jms.MessageFormatException.
 void testShort2Byte()
          if a property is set as a short, to get is as a byte throws a javax.jms.MessageFormatException.
 void testShort2Double()
          if a property is set as a short, to get is as a double throws a javax.jms.MessageFormatException.
 void testShort2Float()
          if a property is set as a short, to get is as a float throws a javax.jms.MessageFormatException.
 void testShort2Int()
          if a property is set as a short, it can also be read as an int.
 void testShort2Long()
          if a property is set as a short, it can also be read as a long.
 void testShort2Short()
          if a property is set as a short, it can also be read as a short.
 void testShort2String()
          if a property is set as a short, it can also be read as a String.
 void testString2Boolean_1()
          if a property is set as a java.lang.String, it can also be read as a boolean if the String is a correct representation of a boolean (e.g.
 void testString2Boolean_2()
          if a property is set as a java.lang.String, to get it as a boolean returns true if the property is not null and is equal, ignoring case, to the string "true" (.eg.
 void testString2Byte_1()
          if a property is set as a java.lang.String, it can also be read as a byte if the String is a correct representation of a byte (e.g.
 void testString2Byte_2()
          if a property is set as a java.lang.String, to get it as a byte throws a java.lang.NuberFormatException if the String is not a correct representation for a byte (e.g.
 void testString2Double_1()
          if a property is set as a java.lang.String, it can also be read as a double as long as the String is a correct representation of a double (e.g.
 void testString2Double_2()
          if a property is set as a java.lang.String, to get it as a double throws a java.lang.NuberFormatException if the String is not a correct representation for a double (e.g.
 void testString2Float_1()
          if a property is set as a java.lang.String, it can also be read as a float as long as the String is a correct representation of a float (e.g.
 void testString2Float_2()
          if a property is set as a java.lang.String, to get it as a float throws a java.lang.NuberFormatException if the String is not a correct representation for a float (e.g.
 void testString2Int_1()
          if a property is set as a java.lang.String, it can also be read as a int as long as the String is a correct representation of a int (e.g.
 void testString2Int_2()
          if a property is set as a java.lang.String, to get it as a int throws a java.lang.NuberFormatException if the String is not a correct representation for a int (e.g.
 void testString2Long_1()
          if a property is set as a java.lang.String, it can also be read as a long as long as the String is a correct representation of a long (e.g.
 void testString2Long_2()
          if a property is set as a java.lang.String, to get it as a long throws a java.lang.NuberFormatException if the String is not a correct representation for a long (e.g.
 void testString2Short_1()
          if a property is set as a java.lang.String, it can also be read as a short as long as the String is a correct representation of a short (e.g.
 void testString2Short_2()
          if a property is set as a java.lang.String, to get it as a short throws a java.lang.NuberFormatException if the String is not a correct representation for a short (e.g.
 void testString2String()
          if a property is set as a java.lang.String, it can also be read as a java.lang.String.
 
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

MessagePropertyConversionTest

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

testString2String

public void testString2String()
if a property is set as a java.lang.String, it can also be read as a java.lang.String.


testString2Double_2

public void testString2Double_2()
if a property is set as a java.lang.String, to get it as a double throws a java.lang.NuberFormatException if the String is not a correct representation for a double (e.g. "not a number").


testString2Double_1

public void testString2Double_1()
if a property is set as a java.lang.String, it can also be read as a double as long as the String is a correct representation of a double (e.g. "3.14159").


testString2Float_2

public void testString2Float_2()
if a property is set as a java.lang.String, to get it as a float throws a java.lang.NuberFormatException if the String is not a correct representation for a float (e.g. "not_a_number").


testString2Float_1

public void testString2Float_1()
if a property is set as a java.lang.String, it can also be read as a float as long as the String is a correct representation of a float (e.g. "3.14159").


testString2Long_2

public void testString2Long_2()
if a property is set as a java.lang.String, to get it as a long throws a java.lang.NuberFormatException if the String is not a correct representation for a long (e.g. "3.14159").


testString2Long_1

public void testString2Long_1()
if a property is set as a java.lang.String, it can also be read as a long as long as the String is a correct representation of a long (e.g. "0").


testString2Int_2

public void testString2Int_2()
if a property is set as a java.lang.String, to get it as a int throws a java.lang.NuberFormatException if the String is not a correct representation for a int (e.g. "3.14159").


testString2Int_1

public void testString2Int_1()
if a property is set as a java.lang.String, it can also be read as a int as long as the String is a correct representation of a int (e.g. "0").


testString2Short_2

public void testString2Short_2()
if a property is set as a java.lang.String, to get it as a short throws a java.lang.NuberFormatException if the String is not a correct representation for a short (e.g. "3.14159").


testString2Short_1

public void testString2Short_1()
if a property is set as a java.lang.String, it can also be read as a short as long as the String is a correct representation of a short (e.g. "0").


testString2Byte_2

public void testString2Byte_2()
if a property is set as a java.lang.String, to get it as a byte throws a java.lang.NuberFormatException if the String is not a correct representation for a byte (e.g. "3.14159").


testString2Byte_1

public void testString2Byte_1()
if a property is set as a java.lang.String, it can also be read as a byte if the String is a correct representation of a byte (e.g. "0").


testString2Boolean_2

public void testString2Boolean_2()
if a property is set as a java.lang.String, to get it as a boolean returns true if the property is not null and is equal, ignoring case, to the string "true" (.eg. "True" is ok), else it returns false (e.g. "test")


testString2Boolean_1

public void testString2Boolean_1()
if a property is set as a java.lang.String, it can also be read as a boolean if the String is a correct representation of a boolean (e.g. "true").


testDouble2String

public void testDouble2String()
if a property is set as a double, it can also be read as a java.lang.String.


testDouble2Double

public void testDouble2Double()
if a property is set as a double, it can also be read as a double.


testDouble2Float

public void testDouble2Float()
if a property is set as a double, to get is as a float throws a javax.jms.MessageFormatException.


testDouble2Long

public void testDouble2Long()
if a property is set as a double, to get is as a long throws a javax.jms.MessageFormatException.


testDouble2Int

public void testDouble2Int()
if a property is set as a double, to get is as an int throws a javax.jms.MessageFormatException.


testDouble2Short

public void testDouble2Short()
if a property is set as a double, to get is as a short throws a javax.jms.MessageFormatException.


testDouble2Byte

public void testDouble2Byte()
if a property is set as a double, to get is as a byte throws a javax.jms.MessageFormatException.


testDouble2Boolean

public void testDouble2Boolean()
if a property is set as a double, to get is as a boolean throws a javax.jms.MessageFormatException.


testFloat2String

public void testFloat2String()
if a property is set as a float, it can also be read as a String.


testFloat2Double

public void testFloat2Double()
if a property is set as a float, it can also be read as a double.


testFloat2Float

public void testFloat2Float()
if a property is set as a float, it can also be read as a float.


testFloat2Long

public void testFloat2Long()
if a property is set as a float, to get is as a long throws a javax.jms.MessageFormatException.


testFloat2Int

public void testFloat2Int()
if a property is set as a float, to get is as a int throws a javax.jms.MessageFormatException.


testFloat2Short

public void testFloat2Short()
if a property is set as a float, to get is as a short throws a javax.jms.MessageFormatException.


testFloat2Byte

public void testFloat2Byte()
if a property is set as a float, to get is as a byte throws a javax.jms.MessageFormatException.


testFloat2Boolean

public void testFloat2Boolean()
if a property is set as a float, to get is as a boolean throws a javax.jms.MessageFormatException.


testLong2String

public void testLong2String()
if a property is set as a long, it can also be read as a String.


testLong2Double

public void testLong2Double()
if a property is set as a long, to get is as a double throws a javax.jms.MessageFormatException.


testLong2Float

public void testLong2Float()
if a property is set as a long, to get is as a float throws a javax.jms.MessageFormatException.


testLong2Long

public void testLong2Long()
if a property is set as a long, it can also be read as a long.


testLong2Int

public void testLong2Int()
if a property is set as a long, to get is as an int throws a javax.jms.MessageFormatException.


testLong2Short

public void testLong2Short()
if a property is set as a long, to get is as a short throws a javax.jms.MessageFormatException.


testLong2Byte

public void testLong2Byte()
if a property is set as a long, to get is as a byte throws a javax.jms.MessageFormatException.


testLong2Boolean

public void testLong2Boolean()
if a property is set as a long, to get is as a boolean throws a javax.jms.MessageFormatException.


testInt2String

public void testInt2String()
if a property is set as an int, it can also be read as a String.


testInt2Double

public void testInt2Double()
if a property is set as a int, to get is as a double throws a javax.jms.MessageFormatException.


testInt2Float

public void testInt2Float()
if a property is set as a int, to get is as a float throws a javax.jms.MessageFormatException.


testInt2Long

public void testInt2Long()
if a property is set as an int, it can also be read as a long.


testInt2Int

public void testInt2Int()
if a property is set as an int, it can also be read as an int.


testInt2Short

public void testInt2Short()
if a property is set as a int, to get is as a short throws a javax.jms.MessageFormatException.


testInt2Byte

public void testInt2Byte()
if a property is set as a int, to get is as a byte throws a javax.jms.MessageFormatException.


testInt2Boolean

public void testInt2Boolean()
if a property is set as a int, to get is as a boolean throws a javax.jms.MessageFormatException.


testShort2String

public void testShort2String()
if a property is set as a short, it can also be read as a String.


testShort2Double

public void testShort2Double()
if a property is set as a short, to get is as a double throws a javax.jms.MessageFormatException.


testShort2Float

public void testShort2Float()
if a property is set as a short, to get is as a float throws a javax.jms.MessageFormatException.


testShort2Long

public void testShort2Long()
if a property is set as a short, it can also be read as a long.


testShort2Int

public void testShort2Int()
if a property is set as a short, it can also be read as an int.


testShort2Short

public void testShort2Short()
if a property is set as a short, it can also be read as a short.


testShort2Byte

public void testShort2Byte()
if a property is set as a short, to get is as a byte throws a javax.jms.MessageFormatException.


testShort2Boolean

public void testShort2Boolean()
if a property is set as a short, to get is as a boolean throws a javax.jms.MessageFormatException.


testByte2String

public void testByte2String()
if a property is set as a byte, it can also be read as a String.


testByte2Double

public void testByte2Double()
if a property is set as a byte, to get is as a double throws a javax.jms.MessageFormatException.


testByte2Float

public void testByte2Float()
if a property is set as a byte, to get is as a float throws a javax.jms.MessageFormatException.


testByte2Long

public void testByte2Long()
if a property is set as a byte, it can also be read as a long.


testByte2Int

public void testByte2Int()
if a property is set as a byte, it can also be read as an int.


testByte2Short

public void testByte2Short()
if a property is set as a byte, it can also be read as a short.


testByte2Byte

public void testByte2Byte()
if a property is set as a byte, it can also be read as a byte.


testByte2Boolean

public void testByte2Boolean()
if a property is set as a byte, to get is as a boolean throws a javax.jms.MessageFormatException.


testBoolean2String

public void testBoolean2String()
if a property is set as a boolean, it can also be read as a String.


testBoolean2Double

public void testBoolean2Double()
if a property is set as a boolean, to get is as a double throws a javax.jms.MessageFormatException.


testBoolean2Float

public void testBoolean2Float()
if a property is set as a boolean, to get is as a float throws a javax.jms.MessageFormatException.


testBoolean2Long

public void testBoolean2Long()
if a property is set as a boolean, to get is as a long throws a javax.jms.MessageFormatException.


testBoolean2Int

public void testBoolean2Int()
if a property is set as a boolean, to get is as a int throws a javax.jms.MessageFormatException.


testBoolean2Short

public void testBoolean2Short()
if a property is set as a boolean, to get is as a short throws a javax.jms.MessageFormatException.


testBoolean2Byte

public void testBoolean2Byte()
if a property is set as a boolean, to get is as a byte throws a javax.jms.MessageFormatException.


testBoolean2Boolean

public void testBoolean2Boolean()
if a property is set as a boolean, it can also be read as a boolean.


suite

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