[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 |
|
---|
[debb88bf] | 7 | <!ENTITY junit-download-http "https://launchpad.net/debian/+archive/primary/+files/junit4_4.11.orig.tar.gz">
|
---|
[2876fbf] | 8 | <!ENTITY junit-download-ftp " ">
|
---|
[debb88bf] | 9 | <!ENTITY junit-md5sum " ">
|
---|
[ea8b96e] | 10 | <!ENTITY junit-size "1.7 MB">
|
---|
[aad5d54] | 11 | <!ENTITY junit-buildsize "15 MB">
|
---|
[2876fbf] | 12 | <!ENTITY junit-time "less than 0.1 SBU">
|
---|
| 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 |
|
---|
[784a1a7f] | 32 | <warning><para>Under revison do not use for now.</para></warning>
|
---|
| 33 |
|
---|
| 34 |
|
---|
[2876fbf] | 35 | <para>The <application>JUnit</application> package contains a simple, open
|
---|
| 36 | source framework to write and run repeatable tests. It is an instance of
|
---|
| 37 | the xUnit architecture for unit testing frameworks. JUnit features include
|
---|
| 38 | assertions for testing expected results, test fixtures for sharing common
|
---|
| 39 | test data, and test runners for running tests.</para>
|
---|
| 40 |
|
---|
[debb88bf] | 41 | <!-- &lfs73_checked; -->
|
---|
[480ea81] | 42 |
|
---|
[2876fbf] | 43 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 44 | <itemizedlist spacing="compact">
|
---|
| 45 | <listitem>
|
---|
| 46 | <para>Download (HTTP): <ulink url="&junit-download-http;"/></para>
|
---|
| 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
| 49 | <para>Download (FTP): <ulink url="&junit-download-ftp;"/></para>
|
---|
| 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
| 52 | <para>Download MD5 sum: &junit-md5sum;</para>
|
---|
| 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>Download size: &junit-size;</para>
|
---|
| 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>Estimated disk space required: &junit-buildsize;</para>
|
---|
| 59 | </listitem>
|
---|
| 60 | <listitem>
|
---|
| 61 | <para>Estimated build time: &junit-time;</para>
|
---|
| 62 | </listitem>
|
---|
| 63 | </itemizedlist>
|
---|
| 64 |
|
---|
[debb88bf] | 65 | <bridgehead renderas="sect3">Required Additional Downloads</bridgehead>
|
---|
| 66 | <itemizedlist spacing="compact">
|
---|
| 67 | <listitem>
|
---|
| 68 | <para>
|
---|
| 69 | <ulink url="http://anduin.linuxfromscratch.org/sources/other/junit-4.11.jar">junit-4.11.jar
|
---|
| 70 | (http//anduin.linuxfromscratch.org/sources/other/junit-4.11.jar)
|
---|
| 71 | </ulink>
|
---|
| 72 | </para>
|
---|
| 73 | </listitem>
|
---|
| 74 | <listitem>
|
---|
| 75 | <para>
|
---|
| 76 | <ulink url="http://hamcrest.googlecode.com/files/hamcrest-1.3.tgz">hamcrest-1.3.tgz
|
---|
| 77 | (http//hamcrest.googlecode.com/files/hamcrest-1.3.tgz)
|
---|
| 78 | </ulink>
|
---|
| 79 | </para>
|
---|
| 80 | </listitem>
|
---|
| 81 | </itemizedlist>
|
---|
| 82 |
|
---|
[2876fbf] | 83 | <bridgehead renderas="sect3">JUnit Dependencies</bridgehead>
|
---|
| 84 |
|
---|
| 85 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[debb88bf] | 86 | <para role="required">
|
---|
| 87 | <xref linkend="unzip"/>
|
---|
| 88 | </para>
|
---|
[2876fbf] | 89 |
|
---|
| 90 | <para condition="html" role="usernotes">User Notes:
|
---|
| 91 | <ulink url="&blfs-wiki;/junit"/></para>
|
---|
| 92 |
|
---|
| 93 | </sect2>
|
---|
| 94 |
|
---|
| 95 | <sect2 role="installation">
|
---|
| 96 | <title>Installation of JUnit</title>
|
---|
| 97 |
|
---|
[debb88bf] | 98 | <para>To do a full build of JUnit from source, <xref linkend='apache-ant'/>
|
---|
| 99 | is required. However JUnit is a circular depedency of Apache Ant. Copy
|
---|
| 100 | the JUnit jar file to get started. Then come back to build from source, if
|
---|
| 101 | desired.</para>
|
---|
| 102 |
|
---|
| 103 | <para>Install the <application>JUnit</application> jar file by running the following
|
---|
[2876fbf] | 104 | commands as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 105 |
|
---|
[debb88bf] | 106 | <screen role="root"><userinput>install -v -m755 -d /usr/share/java &&
|
---|
| 107 | cp -v junit.jar /usr/share/java</userinput></screen>
|
---|
| 108 |
|
---|
| 109 | <para>Now install the required hamcrest jar files. Extract the hamcrest-1.3.tgz
|
---|
| 110 | files change to the extracted directory. Then, as the
|
---|
| 111 | <systemitem class="username">root</systemitem> user:</para>
|
---|
| 112 |
|
---|
| 113 | <screen role="root"><userinput>install -v -m755 -d /usr/share/java/hamcrest &&
|
---|
| 114 | cp -v hamcrest-all-1.3.jar /usr/share/java/hamcrest &&
|
---|
| 115 | ln -sv hamcrest/hamcrest-all-1.3.jar /usr/share/java/hamcrest.jar </userinput></screen>
|
---|
[2876fbf] | 116 |
|
---|
| 117 | <para>Add the <filename
|
---|
| 118 | class='libraryfile'>junit-&junit-version;.jar</filename> and <filename
|
---|
| 119 | class='directory'>/usr/share/junit-&junit-version;</filename> directory to
|
---|
[895826e] | 120 | your system <envar>CLASSPATH</envar> environment variable:</para>
|
---|
[2876fbf] | 121 |
|
---|
| 122 | <screen><userinput>export CLASSPATH=$CLASSPATH:\
|
---|
[debb88bf] | 123 | /usr/share/java/junit-&junit-version;.jar:/usr/share/java/hamcrest.jar</userinput></screen>
|
---|
| 124 | <!--
|
---|
[2876fbf] | 125 | <para>To run the <application>JUnit</application> regression self-tests,
|
---|
[debb88bf] | 126 | you'll need to have <xref linkend="openjdk"/>,<!- - <xref linkend="jdk"/>,- -> or
|
---|
[b66ece35] | 127 | <ulink url="http://jikes.sourceforge.net/">Jikes</ulink> installed and the
|
---|
[2876fbf] | 128 | <envar>CLASSPATH</envar> environment variable updated. Then, as an
|
---|
| 129 | unprivileged user, issue:</para>
|
---|
| 130 |
|
---|
| 131 | <screen><userinput>java org.junit.runner.JUnitCore org.junit.tests.AllTests</userinput></screen>
|
---|
[debb88bf] | 132 | -->
|
---|
[2876fbf] | 133 | </sect2>
|
---|
[debb88bf] | 134 | <!--
|
---|
[2876fbf] | 135 | <sect2 role="content">
|
---|
| 136 | <title>Contents</title>
|
---|
| 137 |
|
---|
| 138 | <segmentedlist>
|
---|
| 139 | <segtitle>Installed Programs</segtitle>
|
---|
| 140 | <segtitle>Installed Library</segtitle>
|
---|
| 141 | <segtitle>Installed Directories</segtitle>
|
---|
| 142 |
|
---|
| 143 | <seglistitem>
|
---|
| 144 | <seg>None</seg>
|
---|
| 145 | <seg>junit-&junit-version;.jar</seg>
|
---|
| 146 | <seg>/usr/share/junit-&junit-version;,
|
---|
| 147 | /usr/share/doc/junit-&junit-version;</seg>
|
---|
| 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">
|
---|
| 157 | <term><filename class='libraryfile'>junit-&junit-version;.jar</filename></term>
|
---|
| 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>
|
---|
[debb88bf] | 170 | -->
|
---|
[2876fbf] | 171 | </sect1>
|
---|