Class SessionTest

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

public class SessionTest extends PTPTestCase
Test sessions
See JMS specifications, sec. 4.4 Session
Version:
$Id: SessionTest.java,v 1.2 2007/06/19 23:32:35 csuconic 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
    Test that invoking the acknowledge() method of a received message from a closed session must throw an IllegalStateException.
    void
    Test that closing a closed session does not throw an exception.
    void
    Test that an attempt to call the commit() method on a non transacted Session throws a jakarta.jms.IllegalStateException.
    void
    Test that a call to the rollback() method on a transacted Session rollbacks all the messages sent in the transaction.
    void
    Test that the getTransacted() method of a Session returns true if the session is transacted, false else.
    void
    Test that an attempt to call the recover() method on a transacted Session throws a jakarta.jms.IllegalStateException.
    void
    Test that an attempt to call the roolback() method on a non transacted Session throws a jakarta.jms.IllegalStateException.
    void
    Test that a call to the rollback() method on a transacted Session rollbacks all the messages sent in the transaction.
    void
    Test that an attempt to use a Session which has been closed throws a jakarta.jms.IllegalStateException.
    void
    Test that it is valid to use message objects created or received via the [closed] session with the exception of a received message acknowledge() method.

    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

    • SessionTest

      public SessionTest(String name)
  • Method Details

    • testRecoverTransactedSession

      public void testRecoverTransactedSession()
      Test that an attempt to call the recover() method on a transacted Session throws a jakarta.jms.IllegalStateException.
    • testRollbackTransactedSession

      public void testRollbackTransactedSession()
      Test that a call to the rollback() method on a transacted Session rollbacks all the messages sent in the transaction.
    • testCommitTransactedSession

      public void testCommitTransactedSession()
      Test that a call to the rollback() method on a transacted Session rollbacks all the messages sent in the transaction.
    • testRollbackNonTransactedSession

      public void testRollbackNonTransactedSession()
      Test that an attempt to call the roolback() method on a non transacted Session throws a jakarta.jms.IllegalStateException.
    • testCommitNonTransactedSession

      public void testCommitNonTransactedSession()
      Test that an attempt to call the commit() method on a non transacted Session throws a jakarta.jms.IllegalStateException.
    • testGetTransacted

      public void testGetTransacted()
      Test that the getTransacted() method of a Session returns true if the session is transacted, false else.
    • testAcknowledge

      public void testAcknowledge()
      Test that invoking the acknowledge() method of a received message from a closed session must throw an IllegalStateException.
    • testUseMessage

      public void testUseMessage()
      Test that it is valid to use message objects created or received via the [closed] session with the exception of a received message acknowledge() method.
    • testUsedClosedSession

      public void testUsedClosedSession()
      Test that an attempt to use a Session which has been closed throws a jakarta.jms.IllegalStateException.
    • testCloseClosedSession

      public void testCloseClosedSession()
      Test that closing a closed session does not throw an exception.
    • suite

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