Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Step 8: Testing the Sample Application

Now you're ready to test the CMP 20 sample application by creating a student account and several addresses, enrolling the student in some courses, then searching for the student and listing the addresses and courses for which that student is registered.

  1. Open a browser and enter http://localhost:8000/cmp3, as shown in Figure 11-26.

    Figure 11-26Figure 11-26 Sample application start page

  2. Create a student account. Select the Create New Student link, and the form in Figure 11-27 will appear. Click Submit to create the student account.

    Figure 11-27Figure 11-27 Creating a student entity

  3. Create two addresses for the student, John Doe. Select the Create New Address link, and in the address create form, fill out the fields with jdoe as the customer ID, 100 as the address ID, 1 Market Street as the street address, San Francisco for the city name, CA for state, and 93456 as the zip code (see Figure 11-28). Click Submit to create the address.

    Figure 11-28Figure 11-28 Creating addresses

  4. Add another address with the data jdoe, 101, 99 Lake View Ave., Lake Tahoe, CA, 95324 for customer ID, address ID, address, city, state, and zip, respectively. Select the HOME link to return to the start page.

  5. Register the student, John Doe, in couple of J2EE, EJB, and Java classes. Select Create New Roster, and then enter 1001 as the roster ID, J2EE101 as the schedule ID, and jdoe as the student ID (see Figure 11-29). Register for the EJB and Java classes—enter 1002, EJB-101, jdoe and 1003, Java-200, jdoe.

    Figure 11-29Figure 11-29 Registering a student in several classes

  6. Search for student jdoe, then list all his associated addresses and the classes for which he is currently registered. Select the Search For Student link and enter jdoe. The results are shown in Figure 11-30.

    Figure 11-30Figure 11-30 Result of search

  • + Share This
  • 🔖 Save To Your Account