1.

How to install JUnit?

Answer»

Follow the steps below −

  • Download the latest version of JUnit, referred to below as junit.zip.

  • Unzip the junit.zip distribution file to a directory referred to as %JUNIT_HOME%.

  • Add JUnit to the classpath −

set CLASSPATH=%CLASSPATH%;%JUNIT_HOME%\junit.jar
  • Test the installation by running the sample tests distributed with JUnit (sample tests are located in the installation directory directly, not the junit.jar file). Then simply type −

java org.junit.runner.JUnitCore org.junit.tests.AllTests
  • All the tests should pass with an "OK" message. If the tests don't pass, verify that junit.jar is in the CLASSPATH.



Discussion

No Comment Found