JUnit 4 Installation and Setup
Installing and testing out JUnit is quite easy and quick to do. We will take through this in an easy step by step manner.
1. Required Files
JUnit requires two jars files be downloaded from either JUnit.org or to make things easier I have downloaded and made the two jars available in one click.
- junit.jar
- hamcrest-core.jar
1.1 Download JUnit Jar File
2. Setting Up JUnit on Eclipse IDE
Now using our Package Explorer in let’s go ahead and right click and choose New Project. For the name I chose FirstJUnitProject in the Project name field and click on the Finish button at the bottom of the dialog box.
Now we can go ahead create a new library which will include the two jars files we downloaded earlier. You will need to go to the package explorer and hover you mouse over the project called “FirstJunitProject” and do the following steps.
- Right click
- Choose Build Path
- Choose Configure Build Path
- Choose Add Library
- Choose User Library
- Click button on right button called User Libraries
- Click on New
- Give your new library name of JUnit
Other Related Posts
- Introduction to JUnit 4 in Java
Get a basic understanding of JUnit and how this testing framework can help you in developing better applications. - JUnit 4 Installation and Setup
Installing and testing out JUnit is quite easy and quick to do. We will take through this in an easy step by step manner. - JUnit 4 First Sample Project
For this example I will add in all the annotations we discussed previously in the last lesson.
Leave a Reply