Run Program with JUnit 3.8.1 and Hamcrest 1.3


How to run the JUnit 3.8.1 Example Program with Hamcrest 1.3? I found the example in the "hamcrest-examples" folder.



Hamcrest is a framework for writing matcher objects allowing 'match' rules to be defined declaratively. The contains a sample examples on how to use Hamcrest with JUnit 3.x and JUnit 4.x.

If you want to run the JUnit 3.8.1 example with Hamcrest 1.3, you can follow these commands:

\fyicenter>cd \local\hamcrest-1.3\hamcrest-examples\src\main\java

...\java>java -version
java version "1.7.0_45"

...\java>javac -cp .;..\..\..\..\lib\integration\junit-3.8.1.jar;

...\java>java -cp .;..\..\..\..\lib\integration\junit-3.8.1.jar;
   ..\..\..\..\hamcrest-all-1.3.jar junit.textui.TestRunner 
Time: 0.021

OK (1 test)

Back to FAQ for Hamcrest - Library of Matchers.

2016-03-25, 2543🔥, 0💬