Step 3: Running and Testing the Application

Previous topic
Previous
Next topic
Next

To test the application, you'll run it again and generate a new sample Java client.

To run the application:

You will experience a short delay as the application deploys to the embedded OC4J server. If your Log window is open (View | Log Window), you can follow along with the deployment process.

To test the application, you'll use the sample Java client again.

To create and run a sample client:

  1. In the Navigator, right click on your session bean (hrApp) and choose New Sample Java Client.
  2. In the Sample EJB Java Client Details dialog, accept the default option for Connect to OC4J Embedded in JDeveloper and click OK.
    A new file, hrAppClient2.java appears in the Navigator and opens in the Code Editor.
  3. Below the create() method, call the Dept finder method findByDname() through the session bean's method listByDname() with the following code:
    System.out.println(HrApp.listByDname( "Sales"));
  4. Run the application by selecting Run | Run hrAppClient2.java
  5. You should see the followiong output in the Log Window:
    Department Details....
    80......Sales......2500.....