An example of a very simple project with JUnit4 tests.
- Make sure you have Git and Eclipse (I suggest the Eclipse IDE for Java EE Developers version) installed on your machine.
- Clone this repository to your local machine (
git clone [email protected]:csc301-fall2014/junit4demo.git
) - Open the project in Eclipse:
- File --> Import --> Existing Project Into Workspace
- Select the root of the repository (i.e. The folder containing pom.xml) as the root directory for the project.
- Important: Make sure that the Copy project into workspace option is unchecked.
- Run the unit tests: Right-click
src/test/java/junit4demo/TestPerson.java
--> Run As --> JUnit Test