org.exolab.jmscts.test.connection
Class ClientIdentifierTest

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--org.exolab.jmscts.core.JMSTestCase
                    |
                    +--org.exolab.jmscts.core.AbstractConnectionFactoryTestCase
                          |
                          +--org.exolab.jmscts.core.AbstractConnectionTestCase
                                |
                                +--org.exolab.jmscts.test.connection.ClientIdentifierTest
All Implemented Interfaces:
ConnectionFactoryTestCase, ConnectionTestCase, JMSTest, junit.framework.Test

public class ClientIdentifierTest
extends AbstractConnectionTestCase

This class verifies that the client identifier can be set, but only on creation of a connection.

Version:
$Revision: 1.8 $
Author:
Tim Anderson
See Also:
AbstractConnectionTestCase, ConnectionTestRunner

Constructor Summary
ClientIdentifierTest(java.lang.String name)
          Create a new ClientIdentifierTest
 
Method Summary
 boolean startConnection()
          Returns true if the connection should be started prior to running the test.
static junit.framework.Test suite()
          Sets up the test suite
 void testDuplicateClientID()
          Verifies that two connections may not have the same client identifier
 void testSetAfterClose()
          Verifies that the client identifier cannot be set on a closed connection
 void testSetAfterCreateSession()
          Verifies that the client identifier cannot be set after a session has been created
 void testSetAfterListenerRegistration()
          Verifies that the client identifier cannot be set after an exception listener has been registered
 void testSetAfterStart()
          Verifies that the client identifier cannot be set after the connection has been started
 void testSetAfterStop()
          Verifies that the client identifier cannot be set after the connection has stopped
 void testSetOnCreation()
          Verifies that the client identifier can be set on a connection, just after it is created, but not subsequently.
 
Methods inherited from class org.exolab.jmscts.core.AbstractConnectionTestCase
setClientID
 
Methods inherited from class org.exolab.jmscts.core.AbstractConnectionFactoryTestCase
getConnectionFactoryTypes
 
Methods inherited from class org.exolab.jmscts.core.JMSTestCase
getContext, getRequirements, setContext, share
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
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, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.exolab.jmscts.core.ConnectionFactoryTestCase
getConnectionFactoryTypes
 
Methods inherited from interface org.exolab.jmscts.core.JMSTest
getContext, setContext, share
 
Methods inherited from interface junit.framework.Test
countTestCases, run
 

Constructor Detail

ClientIdentifierTest

public ClientIdentifierTest(java.lang.String name)
Create a new ClientIdentifierTest
Parameters:
name - the name of test case
Method Detail

suite

public static junit.framework.Test suite()
Sets up the test suite
Returns:
an instance of this class that may be run by JMSTestRunner

testSetOnCreation

public void testSetOnCreation()
                       throws java.lang.Exception
Verifies that the client identifier can be set on a connection, just after it is created, but not subsequently.
Throws:
java.lang.Exception - for any error

testDuplicateClientID

public void testDuplicateClientID()
                           throws java.lang.Exception
Verifies that two connections may not have the same client identifier
Throws:
java.lang.Exception - for any error

testSetAfterClose

public void testSetAfterClose()
                       throws java.lang.Exception
Verifies that the client identifier cannot be set on a closed connection
Throws:
java.lang.Exception - for any error

testSetAfterListenerRegistration

public void testSetAfterListenerRegistration()
                                      throws java.lang.Exception
Verifies that the client identifier cannot be set after an exception listener has been registered
Throws:
java.lang.Exception - for any error

testSetAfterStart

public void testSetAfterStart()
                       throws java.lang.Exception
Verifies that the client identifier cannot be set after the connection has been started
Throws:
java.lang.Exception - for any error

testSetAfterStop

public void testSetAfterStop()
                      throws java.lang.Exception
Verifies that the client identifier cannot be set after the connection has stopped
Throws:
java.lang.Exception - for any error

testSetAfterCreateSession

public void testSetAfterCreateSession()
                               throws java.lang.Exception
Verifies that the client identifier cannot be set after a session has been created
Throws:
java.lang.Exception - for any error

startConnection

public boolean startConnection()
Returns true if the connection should be started prior to running the test. This implementation returns false, as it would affect the behaviour of testSetOnCreation()
Overrides:
startConnection in class AbstractConnectionTestCase
Returns:
false


Copyright © 2001-2004 JMS CTS Team. All Rights Reserved.