运行多个类
java -cp [你的测试jar和junit.jar] org.junit.runner.JUnitCore [你的测试类,可多个]
例:java -cp test.jar;junit-4.1.1.jar org.junit.runner.JUnitCore test.Simple1 test.Simple2 test.Simple3
运行单个类
java -cp [你的测试jar和junit.jar] junit.textui.TestRunner -c [你的测试类,可不带-c参数]
例:java -cp test.jar;junit-4.1.1.jar junit.textui.TestRunner -c test.Simple1
或:java -cp test.jar;junit-4.1.1.jar junit.textui.TestRunner test.Simple1
运行单个测试方法
java -cp [你的测试jar和junit.jar] junit.textui.TestRunner -m [你的测试方法]
例:java -cp test.jar;junit-4.1.1.jar junit.textui.TestRunner -m test.Simple1.testMethod