Jetif v1.8.0

jetif.ext.proxy
Class EJBProxy

java.lang.Object
  extended byjetif.ext.proxy.EJBProxy
All Implemented Interfaces:
LwProxy

public class EJBProxy
extends Object
implements LwProxy

This class EJBProxy represents the EJB proxy to connect the proxy agent bean.
Following steps are required to use the EJB proxy.

  1. Use a J2EE IDE such as WSAD or deploy tool to create an EAR project, import the jetif-proxy-ejb.jar as a EJB jar, and import the jetif.jar as utility jar.
  2. Configure the JNDI name of the proxy agent EJB, there is no JNDI name specified in the jetif-proxy-ejb.jar because because I don't know which J2EE server you are using.
    Please note that this EJBProxy will use "jetif/proxy/EJBProxyAgent" as the default JNDI name to locate the EJB proxy agent. You can configure a different JNDI name by setting the property "jetif.proxy.agent.uri" in jetif properties or suite properties. For example:
     jetif.proxy.agent.uri = custom/proxy/agent/JNDI/name
     
  3. Deploy the EAR to J2EE application server, and start the deployed application.
  4. Configure environment properties in jetif properties. For example, the following properties are necessary for WAS5.0:
     java.naming.factory.initial = com.ibm.websphere.naming.WsnInitialContextFactory
     java.naming.provider.url = iiop://localhost:2809/
     
  5. Configure the necessary classpath for test suite/case and related classes in jetif properties. For example:
     jetif.class.path = /home/wtl/jetif/samples/jetif-sample.jar
     
    Please note the jetif.jar is included in the EAR (step 1), so it's unnecessary to include the jetif.jar in the jetif.class.path.
  6. Configure this class as the proxy class in suite spec. For example:
     <suite name="remote" class="sample.FirstSuite" proxyclass="jetif.ext.proxy.EJBProxy">
     ... 
  7. Start the testing from command line:
     java -cp $CLASSPATH jetif.ui.Console your.suite.spec 
     
    Please make sure the EJB client jar file generated by deploy tool has been included in the $CLASSPATH. The testing will be ran on the application server.

Author:
Vicky Wang

Field Summary
static String DEFAULT_JNDI_NAME
          The default JNDI name of the proxy EJB.
 
Constructor Summary
EJBProxy()
           
 
Method Summary
 void close()
          Close this proxy
 void open(Properties props, String data)
          Open this proxy for testing.
 String runCase(String input)
          Run a test case.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_JNDI_NAME

public static final String DEFAULT_JNDI_NAME
The default JNDI name of the proxy EJB. It's "jetif/proxy/EJBProxyAgent".

See Also:
Constant Field Values
Constructor Detail

EJBProxy

public EJBProxy()
Method Detail

open

public void open(Properties props,
                 String data)
          throws FrameworkException
Open this proxy for testing.

Specified by:
open in interface LwProxy
Parameters:
props - The properties object of this suite.
data - The data should be transmitted to remote proxy agent, encoded in Base64 encoding.
Throws:
FrameworkException - if errors occurs try to bind proxy agent.

runCase

public String runCase(String input)
               throws FrameworkException
Run a test case.

Specified by:
runCase in interface LwProxy
Parameters:
input - the data should be transmitted to remote proxy agent, encoded in Base64 encoding.
Returns:
the result from remote proxy agent, encoded in Base64 encoding.
Throws:
FrameworkException - if error occurs during testing.

close

public void close()
           throws FrameworkException
Close this proxy

Specified by:
close in interface LwProxy
Throws:
FrameworkException

Jetif v1.8.0

Copyright © 2004,2005 Vicky Wang - All Rights Reserved.