Creating a JUnit Custom Test Fixture

A test fixture is a set of objects, having known values, that provide data for the test cases. Any class can serve as a test fixture, but JDeveloper provides wizards to help you create custom test fixture classes and various specialized test fixture classes:

To create a JUnit custom test fixture class:

  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, double-click Custom Test Fixture.
  5. Complete the wizard to create the test fixture class. For more information at any time, press F1 or click Help from within the dialog.

    The class created by the wizard will be opened for editing.

  6. Modify the file as needed. In particular, add code that initializes test fixture objects to the setUp() method, and add code that releases any resources they acquire to the tearDown() method.


Creating a JUnit Test for a Generic Java Project
Creating a JUnit JDBC Test Fixture
Creating a JUnit Test Case
Creating a JUnit Test Suite