org.exolab.jmscts.core
Class TestContextHelper

java.lang.Object
  |
  +--org.exolab.jmscts.core.TestContextHelper

public final class TestContextHelper
extends java.lang.Object

Helper to create new TestContext instances using existing contexts as prototypes

Version:
$Revision: 1.6 $ $Date: 2004/01/31 13:44:24 $
Author:
Tim Anderson

Method Summary
static TestContext createConnectionContext(TestContext context)
          Creates a new connection context with the same connection type as the supplied context.
static TestContext createSendReceiveContext(TestContext context)
          Creates a new send/receive context with the same details as the supplied context.
static TestContext createSendReceiveContext(TestContext context, boolean newConnection)
          Creates a new send/receive context with the same details as the supplied context.
static TestContext createSendReceiveContext(TestContext context, boolean newConnection, MessagingBehaviour behaviour)
          Creates a new send/receive context with the same details as the supplied context, but with a different messaging behaviour.
static TestContext createSessionContext(TestContext context)
          Creates a new session context with the same session type as the supplied context.
static TestContext createSessionContext(TestContext context, AckType type)
          Creates a new session context from a connection context
static TestContext createSessionContext(TestContext context, boolean newConnection)
          Creates a new session context with the same session type as the supplied context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createConnectionContext

public static TestContext createConnectionContext(TestContext context)
                                           throws java.lang.Exception
Creates a new connection context with the same connection type as the supplied context.
Parameters:
context - the prototype context
Returns:
a new connection context
Throws:
java.lang.Exception - for any error

createSessionContext

public static TestContext createSessionContext(TestContext context)
                                        throws java.lang.Exception
Creates a new session context with the same session type as the supplied context. A new connection will be allocated.
Parameters:
context - the prototype context
Returns:
a new session context
Throws:
java.lang.Exception - for any error

createSessionContext

public static TestContext createSessionContext(TestContext context,
                                               boolean newConnection)
                                        throws java.lang.Exception
Creates a new session context with the same session type as the supplied context.
Parameters:
context - the prototype context
newConnection - if true allocate a new connection, otherwise use the existing one
Returns:
a new session context
Throws:
java.lang.Exception - for any error

createSessionContext

public static TestContext createSessionContext(TestContext context,
                                               AckType type)
                                        throws java.lang.Exception
Creates a new session context from a connection context
Parameters:
context - the connection context
type - the message acknowledgement type of the session
Returns:
a new session context
Throws:
java.lang.Exception - for any error

createSendReceiveContext

public static TestContext createSendReceiveContext(TestContext context)
                                            throws java.lang.Exception
Creates a new send/receive context with the same details as the supplied context. A new connection and session will be allocated, but the message and behaviour will refer to the original.
Parameters:
context - the prototype context
Returns:
a new send/receive context
Throws:
java.lang.Exception - for any error

createSendReceiveContext

public static TestContext createSendReceiveContext(TestContext context,
                                                   boolean newConnection)
                                            throws java.lang.Exception
Creates a new send/receive context with the same details as the supplied context. A session will be allocated, but the message type and behaviour will refer to the original.
Parameters:
context - the prototype context
newConnection - if true allocate a new connection, otherwise use the existing one
Returns:
a new send/receive context
Throws:
java.lang.Exception - for any error

createSendReceiveContext

public static TestContext createSendReceiveContext(TestContext context,
                                                   boolean newConnection,
                                                   MessagingBehaviour behaviour)
                                            throws java.lang.Exception
Creates a new send/receive context with the same details as the supplied context, but with a different messaging behaviour. A session will be allocated.
Parameters:
context - the prototype context
newConnection - if true allocate a new connection, otherwise use the existing one
behaviour - the messaging behaviour
Returns:
a new send/receive context
Throws:
java.lang.Exception - for any error


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