org.exolab.jmscts.core
Class AbstractMessageTestRunner

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.extensions.TestDecorator
              |
              +--junit.extensions.TestSetup
                    |
                    +--org.exolab.jmscts.core.TestRunner
                          |
                          +--org.exolab.jmscts.core.AbstractMessageTestRunner
All Implemented Interfaces:
ConnectionFactoryTestCase, ConnectionTestCase, JMSTest, SessionTestCase, junit.framework.Test
Direct Known Subclasses:
MessageTestRunner, SendReceiveTestRunner

public abstract class AbstractMessageTestRunner
extends TestRunner
implements SessionTestCase

This class enables generic message test cases to be run for each JMS message type.

Version:
$Revision: 1.5 $ $Date: 2004/01/31 13:44:24 $
Author:
Tim Anderson
See Also:
MessageTestCase

Fields inherited from class junit.extensions.TestDecorator
fTest
 
Constructor Summary
AbstractMessageTestRunner(MessageTestCase test)
          Construct an instance with the test case to run.
 
Method Summary
 int countTestCases()
          Counts the number of test cases that will be run by this test
 AckTypes getAckTypes()
          Returns the message acknowledgement types of the sessions to test against.
 ConnectionFactoryTypes getConnectionFactoryTypes()
          Get the connection factory types to test against
protected  void runTest(junit.framework.Test test, junit.framework.TestResult result)
          Run a test against each of the message types it supports
protected abstract  void runTest(junit.framework.Test test, junit.framework.TestResult result, java.lang.Class messageType)
          Runs a test case for the given message type.
 boolean setClientID()
          Returns true if the client identifier should be set on the connection.
 boolean startConnection()
          Returns true if the connection should be started prior to running the test.
 
Methods inherited from class org.exolab.jmscts.core.TestRunner
basicRun, checkImplements, getChildContext, getContext, getFilter, getTests, setChildContext, setContext, setFilter, share, tearDown
 
Methods inherited from class junit.extensions.TestSetup
run, setUp
 
Methods inherited from class junit.extensions.TestDecorator
getTest, 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.JMSTest
getContext, setContext, share
 
Methods inherited from interface junit.framework.Test
run
 

Constructor Detail

AbstractMessageTestRunner

public AbstractMessageTestRunner(MessageTestCase test)
Construct an instance with the test case to run.
Parameters:
test - the test case to run.
Method Detail

getConnectionFactoryTypes

public ConnectionFactoryTypes getConnectionFactoryTypes()
Get the connection factory types to test against
Specified by:
getConnectionFactoryTypes in interface ConnectionFactoryTestCase
Returns:
the connection factory types to test against

startConnection

public boolean startConnection()
Returns true if the connection should be started prior to running the test.
Specified by:
startConnection in interface ConnectionTestCase
Returns:
true if the connection should be started, false if it should be stopped

setClientID

public boolean setClientID()
Returns true if the client identifier should be set on the connection. This is only applicable for TopicConnection instances, and will be ignored for QueueConnection instances.
Specified by:
setClientID in interface ConnectionTestCase
Returns:
true if an identifier should be allocated to the connection

getAckTypes

public AckTypes getAckTypes()
Returns the message acknowledgement types of the sessions to test against. A session will be constructed for each type
Specified by:
getAckTypes in interface SessionTestCase
Returns:
the acknowledgement type of the sessions to test against

countTestCases

public int countTestCases()
Counts the number of test cases that will be run by this test
Specified by:
countTestCases in interface junit.framework.Test
Overrides:
countTestCases in class junit.extensions.TestDecorator
Returns:
the number of test cases that will be run

runTest

protected void runTest(junit.framework.Test test,
                       junit.framework.TestResult result)
Run a test against each of the message types it supports
Overrides:
runTest in class TestRunner
Parameters:
test - the test case
result - the instance to collect test results in

runTest

protected abstract void runTest(junit.framework.Test test,
                                junit.framework.TestResult result,
                                java.lang.Class messageType)
Runs a test case for the given message type.
Parameters:
test - the test case
result - the instance to collect test results in
messageType - the message type


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