This is a feature of JBuilder Enterprise.
The EJB Test Client wizard creates a test client class you can use to test a new enterprise bean.
To display the EJB Test Client wizard, choose File|New, click the Enterprise tab, and double-click the EJB Test Client wizard icon.
Specify which EJB you want to test.
Select the enterprise bean from the drop-down list. Before you use the list, however, select either the From Project or From JAR Or Directory options to determine what appears in this drop-down list. If you select From Project, the list displays all EJBs in the current project. If you select From JAR Or Directory, you must navigate to the JAR or directory where the bean exists, then you can select the bean from this drop-down list.
If you EJB is in your current project, select this option and use the EJB Name drop-down list to select the bean. From the drop-down list, select the enterprise bean you want to create a test client for. The list displays all enterprise beans in the current project.
Select From JAR Or Directory if your bean is not in the current project, but exists elsewhere in a JAR file or if it's not in a JAR, but just in another directory. Use the ... button to navigate to where the JAR or the bean is located and select the JAR or directory, then use the drop-down list to select the bean. This option is not available for EJBs targeting WebSphere 3.5.
From the drop-down list, select the package you want the test client to be in or type in the name of the package you want to use. The drop-down list displays all currently opened projects.
Enter a name for your new EJB test client. JBuilder suggests a default name based on the name of the enterprise bean you are building the test client for. You can accept this name or enter another.
If you want the test client based on a class, specify the base class name by typing it in or use the class tool to navigate to where the base class resides and select it.
Adds a testRemoteCallsWithDefaultArguments()
method that tests the remote interface calls with default argument values. See "Testing an enterprise bean" for more information about calling testRemoteCallsWithDeaultArguments()
to test your bean's remote methods.
If this option is checked, the wizard generates code that declares and implements a method in the test client for each method in the home and remote interface. Each of these implemented methods calls a corresponding method in the home or remote interface. Each of these implemented methods reports its success in invoking the home or remote method and how long the method took to execute.
Check this option to add a main()
function to the test client. You can then call the bean's methods from the main()
function. You do this by first calling either a create or find method, and, if a remote reference is returned, by using that remote reference to call the bean's business methods. Or, because the wizard declares a client
object in the main()
function, you can use that client
object to call the methods declared in the test client that call the bean's remote methods.
If checked, this option adds JavaDoc header comments such as Title and Author to the top of the EJB test client.