66 WCTME: Application Development and Case Study
//basic test of customer bundle
System.out.println("\nTesting Customer Bundle: creating a customer and
calling toString");
Customer c = new Customer("1", "374906", "Jeff", "Martin", "AA 174",
Customer.PENDING,"?");
System.out.println(c);// see toString()
}
4. Perform these extra steps for this project:
a. Open the MANIFEST.MF file (as in step 20 on page 60). Scroll down to
Import Packages.
b. Expand the section Import Packages and select Add...
c. Select the package com.itso.rentals and click OK.
This step creates a dependency between the test bundle and the
customer bundle.
d. Save the file.
e. Open the ExtensionServicesBundleActivator.java file (in the default
package) and add the following code at the end of the start() method:
System.out.println("Starting Bundle Tester");
ITSORentalsTester bt = new ITSORentalsTester(context);
f. Organize Imports and Save the file.
You should now be able to test the ITSOCustomerBundle with the
ITSORentalsTesterBundle. We are only doing a simple test of one bundle
accessing another bundle. We will build on this in the next few chapters.
Tip: To help remove unresolved compiler errors, right-click in the source and
select Source → Organize Imports.
Note: The package com.itso.rentals might already have been added
automatically, or you can press the Compute button to fill in the list.
Note: It generally is not a good idea to include a large amount of code in the
start() method. If you have a lot of work to do to set up a service, then create a
separate thread to process that work.