Class MessagePropertyConversionTest

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

public class MessagePropertyConversionTest extends PTPTestCase
Test the conversion of primitive types for the jakarta.jms.Message properties.
See JMS Specification, sec. 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 jakarta.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).
Version:
$Id: MessagePropertyConversionTest.java,v 1.1 2007/03/29 04:28:34 starksm Exp $
Author:
Jeff Mesnil (jmesnil@gmail.com)
  • Field Summary

    Fields inherited from class org.objectweb.jtests.jms.framework.JMSTestCase

    admin, PROP_FILE_NAME, startServer
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static junit.framework.Test
    Method to use this class in a Test suite
    void
    if a property is set as a boolean, it can also be read as a boolean.
    void
    if a property is set as a boolean, to get is as a byte throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a boolean, to get is as a double throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a boolean, to get is as a float throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a boolean, to get is as a int throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a boolean, to get is as a long throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a boolean, to get is as a short throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a boolean, it can also be read as a String.
    void
    if a property is set as a byte, to get is as a boolean throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a byte, it can also be read as a byte.
    void
    if a property is set as a byte, to get is as a double throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a byte, to get is as a float throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a byte, it can also be read as an int.
    void
    if a property is set as a byte, it can also be read as a long.
    void
    if a property is set as a byte, it can also be read as a short.
    void
    if a property is set as a byte, it can also be read as a String.
    void
    if a property is set as a double, to get is as a boolean throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a double, to get is as a byte throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a double, it can also be read as a double.
    void
    if a property is set as a double, to get is as a float throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a double, to get is as an int throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a double, to get is as a long throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a double, to get is as a short throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a double, it can also be read as a java.lang.String.
    void
    if a property is set as a float, to get is as a boolean throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a float, to get is as a byte throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a float, it can also be read as a double.
    void
    if a property is set as a float, it can also be read as a float.
    void
    if a property is set as a float, to get is as a int throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a float, to get is as a long throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a float, to get is as a short throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a float, it can also be read as a String.
    void
    if a property is set as a int, to get is as a boolean throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a int, to get is as a byte throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a int, to get is as a double throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a int, to get is as a float throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as an int, it can also be read as an int.
    void
    if a property is set as an int, it can also be read as a long.
    void
    if a property is set as a int, to get is as a short throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as an int, it can also be read as a String.
    void
    if a property is set as a long, to get is as a boolean throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a long, to get is as a byte throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a long, to get is as a double throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a long, to get is as a float throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a long, to get is as an int throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a long, it can also be read as a long.
    void
    if a property is set as a long, to get is as a short throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a long, it can also be read as a String.
    void
    if a property is set as a short, to get is as a boolean throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a short, to get is as a byte throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a short, to get is as a double throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a short, to get is as a float throws a jakarta.jms.MessageFormatException.
    void
    if a property is set as a short, it can also be read as an int.
    void
    if a property is set as a short, it can also be read as a long.
    void
    if a property is set as a short, it can also be read as a short.
    void
    if a property is set as a short, it can also be read as a String.
    void
    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
    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
    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
    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
    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
    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
    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
    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
    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
    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
    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
    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
    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
    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
    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

    setUp, tearDown

    Methods inherited from class org.objectweb.jtests.jms.framework.JMSTestCase

    fail, getProviderProperties

    Methods inherited from class junit.framework.TestCase

    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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • MessagePropertyConversionTest

      public MessagePropertyConversionTest(String name)
  • Method Details

    • 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 jakarta.jms.MessageFormatException.
    • testDouble2Long

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

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

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

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

      public void testDouble2Boolean()
      if a property is set as a double, to get is as a boolean throws a jakarta.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 jakarta.jms.MessageFormatException.
    • testFloat2Int

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

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

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

      public void testFloat2Boolean()
      if a property is set as a float, to get is as a boolean throws a jakarta.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 jakarta.jms.MessageFormatException.
    • testLong2Float

      public void testLong2Float()
      if a property is set as a long, to get is as a float throws a jakarta.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 jakarta.jms.MessageFormatException.
    • testLong2Short

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

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

      public void testLong2Boolean()
      if a property is set as a long, to get is as a boolean throws a jakarta.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 jakarta.jms.MessageFormatException.
    • testInt2Float

      public void testInt2Float()
      if a property is set as a int, to get is as a float throws a jakarta.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 jakarta.jms.MessageFormatException.
    • testInt2Byte

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

      public void testInt2Boolean()
      if a property is set as a int, to get is as a boolean throws a jakarta.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 jakarta.jms.MessageFormatException.
    • testShort2Float

      public void testShort2Float()
      if a property is set as a short, to get is as a float throws a jakarta.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 jakarta.jms.MessageFormatException.
    • testShort2Boolean

      public void testShort2Boolean()
      if a property is set as a short, to get is as a boolean throws a jakarta.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 jakarta.jms.MessageFormatException.
    • testByte2Float

      public void testByte2Float()
      if a property is set as a byte, to get is as a float throws a jakarta.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 jakarta.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 jakarta.jms.MessageFormatException.
    • testBoolean2Float

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

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

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

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

      public void testBoolean2Byte()
      if a property is set as a boolean, to get is as a byte throws a jakarta.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 junit.framework.Test suite()
      Method to use this class in a Test suite