Introduction to JUnit

The JUnit package contains a simple, open source framework to write and run repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. JUnit features include assertions for testing expected results, test fixtures for sharing common test data, and test runners for running tests.

Package Information

JUnit Dependencies



User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/junit

Installation of JUnit

Install JUnit by running the following commands as the root user:

install -v -m755 -d /usr/share/{,doc/}junit-4.3.1 &&
chown -R root:root . &&
cp -v -R junit* org  /usr/share/junit-4.3.1 &&
cp -v -R *.html *doc /usr/share/doc/junit-4.3.1

Add the junit-4.3.1.jar and /usr/share/junit-4.3.1 directory to your system CLASSPATH environment variable:


To run the JUnit regression self-tests, you'll need to have JDK-6 Update 5 or Jikes installed and the CLASSPATH environment variable updated. Then, as an unprivileged user, issue:

java org.junit.runner.JUnitCore org.junit.tests.AllTests


Installed Programs: None
Installed Library: junit-4.3.1.jar
Installed Directories: /usr/share/junit-4.3.1, /usr/share/doc/junit-4.3.1

Short Descriptions


contains java classes to support the xUnit framework testing architecture.

Last updated on 2007-07-16 08:54:37 -0500