JUnit

Junit is one of the popular testing framework which is used to test Java scenarios are functioning properly or not. Previous to write Junit test cases, we have to download and install JDK and setup JDK installation path into environment variables. Then download latest version of eclipse IDE and install. Now, follow below steps to create Java project and configure Junit into the project classpath.

To create Java project in eclipse: File ==> New ==> Others(this step can be skipped) ==> Java Project (Look at the below screenshots if you are not aware)
Enter project name, in this example I have given as Junit and click on Next button.
Choose Libraries tab and click on Add Library button to add Junit dependencies/library.
Select Junit from list of available libraries and click on Next button.
Select the required version of Junit from dropdown list and click on Finish button to add Junit dependency to Java project. In this case, I have selected the Junit 5 version.
The below screen will show you the list of Libraries applicable on your project which is also included JUnit in it. So, adding Junit library into Java project has been completed. Clikc on Finish button to create Java project.
Congratulations, You have successfully created Java project. Now, you are ready to write Java code and implement test cases for your Java logic. Happy Coding.... :)

Comments

Popular posts from this blog

Prime, Fibonacci and Factorial number with example in java

JNDI configuration for Tomcat 9 with Oracle

SessionFactory creation failed.java.lang.NoSuchFieldError: namingStrategy