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
Test the conversion of primitive types for the
See JMS Specification, sec. 3.5.4 Property Value Conversion and the corresponding table (p.33-34).
The method name
The unmarked cases must throw a
The cases marked with a Y should throw a
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.PTPTestCase
ctx, receiver, receiverConnection, receiverQCF, receiverQueue, receiverSession, sender, senderConnection, senderQCF, senderQueue, senderSessionFields inherited from class org.objectweb.jtests.jms.framework.JMSTestCase
admin, PROP_FILE_NAME, startServer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic junit.framework.Testsuite()Method to use this class in a Test suitevoidif a property is set as aboolean, it can also be read as aboolean.voidif a property is set as aboolean, to get is as abytethrows ajakarta.jms.MessageFormatException.voidif a property is set as aboolean, to get is as adoublethrows ajakarta.jms.MessageFormatException.voidif a property is set as aboolean, to get is as afloatthrows ajakarta.jms.MessageFormatException.voidif a property is set as aboolean, to get is as aintthrows ajakarta.jms.MessageFormatException.voidif a property is set as aboolean, to get is as alongthrows ajakarta.jms.MessageFormatException.voidif a property is set as aboolean, to get is as ashortthrows ajakarta.jms.MessageFormatException.voidif a property is set as aboolean, it can also be read as aString.voidif a property is set as abyte, to get is as abooleanthrows ajakarta.jms.MessageFormatException.voidif a property is set as abyte, it can also be read as abyte.voidif a property is set as abyte, to get is as adoublethrows ajakarta.jms.MessageFormatException.voidif a property is set as abyte, to get is as afloatthrows ajakarta.jms.MessageFormatException.voidif a property is set as abyte, it can also be read as anint.voidif a property is set as abyte, it can also be read as along.voidif a property is set as abyte, it can also be read as ashort.voidif a property is set as abyte, it can also be read as aString.voidif a property is set as adouble, to get is as abooleanthrows ajakarta.jms.MessageFormatException.voidif a property is set as adouble, to get is as abytethrows ajakarta.jms.MessageFormatException.voidif a property is set as adouble, it can also be read as adouble.voidif a property is set as adouble, to get is as afloatthrows ajakarta.jms.MessageFormatException.voidif a property is set as adouble, to get is as anintthrows ajakarta.jms.MessageFormatException.voidif a property is set as adouble, to get is as alongthrows ajakarta.jms.MessageFormatException.voidif a property is set as adouble, to get is as ashortthrows ajakarta.jms.MessageFormatException.voidif a property is set as adouble, it can also be read as ajava.lang.String.voidif a property is set as afloat, to get is as abooleanthrows ajakarta.jms.MessageFormatException.voidif a property is set as afloat, to get is as abytethrows ajakarta.jms.MessageFormatException.voidif a property is set as afloat, it can also be read as adouble.voidif a property is set as afloat, it can also be read as afloat.voidif a property is set as afloat, to get is as aintthrows ajakarta.jms.MessageFormatException.voidif a property is set as afloat, to get is as alongthrows ajakarta.jms.MessageFormatException.voidif a property is set as afloat, to get is as ashortthrows ajakarta.jms.MessageFormatException.voidif a property is set as afloat, it can also be read as aString.voidif a property is set as aint, to get is as abooleanthrows ajakarta.jms.MessageFormatException.voidif a property is set as aint, to get is as abytethrows ajakarta.jms.MessageFormatException.voidif a property is set as aint, to get is as adoublethrows ajakarta.jms.MessageFormatException.voidif a property is set as aint, to get is as afloatthrows ajakarta.jms.MessageFormatException.voidif a property is set as anint, it can also be read as anint.voidif a property is set as anint, it can also be read as along.voidif a property is set as aint, to get is as ashortthrows ajakarta.jms.MessageFormatException.voidif a property is set as anint, it can also be read as aString.voidif a property is set as along, to get is as abooleanthrows ajakarta.jms.MessageFormatException.voidif a property is set as along, to get is as abytethrows ajakarta.jms.MessageFormatException.voidif a property is set as along, to get is as adoublethrows ajakarta.jms.MessageFormatException.voidif a property is set as along, to get is as afloatthrows ajakarta.jms.MessageFormatException.voidif a property is set as along, to get is as anintthrows ajakarta.jms.MessageFormatException.voidif a property is set as along, it can also be read as along.voidif a property is set as along, to get is as ashortthrows ajakarta.jms.MessageFormatException.voidif a property is set as along, it can also be read as aString.voidif a property is set as ashort, to get is as abooleanthrows ajakarta.jms.MessageFormatException.voidif a property is set as ashort, to get is as abytethrows ajakarta.jms.MessageFormatException.voidif a property is set as ashort, to get is as adoublethrows ajakarta.jms.MessageFormatException.voidif a property is set as ashort, to get is as afloatthrows ajakarta.jms.MessageFormatException.voidif a property is set as ashort, it can also be read as anint.voidif a property is set as ashort, it can also be read as along.voidif a property is set as ashort, it can also be read as ashort.voidif a property is set as ashort, it can also be read as aString.voidif a property is set as ajava.lang.String, it can also be read as abooleanif theStringis a correct representation of aboolean(e.g.voidif a property is set as ajava.lang.String, to get it as abooleanreturnstrueif the property is not null and is equal, ignoring case, to the string "true" (.eg.voidif a property is set as ajava.lang.String, it can also be read as abyteif theStringis a correct representation of abyte(e.g.voidif a property is set as ajava.lang.String, to get it as abytethrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for abyte(e.g.voidif a property is set as ajava.lang.String, it can also be read as adoubleas long as theStringis a correct representation of adouble(e.g.voidif a property is set as ajava.lang.String, to get it as adoublethrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for adouble(e.g.voidif a property is set as ajava.lang.String, it can also be read as afloatas long as theStringis a correct representation of afloat(e.g.voidif a property is set as ajava.lang.String, to get it as afloatthrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for afloat(e.g.voidif a property is set as ajava.lang.String, it can also be read as aintas long as theStringis a correct representation of aint(e.g.voidif a property is set as ajava.lang.String, to get it as aintthrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for aint(e.g.voidif a property is set as ajava.lang.String, it can also be read as alongas long as theStringis a correct representation of along(e.g.voidif a property is set as ajava.lang.String, to get it as alongthrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for along(e.g.voidif a property is set as ajava.lang.String, it can also be read as ashortas long as theStringis a correct representation of ashort(e.g.voidif a property is set as ajava.lang.String, to get it as ashortthrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for ashort(e.g.voidif a property is set as ajava.lang.String, it can also be read as ajava.lang.String.Methods inherited from class org.objectweb.jtests.jms.framework.PTPTestCase
setUp, tearDownMethods inherited from class org.objectweb.jtests.jms.framework.JMSTestCase
fail, getProviderPropertiesMethods 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
-
Constructor Details
-
MessagePropertyConversionTest
-
-
Method Details
-
testString2String
public void testString2String()if a property is set as ajava.lang.String, it can also be read as ajava.lang.String. -
testString2Double_2
public void testString2Double_2()if a property is set as ajava.lang.String, to get it as adoublethrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for adouble(e.g."not a number"). -
testString2Double_1
public void testString2Double_1()if a property is set as ajava.lang.String, it can also be read as adoubleas long as theStringis a correct representation of adouble(e.g."3.14159"). -
testString2Float_2
public void testString2Float_2()if a property is set as ajava.lang.String, to get it as afloatthrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for afloat(e.g."not_a_number"). -
testString2Float_1
public void testString2Float_1()if a property is set as ajava.lang.String, it can also be read as afloatas long as theStringis a correct representation of afloat(e.g."3.14159"). -
testString2Long_2
public void testString2Long_2()if a property is set as ajava.lang.String, to get it as alongthrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for along(e.g."3.14159"). -
testString2Long_1
public void testString2Long_1()if a property is set as ajava.lang.String, it can also be read as alongas long as theStringis a correct representation of along(e.g."0"). -
testString2Int_2
public void testString2Int_2()if a property is set as ajava.lang.String, to get it as aintthrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for aint(e.g."3.14159"). -
testString2Int_1
public void testString2Int_1()if a property is set as ajava.lang.String, it can also be read as aintas long as theStringis a correct representation of aint(e.g."0"). -
testString2Short_2
public void testString2Short_2()if a property is set as ajava.lang.String, to get it as ashortthrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for ashort(e.g."3.14159"). -
testString2Short_1
public void testString2Short_1()if a property is set as ajava.lang.String, it can also be read as ashortas long as theStringis a correct representation of ashort(e.g."0"). -
testString2Byte_2
public void testString2Byte_2()if a property is set as ajava.lang.String, to get it as abytethrows ajava.lang.NuberFormatExceptionif theStringis not a correct representation for abyte(e.g."3.14159"). -
testString2Byte_1
public void testString2Byte_1()if a property is set as ajava.lang.String, it can also be read as abyteif theStringis a correct representation of abyte(e.g."0"). -
testString2Boolean_2
public void testString2Boolean_2()if a property is set as ajava.lang.String, to get it as abooleanreturnstrueif the property is not null and is equal, ignoring case, to the string "true" (.eg. "True" is ok), else it returnsfalse(e.g. "test") -
testString2Boolean_1
public void testString2Boolean_1()if a property is set as ajava.lang.String, it can also be read as abooleanif theStringis a correct representation of aboolean(e.g."true"). -
testDouble2String
public void testDouble2String()if a property is set as adouble, it can also be read as ajava.lang.String. -
testDouble2Double
public void testDouble2Double()if a property is set as adouble, it can also be read as adouble. -
testDouble2Float
public void testDouble2Float()if a property is set as adouble, to get is as afloatthrows ajakarta.jms.MessageFormatException. -
testDouble2Long
public void testDouble2Long()if a property is set as adouble, to get is as alongthrows ajakarta.jms.MessageFormatException. -
testDouble2Int
public void testDouble2Int()if a property is set as adouble, to get is as anintthrows ajakarta.jms.MessageFormatException. -
testDouble2Short
public void testDouble2Short()if a property is set as adouble, to get is as ashortthrows ajakarta.jms.MessageFormatException. -
testDouble2Byte
public void testDouble2Byte()if a property is set as adouble, to get is as abytethrows ajakarta.jms.MessageFormatException. -
testDouble2Boolean
public void testDouble2Boolean()if a property is set as adouble, to get is as abooleanthrows ajakarta.jms.MessageFormatException. -
testFloat2String
public void testFloat2String()if a property is set as afloat, it can also be read as aString. -
testFloat2Double
public void testFloat2Double()if a property is set as afloat, it can also be read as adouble. -
testFloat2Float
public void testFloat2Float()if a property is set as afloat, it can also be read as afloat. -
testFloat2Long
public void testFloat2Long()if a property is set as afloat, to get is as alongthrows ajakarta.jms.MessageFormatException. -
testFloat2Int
public void testFloat2Int()if a property is set as afloat, to get is as aintthrows ajakarta.jms.MessageFormatException. -
testFloat2Short
public void testFloat2Short()if a property is set as afloat, to get is as ashortthrows ajakarta.jms.MessageFormatException. -
testFloat2Byte
public void testFloat2Byte()if a property is set as afloat, to get is as abytethrows ajakarta.jms.MessageFormatException. -
testFloat2Boolean
public void testFloat2Boolean()if a property is set as afloat, to get is as abooleanthrows ajakarta.jms.MessageFormatException. -
testLong2String
public void testLong2String()if a property is set as along, it can also be read as aString. -
testLong2Double
public void testLong2Double()if a property is set as along, to get is as adoublethrows ajakarta.jms.MessageFormatException. -
testLong2Float
public void testLong2Float()if a property is set as along, to get is as afloatthrows ajakarta.jms.MessageFormatException. -
testLong2Long
public void testLong2Long()if a property is set as along, it can also be read as along. -
testLong2Int
public void testLong2Int()if a property is set as along, to get is as anintthrows ajakarta.jms.MessageFormatException. -
testLong2Short
public void testLong2Short()if a property is set as along, to get is as ashortthrows ajakarta.jms.MessageFormatException. -
testLong2Byte
public void testLong2Byte()if a property is set as along, to get is as abytethrows ajakarta.jms.MessageFormatException. -
testLong2Boolean
public void testLong2Boolean()if a property is set as along, to get is as abooleanthrows ajakarta.jms.MessageFormatException. -
testInt2String
public void testInt2String()if a property is set as anint, it can also be read as aString. -
testInt2Double
public void testInt2Double()if a property is set as aint, to get is as adoublethrows ajakarta.jms.MessageFormatException. -
testInt2Float
public void testInt2Float()if a property is set as aint, to get is as afloatthrows ajakarta.jms.MessageFormatException. -
testInt2Long
public void testInt2Long()if a property is set as anint, it can also be read as along. -
testInt2Int
public void testInt2Int()if a property is set as anint, it can also be read as anint. -
testInt2Short
public void testInt2Short()if a property is set as aint, to get is as ashortthrows ajakarta.jms.MessageFormatException. -
testInt2Byte
public void testInt2Byte()if a property is set as aint, to get is as abytethrows ajakarta.jms.MessageFormatException. -
testInt2Boolean
public void testInt2Boolean()if a property is set as aint, to get is as abooleanthrows ajakarta.jms.MessageFormatException. -
testShort2String
public void testShort2String()if a property is set as ashort, it can also be read as aString. -
testShort2Double
public void testShort2Double()if a property is set as ashort, to get is as adoublethrows ajakarta.jms.MessageFormatException. -
testShort2Float
public void testShort2Float()if a property is set as ashort, to get is as afloatthrows ajakarta.jms.MessageFormatException. -
testShort2Long
public void testShort2Long()if a property is set as ashort, it can also be read as along. -
testShort2Int
public void testShort2Int()if a property is set as ashort, it can also be read as anint. -
testShort2Short
public void testShort2Short()if a property is set as ashort, it can also be read as ashort. -
testShort2Byte
public void testShort2Byte()if a property is set as ashort, to get is as abytethrows ajakarta.jms.MessageFormatException. -
testShort2Boolean
public void testShort2Boolean()if a property is set as ashort, to get is as abooleanthrows ajakarta.jms.MessageFormatException. -
testByte2String
public void testByte2String()if a property is set as abyte, it can also be read as aString. -
testByte2Double
public void testByte2Double()if a property is set as abyte, to get is as adoublethrows ajakarta.jms.MessageFormatException. -
testByte2Float
public void testByte2Float()if a property is set as abyte, to get is as afloatthrows ajakarta.jms.MessageFormatException. -
testByte2Long
public void testByte2Long()if a property is set as abyte, it can also be read as along. -
testByte2Int
public void testByte2Int()if a property is set as abyte, it can also be read as anint. -
testByte2Short
public void testByte2Short()if a property is set as abyte, it can also be read as ashort. -
testByte2Byte
public void testByte2Byte()if a property is set as abyte, it can also be read as abyte. -
testByte2Boolean
public void testByte2Boolean()if a property is set as abyte, to get is as abooleanthrows ajakarta.jms.MessageFormatException. -
testBoolean2String
public void testBoolean2String()if a property is set as aboolean, it can also be read as aString. -
testBoolean2Double
public void testBoolean2Double()if a property is set as aboolean, to get is as adoublethrows ajakarta.jms.MessageFormatException. -
testBoolean2Float
public void testBoolean2Float()if a property is set as aboolean, to get is as afloatthrows ajakarta.jms.MessageFormatException. -
testBoolean2Long
public void testBoolean2Long()if a property is set as aboolean, to get is as alongthrows ajakarta.jms.MessageFormatException. -
testBoolean2Int
public void testBoolean2Int()if a property is set as aboolean, to get is as aintthrows ajakarta.jms.MessageFormatException. -
testBoolean2Short
public void testBoolean2Short()if a property is set as aboolean, to get is as ashortthrows ajakarta.jms.MessageFormatException. -
testBoolean2Byte
public void testBoolean2Byte()if a property is set as aboolean, to get is as abytethrows ajakarta.jms.MessageFormatException. -
testBoolean2Boolean
public void testBoolean2Boolean()if a property is set as aboolean, it can also be read as aboolean. -
suite
public static junit.framework.Test suite()Method to use this class in a Test suite
-