Using JUnit under VisualAge for Java 2.0

This page describes how to use JUnit with VisualAge for Java:

Installing JUnit in VisualAge for Java

To install JUnit into VisualAge for Java follow these steps:
  1. import the resources from the INSTALLDIR\junit.jar file into your JUnit project.
  2. import the sources for the framework from into the JUnit project.
  3. import the sample code and tests cases from INSTALLDIR\junit
Notice: The junit.swingui package requires Swing 1.1. If you don't have this version loaded into your workspaces errors will show up. You can delete this package when you don't have Swing 1.1 loaded or you can tweak the import statements so that they refer to Swing 1.0.3 (not recommended).

Using JUnit

Here are some hints for how to use JUnit under VisualAge for Java.

Installing JUnit as a VisualAge for Java tool

VisualAge for Java provides an open tools API to add custom tools to the development environment. Here are the steps for how to install JUnit as a Visual Age for Java Tool:
  1. copy the directory vaj\tools\test-ui into the VAJ_INSTALLDIR\tools directory
  2. add JUnit to your workspace class path
  3. restart VisualAge for Java
Once JUnit is installed as a tool you can select a class and run its tests with the Selected->Tools->JUnit or from the Quick Start menu item.

Notice: the projects of the test cases have to be on the workspace class path to run them. Otherwise JUnit will not find the classes. For example, to add your MyTests project to the workspace class path follow the steps above and append your project, e.g., JUnit3;MyTests.