Creating a JUnit Test for a Business Components Project

A JUnit business components test application is similar to a generic Java test, and consists of the following components:

To create a JUnit test for a business components project:

  1. Create a business component project.
  2. Create your test classes:
    1. In the Navigator, select the project.
    2. Choose File | New to open the New Gallery.
    3. In the Categories tree, expand General and select Unit Tests (JUnit).
    4. In the Items list, select one of the business components wizards:
      • Select Business Components Test Suite to create an entire test consisting of test suite, test fixture and test case classes.
      • Select Business Components Test Fixture to create only test suite and test fixture classes. If you use this wizard you must create your own test case classes.
    5. Click OK to invoke the wizard, and follow its instructions to create the test classes. For more information at any time, press F1 or click Help from within the dialog.
  3. Edit the testAccess() methods of the test case classes to perform the desired tests.
  4. If desired, create additional test cases, and add them to the test suite.
  5. Build the project:
    1. In the Navigator, right-click the project.
    2. Choose Build Project.

Unit Testing with JUnit
Creating a JUnit Test for a Generic Java Project
Creating a JUnit Test Case
Running a JUnit Test