[2876fbf] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[2876fbf] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[6dc9fd3] | 7 | <!ENTITY junit-download-http "https://launchpad.net/debian/+archive/primary/+files/junit4_&junit-version;.orig.tar.gz">
|
---|
[2876fbf] | 8 | <!ENTITY junit-download-ftp " ">
|
---|
[94c4ae3] | 9 | <!ENTITY junit-md5sum "b4d163832583dcec8bedb5427c795cc4">
|
---|
[ea8b96e] | 10 | <!ENTITY junit-size "1.7 MB">
|
---|
[94c4ae3] | 11 | <!ENTITY junit-buildsize "34 MB">
|
---|
| 12 | <!ENTITY junit-time "0.1 SBU">
|
---|
[2876fbf] | 13 | ]>
|
---|
| 14 |
|
---|
| 15 | <sect1 id="junit" xreflabel="JUnit-&junit-version;">
|
---|
| 16 | <?dbhtml filename="junit.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>JUnit-&junit-version;</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="junit">
|
---|
| 26 | <primary sortas="a-JUnit">JUnit</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to JUnit</title>
|
---|
| 31 |
|
---|
[6fe6db6] | 32 | <para>
|
---|
| 33 | The <application>JUnit</application> package contains a simple, open
|
---|
| 34 | source framework to write and run repeatable tests. It is an instance of
|
---|
| 35 | the xUnit architecture for unit testing frameworks. JUnit features include
|
---|
| 36 | assertions for testing expected results, test fixtures for sharing common
|
---|
| 37 | test data, and test runners for running tests.
|
---|
| 38 | </para>
|
---|
[2876fbf] | 39 |
|
---|
[f3429309] | 40 | &lfs78_checked;
|
---|
[480ea81] | 41 |
|
---|
[2876fbf] | 42 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 43 | <itemizedlist spacing="compact">
|
---|
| 44 | <listitem>
|
---|
| 45 | <para>Download (HTTP): <ulink url="&junit-download-http;"/></para>
|
---|
| 46 | </listitem>
|
---|
| 47 | <listitem>
|
---|
| 48 | <para>Download (FTP): <ulink url="&junit-download-ftp;"/></para>
|
---|
| 49 | </listitem>
|
---|
| 50 | <listitem>
|
---|
| 51 | <para>Download MD5 sum: &junit-md5sum;</para>
|
---|
| 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
| 54 | <para>Download size: &junit-size;</para>
|
---|
| 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
| 57 | <para>Estimated disk space required: &junit-buildsize;</para>
|
---|
| 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
| 60 | <para>Estimated build time: &junit-time;</para>
|
---|
| 61 | </listitem>
|
---|
| 62 | </itemizedlist>
|
---|
| 63 |
|
---|
[94c4ae3] | 64 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[debb88bf] | 65 | <itemizedlist spacing="compact">
|
---|
| 66 | <listitem>
|
---|
| 67 | <para>
|
---|
[f3429309] | 68 | Required file: <ulink
|
---|
[6dc9fd3] | 69 | url="http://hamcrest.googlecode.com/files/hamcrest-&hamcrest-version;.tgz">
|
---|
| 70 | http://hamcrest.googlecode.com/files/hamcrest-&hamcrest-version;.tgz </ulink>
|
---|
[debb88bf] | 71 | </para>
|
---|
| 72 | </listitem>
|
---|
| 73 | </itemizedlist>
|
---|
[f3429309] | 74 |
|
---|
[2876fbf] | 75 | <bridgehead renderas="sect3">JUnit Dependencies</bridgehead>
|
---|
| 76 |
|
---|
| 77 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[debb88bf] | 78 | <para role="required">
|
---|
[94c4ae3] | 79 | <xref linkend="apache-ant"/> and
|
---|
[debb88bf] | 80 | <xref linkend="unzip"/>
|
---|
| 81 | </para>
|
---|
[2876fbf] | 82 |
|
---|
| 83 | <para condition="html" role="usernotes">User Notes:
|
---|
| 84 | <ulink url="&blfs-wiki;/junit"/></para>
|
---|
| 85 |
|
---|
| 86 | </sect2>
|
---|
| 87 |
|
---|
| 88 | <sect2 role="installation">
|
---|
| 89 | <title>Installation of JUnit</title>
|
---|
| 90 |
|
---|
[6fe6db6] | 91 | <para>
|
---|
| 92 | The <command>javadoc</command> command coming with OpenJDK 8 has become
|
---|
| 93 | much stricter than before regarding the conformance of the Javadoc
|
---|
| 94 | comments in source code to HTML. The <application>Junit</application>
|
---|
[7a5639a] | 95 | documentation does not meet that standard, so the conformance checks
|
---|
[6fe6db6] | 96 | have to be disabled. This can be done with the following command:
|
---|
| 97 | </para>
|
---|
[2876fbf] | 98 |
|
---|
[cd1247aa] | 99 | <screen><userinput>sed -i '\@/docs/@a<arg value="-Xdoclint:none"/>' build.xml</userinput></screen>
|
---|
[94c4ae3] | 100 |
|
---|
[6fe6db6] | 101 | <para>
|
---|
| 102 | Now place the required hamcrest jar files where needed and build the
|
---|
| 103 | package:
|
---|
| 104 | </para>
|
---|
[94c4ae3] | 105 |
|
---|
[6dc9fd3] | 106 | <screen><userinput>tar -xf ../hamcrest-&hamcrest-version;.tgz &&
|
---|
| 107 | cp -v hamcrest-&hamcrest-version;/hamcrest-core-&hamcrest-version;{,-sources}.jar lib/ &&
|
---|
[6fe6db6] | 108 | ant populate-dist</userinput></screen>
|
---|
[debb88bf] | 109 |
|
---|
[6fe6db6] | 110 | <para>
|
---|
| 111 | Test the package by issuing <command>ant dist</command>. One test fails
|
---|
| 112 | for unknown reason.
|
---|
| 113 | </para>
|
---|
[94c4ae3] | 114 |
|
---|
[6fe6db6] | 115 | <para>
|
---|
| 116 | Install the files in the final location as the
|
---|
| 117 | <systemitem class="username">root</systemitem> user:
|
---|
| 118 | </para>
|
---|
[f3429309] | 119 |
|
---|
[94c4ae3] | 120 | <screen role="root"><userinput>install -v -m755 -d /usr/share/{doc,java}/junit-&junit-version; &&
|
---|
| 121 | chown -R root:root . &&
|
---|
| 122 |
|
---|
| 123 | cp -v -R junit*/javadoc/* /usr/share/doc/junit-&junit-version; &&
|
---|
| 124 | cp -v junit*/junit*.jar /usr/share/java/junit-&junit-version; &&
|
---|
[6dc9fd3] | 125 | cp -v hamcrest-&hamcrest-version;/hamcrest-core*.jar /usr/share/java/junit-&junit-version;</userinput></screen>
|
---|
[f3429309] | 126 |
|
---|
[6fe6db6] | 127 | <para>
|
---|
[58cba7f0] | 128 | If you have followed the instructions in <xref linkend="ojdk-conf"/>,
|
---|
| 129 | there is nothing more to do: the <envar>CLASSPATH</envar> variable
|
---|
| 130 | whould be automatically updated.
|
---|
[6fe6db6] | 131 | </para>
|
---|
[debb88bf] | 132 |
|
---|
[2876fbf] | 133 | </sect2>
|
---|
[94c4ae3] | 134 |
|
---|
[2876fbf] | 135 | <sect2 role="content">
|
---|
| 136 | <title>Contents</title>
|
---|
| 137 |
|
---|
| 138 | <segmentedlist>
|
---|
| 139 | <segtitle>Installed Programs</segtitle>
|
---|
[6fe6db6] | 140 | <segtitle>Installed Libraries</segtitle>
|
---|
[2876fbf] | 141 | <segtitle>Installed Directories</segtitle>
|
---|
| 142 |
|
---|
| 143 | <seglistitem>
|
---|
| 144 | <seg>None</seg>
|
---|
[94c4ae3] | 145 | <seg>hamcrest-core and junit jar files</seg>
|
---|
| 146 | <seg>/usr/share/doc/junit-&junit-version; and
|
---|
| 147 | /usr/share/java/junit-&junit-version;</seg>
|
---|
[2876fbf] | 148 | </seglistitem>
|
---|
| 149 | </segmentedlist>
|
---|
| 150 |
|
---|
| 151 | <variablelist>
|
---|
| 152 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 153 | <?dbfo list-presentation="list"?>
|
---|
| 154 | <?dbhtml list-presentation="table"?>
|
---|
| 155 |
|
---|
| 156 | <varlistentry id="junit.jar">
|
---|
[94c4ae3] | 157 | <term><filename class='libraryfile'>junit jar files</filename></term>
|
---|
[2876fbf] | 158 | <listitem>
|
---|
| 159 | <para>contains java classes to support the xUnit framework testing
|
---|
| 160 | architecture.</para>
|
---|
| 161 | <indexterm zone="junit junit.jar">
|
---|
| 162 | <primary sortas="c-junit.jar">junit-&junit-version;.jar</primary>
|
---|
| 163 | </indexterm>
|
---|
| 164 | </listitem>
|
---|
| 165 | </varlistentry>
|
---|
| 166 |
|
---|
| 167 | </variablelist>
|
---|
| 168 |
|
---|
| 169 | </sect2>
|
---|
[94c4ae3] | 170 |
|
---|
[2876fbf] | 171 | </sect1>
|
---|