Working with test client applications 8 Choose Next. (Web site translator)
Working with test client applications 8 Choose Next. 9 Check the Create a Runtime Configuration check box and supply the information needed to create a runtime configuration. JBuilder suggests a default name you can change to any name of your choosing. 10 Choose Finish. The EJB Test Client wizard generates a test client that creates a reference to the enterprise bean. If the Generate Logging Messages option is selected, for each method declared in the bean s remote interface, the wizard also declares and implements a method that calls the remote method. Each of these methods reports its success in invoking the remote method and how long the remote method took to execute. There are multiple ways to use the generated test client application. If you added a main() function to the test client application, you can write the code that invokes the calls to the enterprise bean s methods in 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 has declared a client object in the main() function, you can use that client object to simply call the methods declared in the test client application that call the bean s remote methods. If you selected the Generate Method For Testing Remote Interface Calls With Default Arguments option, your client class now contains a testRemoteCallsWithDefaultArguments() method. If you selected the logging option, this method calls the remote method wrappers that were generated from the logging option. To test each remote method, you can then simply call testRemoteCallsWithDefaultArguments() after you create a remote interface reference in either the client class create() method or in one of its findByXXX() methods. If you did not select the logging option, the testRemoteCallsWithDefaultArguments() method requires a remote interface passed as a parameter. You must then create a remote interface reference in either the home reference s create() method or in one of its findByXXX() methods. Then add the code to the client class to call the testRemoteCallsWithDefaultArguments() method, passing it the remote reference as an argument. If you prefer to write the logic that calls each of the business methods from another class, you can choose to create and use an instance of the test client application. See Using the test client application on page 95. Compile your test client application by right-clicking the test client node in the project pane and choosing Make. 94 Developing Applications with Enterprise JavaBeans
Hosting services offered by our company comes with free domain name if you pay at yearly basis. Find out more at New Orleans Web Hosting services.