I want to run my class in terminal window:
D:\workEclipse2\JUnitTest\bin>java -classpath D:\JUnit\hamcrest-core-1.3.jar;D:\
JUnit\junit-4.12.jar tax.TaxCommandLineRunner
Code of my TaxCommandLineRunner class:
package tax;
import java.util.List;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
public class TaxCommandLineRunner {
public static void main(String[] args) {
// TODO Auto-generated method stub
JUnitCore core = new JUnitCore();
Result result = core.run(AllTests.class);
if(result.wasSuccessful()){
System.out.println("All tax tests was successfull");
}else{
System.out.println("These tax tests was failure");
List<Failure> fails = result.getFailures();
fails.forEach(failure -> System.out.println(failure.getMessage()));
}
}
}
Compiled AllTests.class and TaxCommandLineRunner.class are located in D:\workEclipse2\JUnitTest\bin.
My jars file are located in D:\JUnit
I can't find what I'm doing wrong.
I input in terminal window:
D:\workEclipse2\JUnitTest\bin>java -classpath D:\JUnit\hamcrest-core-1.3.jar;D:\JUnit\junit-4.12.jar;. tax.TaxCommandLineRunner
I assume that point after semicolon means classpath of Windows, that is in first case I don't include my standart java\jre.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With