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
These are the steps for installing JUnit in VisualAge for Java:
-
import the vaj\junit.dat file into your repository.
-
add the JUnit project to your workspace.
-
copy the contents of vaj\project_resources into your project_resources
directory. So that your project_resources look like:
project_resources
Notice: If the JUnit Icon doesn't show up in the graphical test
runner verify that the JUnit project resources are installed as described
above.
Using JUnit
Here are some hints for how to use JUnit under VisualAge for Java.
-
When using the graphical TestRunner use the junit.ui.TestRunner. Don't
use junit.ui.LoadingTestRunner since VAJ takes care of updating the TestRunner
so that you always run the latest version of your code.
-
Add the project including the test cases to be run to the TestRunner's
project path:
-
select the TestRunner
-
Selected->Properties
-
go to the Class Path page
-
add the project to the project path
Installing JUnit
as a VisualAge for Java 2.0 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:
-
copy the directory vaj\tools\test-ui into the VAJ_INSTALLDIR\tools
directory
-
add JUnit to your workspace class path
-
open the options window: Window->Options...
-
select the Resources section and edit the workspace class path
-
click Edit... and enter JUnit
-
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., JUnit;MyTests.