Creating a JUnit Test for a Generic Java Project
A JUnit test application consists of the following components:
- One or more test cases, which invoke the methods that are to be tested,
and make assertions about the expected results. Wizard-generated test case
classes have 'Test' in their names.
- Test fixtures, which provide the state in which the tests are run. Any class
can serve as a test fixture, but JDeveloper provides wizards to help you create
specialized test fixture classes. Wizard-generated test fixture classes have
'Fixture' in their names.
- A test suite, which invokes the test cases. Wizard-generated test suite
classes have 'AllTests' in their names.
- A runner, which invokes the test suite and collates and displays the results
of the tests.
To create a JUnit Test for a Generic Java Project:
- Create a new empty project
for your unit test.
- Create your custom or JDBC
test fixture classes.
- Create your test case classes.
- Create your test suite class.
- Build the project:
- In the Navigator, right-click the project.
- Choose Build Project.
Related topics
Unit Testing with JUnit
Creating a JUnit Test for a Business Components Project
Running a JUnit Test