Class MessageTypeTest

java.lang.Object
junit.framework.Assert
junit.framework.TestCase
All Implemented Interfaces:
junit.framework.Test

public class MessageTypeTest extends PTPTestCase
Test the different types of messages provided by JMS.
JMS provides 6 types of messages which differs by the type of their body:
  1. Message which doesn't have a body
  2. TextMessage with a String as body
  3. ObjectMessage with any Object as body
  4. BytesMessage with a body made of bytes
  5. MapMessage with name-value pairs of Java primitives in its body
  6. StreamMessage with 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.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
    Send a BytesMessage with an empty body.
    void
    Send a BytesMessage with 2 Java primitives in its body (a String and a double).
    void
    Test that the if the name parameter of the set methods of a MapMessage is an empty String, the method must throw the error java.lang.IllegalArgumentException.
    void
    Test that the MapMessage.getMapNames() method returns an empty Enumeration when no map has been defined before.
    void
    Send a MapMessage with an empty body.
    void
    Send a MapMessage with 2 Java primitives in its body (a String and a double).
    void
    Test in MapMessage the conversion between getObject("foo") and getDouble("foo") (the later returning a java.lang.Double and the former a double)
    void
    Test that the if the name parameter of the set methods of a MapMessage is null, the method must throw the error java.lang.IllegalArgumentException.
    void
    Send a ObjectMessage with an empty body.
    void
    Send an ObjectMessage with a Vector (composed of a String and a double) in its body.
    void
    Send a StreamMessage with an empty body.
    void
    Send a StreamMessage with 2 Java primitives in its body (a String and a double).
    void
    Send a TextMessage with an empty body.
    void
    Send a TextMessage with a String in its body.

    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

    • MessageTypeTest

      public MessageTypeTest(String name)
  • Method Details

    • testStreamMessage_2

      public void testStreamMessage_2()
      Send a StreamMessage with 2 Java primitives in its body (a String and a double).
      Receive it and test that the values of the primitives of the body are correct
    • testStreamMessage_1

      public void testStreamMessage_1()
      Send a StreamMessage with an empty body.
      Receive it and test if the message is effectively an instance of StreamMessage
    • testMapMessageConversion

      public void testMapMessageConversion()
      Test in MapMessage the conversion between getObject("foo") and getDouble("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 a MapMessage is null, the method must throw the error java.lang.IllegalArgumentException.
      Since:
      JMS 1.1
    • testEmptyStringInSetMethodsForMapMessage

      public void testEmptyStringInSetMethodsForMapMessage()
      Test that the if the name parameter of the set methods of a MapMessage is an empty String, the method must throw the error java.lang.IllegalArgumentException.
      Since:
      JMS 1.1
    • testgetMapNames

      public void testgetMapNames()
      Test that the MapMessage.getMapNames() method returns an empty Enumeration when 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 a MapMessage with 2 Java primitives in its body (a String and a double).
      Receive it and test that the values of the primitives of the body are correct
    • testMapMessage_1

      public void testMapMessage_1()
      Send a MapMessage with an empty body.
      Receive it and test if the message is effectively an instance of MapMessage
    • testObjectMessage_2

      public void testObjectMessage_2()
      Send an ObjectMessage with a Vector (composed of a String and a double) 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 a ObjectMessage with an empty body.
      Receive it and test if the message is effectively an instance of ObjectMessage
    • testBytesMessage_2

      public void testBytesMessage_2()
      Send a BytesMessage with 2 Java primitives in its body (a String and a double).
      Receive it and test that the values of the primitives of the body are correct
    • testBytesMessage_1

      public void testBytesMessage_1()
      Send a BytesMessage with an empty body.
      Receive it and test if the message is effectively an instance of BytesMessage
    • testTextMessage_2

      public void testTextMessage_2()
      Send a TextMessage with a String in its body.
      Receive it and test that the received String corresponds to the sent one.
    • testTextMessage_1

      public void testTextMessage_1()
      Send a TextMessage with an empty body.
      Receive it and test if the message is effectively an instance of TextMessage
    • suite

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