Running junit

  

on the command line is usually done in eclipse and ant. Today, you need to run a small test. It is not necessary to write an ant separately. Check the command in the command line.

The following in junit3

# To run your TestCase suite:

java -cp whatever:/path/to/junit.jar junit.textui.TestRunner MyTestClass

# To run your TestCase suite in a Gui:java -cp whatever:/path/to/junit.jar junit.swingui.TestRunner MyTestClass

# To run the TestRunner Gui and select your suite or Test methods# from within the Gui:java -cp whatever:/path/to/junit.jar junit.swingui.TestRunner

junit4 is a bit different:

java org.junit. runner.JUnitCore TestClass1 [...other test classes...]

Copyright © Windows knowledge All Rights Reserved