org.exolab.jmscts.core
Class SendReceiveTestInvoker

java.lang.Object
  |
  +--org.exolab.jmscts.core.TestInvoker
        |
        +--org.exolab.jmscts.core.MessageTestInvoker
              |
              +--org.exolab.jmscts.core.SendReceiveTestInvoker
All Implemented Interfaces:
junit.framework.Protectable

public class SendReceiveTestInvoker
extends org.exolab.jmscts.core.MessageTestInvoker

Helper class to run a test case, for the given message type, delivery mode, messaging mode, and destination type.

Prior to running, it creates a new message of the specified type, and creates any destinations required by the test.

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

Constructor Summary
SendReceiveTestInvoker(junit.framework.Test test, junit.framework.TestResult result, TestContext context, TestFilter filter, java.lang.Class messageType, MessagingBehaviour behaviour)
          Construct a new SendReceiveTestInvoker
 
Method Summary
protected  javax.jms.Message create()
          Create a message to test against, corresponding to the type passed at construction.
protected  void destroyDestinations(java.util.Map destinations)
          Destroy any destinations set up for the test case
 TestContext getContext()
          Returns the test context
protected  java.lang.Class getMessageType()
          Returns the type of the message to test against
 junit.framework.Test getTest()
          Returns the test
 void protect()
          Run the test
protected  void setUp(JMSTest test, TestContext context)
          Setup the test
protected  void tearDown(JMSTest test, TestContext context)
          Tear down the test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SendReceiveTestInvoker

public SendReceiveTestInvoker(junit.framework.Test test,
                              junit.framework.TestResult result,
                              TestContext context,
                              TestFilter filter,
                              java.lang.Class messageType,
                              MessagingBehaviour behaviour)
Construct a new SendReceiveTestInvoker
Parameters:
test - the test to run. Must be an instance of SendReceiveTestCase
result - the result of the test
context - the test context
filter - the test filter. May be null
messageType - the message type to run the test against
behaviour - the messaging behaviour
Method Detail

setUp

protected void setUp(JMSTest test,
                     TestContext context)
              throws java.lang.Exception
Setup the test
Overrides:
setUp in class org.exolab.jmscts.core.MessageTestInvoker
Parameters:
test - the test
context - the test context
Throws:
java.lang.Exception - for any error

tearDown

protected void tearDown(JMSTest test,
                        TestContext context)
                 throws java.lang.Exception
Tear down the test
Overrides:
tearDown in class org.exolab.jmscts.core.TestInvoker
Parameters:
test - the test
context - the test context
Throws:
java.lang.Exception - for any error

destroyDestinations

protected void destroyDestinations(java.util.Map destinations)
                            throws java.lang.Exception
Destroy any destinations set up for the test case
Parameters:
destinations - a map of Destination instances, keyed on name
Throws:
java.lang.Exception - for any error

create

protected javax.jms.Message create()
                            throws java.lang.Exception
Create a message to test against, corresponding to the type passed at construction. If the test has an associated MessagePopulator, this will be used to populate the message
Returns:
a new message
Throws:
java.lang.Exception - for any error

getMessageType

protected java.lang.Class getMessageType()
Returns the type of the message to test against
Returns:
the type of the message to test against

protect

public void protect()
             throws java.lang.Exception
Run the test
Specified by:
protect in interface junit.framework.Protectable
Throws:
java.lang.Exception - for any error

getTest

public junit.framework.Test getTest()
Returns the test
Returns:
the test

getContext

public TestContext getContext()
Returns the test context
Returns:
the test context


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