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.
This package is known to build and work properly using an LFS-7.5 platform.
Download (HTTP): https://launchpad.net/debian/+archive/primary/+files/junit4_4.11.orig.tar.gz
Download MD5 sum: b4d163832583dcec8bedb5427c795cc4
Download size: 1.7 MB
Estimated disk space required: 34 MB
Estimated build time: 0.1 SBU
Required file: http://anduin.linuxfromscratch.org/sources/other/junit-4.11.jar
Required file: http://hamcrest.googlecode.com/files/hamcrest-1.3.tgz
apache-ant-1.9.3 and UnZip-6.0
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/junit
To do a full build of JUnit from source, apache-ant-1.9.3 is required. However JUnit is useful in building Apache Ant. Copy the JUnit-4.11 jar file to get started. Then come back to build from source, if desired.
Install the JUnit jar file by
running the following commands as the root
user:
install -v -m755 -d /usr/share/java && cp -v junit-4.11.jar /usr/share/java
At this point, make sure Apache-Ant is installed and then continue with the source build and installation. From the directory created when extracting the JUnit sources, place the required hamcrest jar files where needed and build the package:
tar -xf ../hamcrest-1.3.tgz && cp -v hamcrest-1.3/hamcrest-core-1.3{,-sources}.jar lib/ && ant dist
Testing is automatically done as a part of the build step.
Install the files in the final location as the root
user:
install -v -m755 -d /usr/share/{doc,java}/junit-4.11 && chown -R root:root . && cp -v -R junit*/javadoc/* /usr/share/doc/junit-4.11 && cp -v junit*/junit*.jar /usr/share/java/junit-4.11 && cp -v hamcrest-1.3/hamcrest-core*.jar /usr/share/java/junit-4.11
Finally, update the CLASSPATH
variable:
export CLASSPATH=$CLASSPATH:/usr/share/java/junit-4.11
Last updated on 2014-02-27 13:22:01 -0800