1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY junit-download-http "https://github.com/junit-team/junit&junit-major;/archive/r&junit-version;/junit&junit-major;-r&junit-version;.tar.gz">
|
---|
8 | <!ENTITY junit-download-ftp " ">
|
---|
9 | <!ENTITY junit-md5sum "22578a9b35cbb71d556a2e625c576c81">
|
---|
10 | <!ENTITY junit-size "433 KB">
|
---|
11 | <!ENTITY junit-buildsize "27 MB">
|
---|
12 | <!ENTITY junit-time "0.2 SBU (with documentation, using 4 cores; add maven <quote>artifacts</quote> download time)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="junit" xreflabel="JUnit-&junit-version;">
|
---|
16 | <?dbhtml filename="junit.html"?>
|
---|
17 |
|
---|
18 | <sect1info>
|
---|
19 | <date>$Date$</date>
|
---|
20 | </sect1info>
|
---|
21 |
|
---|
22 | <title>JUnit-&junit-version;</title>
|
---|
23 |
|
---|
24 | <indexterm zone="junit">
|
---|
25 | <primary sortas="a-JUnit">JUnit</primary>
|
---|
26 | </indexterm>
|
---|
27 |
|
---|
28 | <sect2 role="package">
|
---|
29 | <title>Introduction to JUnit</title>
|
---|
30 |
|
---|
31 | <para>
|
---|
32 | The <application>JUnit</application> package contains a simple, open
|
---|
33 | source framework to write and run repeatable tests. It is an instance of
|
---|
34 | the xUnit architecture for unit testing frameworks. JUnit features include
|
---|
35 | assertions for testing expected results, test fixtures for sharing common
|
---|
36 | test data, and test runners for running tests.
|
---|
37 | </para>
|
---|
38 |
|
---|
39 | &lfs83_checked;
|
---|
40 |
|
---|
41 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
42 | <itemizedlist spacing="compact">
|
---|
43 | <listitem>
|
---|
44 | <para>Download (HTTP): <ulink url="&junit-download-http;"/></para>
|
---|
45 | </listitem>
|
---|
46 | <listitem>
|
---|
47 | <para>Download (FTP): <ulink url="&junit-download-ftp;"/></para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>Download MD5 sum: &junit-md5sum;</para>
|
---|
51 | </listitem>
|
---|
52 | <listitem>
|
---|
53 | <para>Download size: &junit-size;</para>
|
---|
54 | </listitem>
|
---|
55 | <listitem>
|
---|
56 | <para>Estimated disk space required: &junit-buildsize;</para>
|
---|
57 | </listitem>
|
---|
58 | <listitem>
|
---|
59 | <para>Estimated build time: &junit-time;</para>
|
---|
60 | </listitem>
|
---|
61 | </itemizedlist>
|
---|
62 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
63 | <itemizedlist spacing="compact">
|
---|
64 | <listitem>
|
---|
65 | <para>
|
---|
66 | Required patch: <ulink
|
---|
67 | url="&patch-root;/junit&junit-major;-r&junit-version;-simplify_NoExitSecurityManager-1.patch"/>
|
---|
68 | </para>
|
---|
69 | </listitem>
|
---|
70 | </itemizedlist>
|
---|
71 |
|
---|
72 | <bridgehead renderas="sect3">JUnit Dependencies</bridgehead>
|
---|
73 |
|
---|
74 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
75 | <para role="required">
|
---|
76 | <xref linkend="maven"/> and
|
---|
77 | <xref linkend="unzip"/>
|
---|
78 | </para>
|
---|
79 |
|
---|
80 | <para condition="html" role="usernotes">User Notes:
|
---|
81 | <ulink url="&blfs-wiki;/junit"/></para>
|
---|
82 |
|
---|
83 | </sect2>
|
---|
84 |
|
---|
85 | <sect2 role="installation">
|
---|
86 | <title>Installation of JUnit</title>
|
---|
87 | <para>
|
---|
88 | First remove a test, which fails with <application>Java 10</application>.
|
---|
89 | </para>
|
---|
90 |
|
---|
91 | <screen><userinput>sed -e '/MethodsSorted/i @Ignore' \
|
---|
92 | -i src/test/java/org/junit/runners/model/TestClassTest.java</userinput></screen>
|
---|
93 |
|
---|
94 | <para>
|
---|
95 | Replace deprecated SecurityManager code:
|
---|
96 | </para>
|
---|
97 |
|
---|
98 | <screen><userinput>patch -Np1 -i ../junit4-r&junit-version;-simplify_NoExitSecurityManager-1.patch</userinput></screen>
|
---|
99 |
|
---|
100 | <para>
|
---|
101 | Install <application>Junit</application> by running the following
|
---|
102 | commands:
|
---|
103 | </para>
|
---|
104 |
|
---|
105 | <screen><userinput>mvn -DjdkVersion=1.6 install</userinput></screen>
|
---|
106 |
|
---|
107 | <para>
|
---|
108 | The tests are run as part of the command above.
|
---|
109 | </para>
|
---|
110 |
|
---|
111 | <para>
|
---|
112 | If you wish to generate the documentation, issue:
|
---|
113 | </para>
|
---|
114 |
|
---|
115 | <screen><userinput>mvn site</userinput></screen>
|
---|
116 |
|
---|
117 | <para>
|
---|
118 | Install the files in the final location as the
|
---|
119 | <systemitem class="username">root</systemitem> user:
|
---|
120 | </para>
|
---|
121 |
|
---|
122 | <screen role="root"><userinput>install -v -m755 -d /usr/share/java/junit-&junit-version; &&
|
---|
123 | cp -v target/junit-&junit-version;.jar /usr/share/java/junit-&junit-version; &&
|
---|
124 | cp -v lib/hamcrest-core-1.3.jar /usr/share/java/junit-&junit-version;</userinput></screen>
|
---|
125 |
|
---|
126 | <para>
|
---|
127 | if the documentation was built, install it as the
|
---|
128 | <systemitem class="username">root</systemitem> user:
|
---|
129 | </para>
|
---|
130 | <screen role="root"><userinput>install -v -m755 -d /usr/share/doc/junit-&junit-version; &&
|
---|
131 | cp -v -R target/site/* /usr/share/doc/junit-&junit-version;</userinput></screen>
|
---|
132 |
|
---|
133 |
|
---|
134 | <para>
|
---|
135 | If you have followed the instructions in <xref linkend="ojdk-conf"/>,
|
---|
136 | there is nothing more to do: the <envar>CLASSPATH</envar> variable
|
---|
137 | would be automatically updated.
|
---|
138 | </para>
|
---|
139 |
|
---|
140 | </sect2>
|
---|
141 |
|
---|
142 | <sect2 role="content">
|
---|
143 | <title>Contents</title>
|
---|
144 |
|
---|
145 | <segmentedlist>
|
---|
146 | <segtitle>Installed Programs</segtitle>
|
---|
147 | <segtitle>Installed Libraries</segtitle>
|
---|
148 | <segtitle>Installed Directories</segtitle>
|
---|
149 |
|
---|
150 | <seglistitem>
|
---|
151 | <seg>None</seg>
|
---|
152 | <seg>hamcrest-core and junit jar files</seg>
|
---|
153 | <seg>/usr/share/doc/junit-&junit-version; and
|
---|
154 | /usr/share/java/junit-&junit-version;</seg>
|
---|
155 | </seglistitem>
|
---|
156 | </segmentedlist>
|
---|
157 |
|
---|
158 | <variablelist>
|
---|
159 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
160 | <?dbfo list-presentation="list"?>
|
---|
161 | <?dbhtml list-presentation="table"?>
|
---|
162 |
|
---|
163 | <varlistentry id="junit.jar">
|
---|
164 | <term><filename class='libraryfile'>junit-&junit-version;.jar</filename></term>
|
---|
165 | <listitem>
|
---|
166 | <para>contains java classes to support the xUnit framework testing
|
---|
167 | architecture.</para>
|
---|
168 | <indexterm zone="junit junit.jar">
|
---|
169 | <primary sortas="c-junit.jar">junit-&junit-version;.jar</primary>
|
---|
170 | </indexterm>
|
---|
171 | </listitem>
|
---|
172 | </varlistentry>
|
---|
173 |
|
---|
174 | <varlistentry id="hamcrest-core">
|
---|
175 | <term><filename class='libraryfile'>hamcrest-core-1.3.jar</filename></term>
|
---|
176 | <listitem>
|
---|
177 | <para>contains java classes to support matchers used in xUnit
|
---|
178 | tests.</para>
|
---|
179 | <indexterm zone="junit hamcrest-core">
|
---|
180 | <primary sortas="c-hamcrest-core">hamcrest-core-1.3.jar</primary>
|
---|
181 | </indexterm>
|
---|
182 | </listitem>
|
---|
183 | </varlistentry>
|
---|
184 |
|
---|
185 | </variablelist>
|
---|
186 |
|
---|
187 | </sect2>
|
---|
188 |
|
---|
189 | </sect1>
|
---|