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-8.3 platform.
Download (HTTP): https://github.com/junit-team/junit4/archive/r4.12/junit4-r4.12.tar.gz
Download MD5 sum: 22578a9b35cbb71d556a2e625c576c81
Download size: 433 KB
Estimated disk space required: 27 MB
Estimated build time: 0.2 SBU (with documentation, using 4 cores; add maven “artifacts” download time)
Apache-Maven-3.5.4 and UnZip-6.0
User Notes: http://wiki.linuxfromscratch.org/blfs/wiki/junit
First remove a test, which fails with Java 10.
sed -e '/MethodsSorted/i @Ignore' \ -i src/test/java/org/junit/runners/model/TestClassTest.java
Replace deprecated SecurityManager code:
patch -Np1 -i ../junit4-r4.12-simplify_NoExitSecurityManager-1.patch
Install Junit by running the following commands:
mvn -DjdkVersion=1.6 install
The tests are run as part of the command above.
If you wish to generate the documentation, issue:
mvn site
Install the files in the final location as the root
user:
install -v -m755 -d /usr/share/java/junit-4.12 && cp -v target/junit-4.12.jar /usr/share/java/junit-4.12 && cp -v lib/hamcrest-core-1.3.jar /usr/share/java/junit-4.12
if the documentation was built, install it as the root
user:
install -v -m755 -d /usr/share/doc/junit-4.12 && cp -v -R target/site/* /usr/share/doc/junit-4.12
If you have followed the instructions in Configuring the JAVA
environment, there is nothing more to do: the CLASSPATH
variable would be automatically updated.
Last updated on 2018-08-27 21:20:16 -0700