Testing the Rental Swing Client


After the rental-gui target is built, change to the bookcode-home directory and run the batch file runRentalGui.bat. This command file starts the Swing client. Figure 9-1 shows the rental Swing client when it first appears. Note that very little of the application is enabled because it is disconnected from its data.

click to expand
Figure 9-1: The Swing client on startup

For the first step, go to the Connect menu and select Connect to datastore. Since this is your first time using this application, no test data has been created. Go to the File menu and select Populate database. After the database is populated you now have the option to clear the database from the File menu. This behavior corresponds to use cases 1 and 2.

At this point, you still do not see any rentals, because the application starts without a view on the data. Go to the View menu item and select Available. Figure 9-2 shows the rental Swing client after the available rentals are viewed. At this point you can see that there are three lighthouses for a 16-week season. The middle of this season is arbitrarily designated the high season when prices are higher. If you click the highlighted headings, you will see pictures of the various lighthouses. This behavior corresponds to use cases 5 and 11.

click to expand
Figure 9-2: The Swing client viewing available rentals

The drop-down list for customer names has no entries. Enter the name "Jim" in the list box, and press Enter. Notice that the name changes to uppercase. As far as the program is concerned, you are now the customer named Jim. Press the X button and you become unidentified again. Jim's persistent customer record is saved only if you press the Confirm button at some point before exiting the program. The list box behavior corresponds to use cases 3 and 4.

After entering or selecting a customer name, you can make reservations by checking the corresponding check box. For example, check the first 2 weeks for the first unit, and press the Confirm button. The system accepts the reservations and displays all of the customer's reservations. This behavior corresponds to use cases 6 and 7. Now uncheck the last reservation to cancel the reservation, and press the Confirm button again. The system shows a shorter list of reservations. This behavior corresponds to use case 8.

There are now just two use cases left to test. On the View menu, select Both. Uncheck one of the reserved rentals to cancel it, and check an available rental to reserve it. Press the Confirm button. When successful, this shows the customer's modified list of confirmed reservations. This behavior corresponds to use case 9.




Using and Understanding Java Data Objects
Using and Understanding Java Data Objects
ISBN: 1590590430
EAN: 2147483647
Year: 2005
Pages: 156
Authors: David Ezzio

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net