• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
27 views

Problem:

I would like to run JUnit test cases from the command line. How can I do this? 

by (320 points)  
edited by

1 Answer

0 votes

Possible Cause:

It seems you are unable to compile JUnit Tests using command line.

Solution: 

Please Compile the Java Class, Test case Class and Test Runner class using javac as below.

C:\JUNIT>javac Util.java TestJunit.java TestRunner.java

Now you need to run the Test Runner, which will run the test case written in the Test Case class as below

C:\JUNIT>java TestRunner

And finally you will get desired output.

Conclusion :

Compile the Java Class, Test case Class and Test Runner class all together with space saperating them using javac.

by (36.1k points)  
edited by
...