org.jmx4odp.junitDiagnosticWorkers
Class RemoteObjectTest

java.lang.Object
  extended by TestCase
      extended by org.jmx4odp.junitDiagnosticWorkers.RemoteObjectTest
Direct Known Subclasses:
BasicEjbTest

public class RemoteObjectTest
extends TestCase

Extend or implement this test class for tests that use JNDI remote objects.

Author:
Lucas McGregor

Constructor Summary
RemoteObjectTest()
          Creates a new instance of RemoteObjectTest
 
Method Summary
 java.lang.Object getRemoteObject(javax.naming.InitialContext ic, java.lang.String jndiName)
          the same as initialContext.lookip(jndiName)
 java.lang.Object getRemoteObject(java.lang.String jndiName)
          This will use the default InitialContext to lookup the jndi name and return the remoteObject.
 java.lang.Object getRemoteObject(java.lang.String jndiName, java.util.Hashtable environment)
          This will return a remoteObject from a initialConxt.lookup().
 java.lang.Object getRemoteObject(java.lang.String jndiName, java.lang.String resourceBundle)
          This will return a remoteObject from a initialConxt.lookup().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteObjectTest

public RemoteObjectTest()
Creates a new instance of RemoteObjectTest

Method Detail

getRemoteObject

public java.lang.Object getRemoteObject(java.lang.String jndiName,
                                        java.lang.String resourceBundle)
                                 throws java.lang.Exception
This will return a remoteObject from a initialConxt.lookup(). The Hashtable from the resourceBundle will be used to initialize the InitialContext.

Parameters:
jndiName - jndi name of the remote object.
resourceBundle - property file containg the jndi properties.
Throws:
java.lang.Exception

getRemoteObject

public java.lang.Object getRemoteObject(java.lang.String jndiName,
                                        java.util.Hashtable environment)
                                 throws java.lang.Exception
This will return a remoteObject from a initialConxt.lookup(). The Hashtable will be used to initialize the InitialContext.

Parameters:
jndiName - jndi name of the remote object.
environment - InitialContext environment.
Throws:
java.lang.Exception

getRemoteObject

public java.lang.Object getRemoteObject(java.lang.String jndiName)
                                 throws java.lang.Exception
This will use the default InitialContext to lookup the jndi name and return the remoteObject.

Throws:
java.lang.Exception

getRemoteObject

public java.lang.Object getRemoteObject(javax.naming.InitialContext ic,
                                        java.lang.String jndiName)
                                 throws java.lang.Exception
the same as initialContext.lookip(jndiName)

Throws:
java.lang.Exception