Class MessageTypeTest
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.MessageTypeTest
- All Implemented Interfaces:
junit.framework.Test
Test the different types of messages provided by JMS.
JMS provides 6 types of messages which differs by the type of their body:
For each of this type of message, we test that a message can be sent and received with an empty body or not.
JMS provides 6 types of messages which differs by the type of their body:
Messagewhich doesn't have a bodyTextMessagewith aStringas bodyObjectMessagewith anyObjectas bodyBytesMessagewith a body made ofbytesMapMessagewith name-value pairs of Java primitives in its bodyStreamMessagewith a stream of Java primitives as body
For each of this type of message, we test that a message can be sent and received with an empty body or not.
- Version:
- $Id: MessageTypeTest.java,v 1.1 2007/03/29 04:28:37 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 suitevoidSend aBytesMessagewith an empty body.voidSend aBytesMessagewith 2 Java primitives in its body (aStringand adouble).voidTest that the if the name parameter of the set methods of aMapMessageis an empty String, the method must throw the errorjava.lang.IllegalArgumentException.voidTest that theMapMessage.getMapNames()method returns an emptyEnumerationwhen no map has been defined before.voidSend aMapMessagewith an empty body.voidSend aMapMessagewith 2 Java primitives in its body (aStringand adouble).voidTest in MapMessage the conversion betweengetObject("foo")andgetDouble("foo")(the later returning a java.lang.Double and the former a double)voidTest that the if the name parameter of the set methods of aMapMessageisnull, the method must throw the errorjava.lang.IllegalArgumentException.voidSend aObjectMessagewith an empty body.voidSend anObjectMessagewith aVector(composed of aStringand adouble) in its body.voidSend aStreamMessagewith an empty body.voidSend aStreamMessagewith 2 Java primitives in its body (aStringand adouble).voidSend aTextMessagewith an empty body.voidSend aTextMessagewith aStringin its body.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
-
MessageTypeTest
-
-
Method Details
-
testStreamMessage_2
public void testStreamMessage_2()Send aStreamMessagewith 2 Java primitives in its body (aStringand adouble).
Receive it and test that the values of the primitives of the body are correct -
testStreamMessage_1
public void testStreamMessage_1()Send aStreamMessagewith an empty body.
Receive it and test if the message is effectively an instance ofStreamMessage -
testMapMessageConversion
public void testMapMessageConversion()Test in MapMessage the conversion betweengetObject("foo")andgetDouble("foo")(the later returning a java.lang.Double and the former a double) -
testNullInSetMethodsForMapMessage
public void testNullInSetMethodsForMapMessage()Test that the if the name parameter of the set methods of aMapMessageisnull, the method must throw the errorjava.lang.IllegalArgumentException.- Since:
- JMS 1.1
-
testEmptyStringInSetMethodsForMapMessage
public void testEmptyStringInSetMethodsForMapMessage()Test that the if the name parameter of the set methods of aMapMessageis an empty String, the method must throw the errorjava.lang.IllegalArgumentException.- Since:
- JMS 1.1
-
testgetMapNames
public void testgetMapNames()Test that theMapMessage.getMapNames()method returns an emptyEnumerationwhen no map has been defined before.
Also test that the same method returns the correct names of the map. -
testMapMessage_2
public void testMapMessage_2()Send aMapMessagewith 2 Java primitives in its body (aStringand adouble).
Receive it and test that the values of the primitives of the body are correct -
testMapMessage_1
public void testMapMessage_1()Send aMapMessagewith an empty body.
Receive it and test if the message is effectively an instance ofMapMessage -
testObjectMessage_2
public void testObjectMessage_2()Send anObjectMessagewith aVector(composed of aStringand adouble) in its body.
Receive it and test that the values of the primitives of the body are correct -
testObjectMessage_1
public void testObjectMessage_1()Send aObjectMessagewith an empty body.
Receive it and test if the message is effectively an instance ofObjectMessage -
testBytesMessage_2
public void testBytesMessage_2()Send aBytesMessagewith 2 Java primitives in its body (aStringand adouble).
Receive it and test that the values of the primitives of the body are correct -
testBytesMessage_1
public void testBytesMessage_1()Send aBytesMessagewith an empty body.
Receive it and test if the message is effectively an instance ofBytesMessage -
testTextMessage_2
public void testTextMessage_2()Send aTextMessagewith aStringin its body.
Receive it and test that the receivedStringcorresponds to the sent one. -
testTextMessage_1
public void testTextMessage_1()Send aTextMessagewith an empty body.
Receive it and test if the message is effectively an instance ofTextMessage -
suite
public static junit.framework.Test suite()Method to use this class in a Test suite
-