[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 |
|
---|
| 32 | <para>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.</para>
|
---|
| 37 |
|
---|
[0f039bc] | 38 | &lfs75_checked;
|
---|
[480ea81] | 39 |
|
---|
[2876fbf] | 40 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 41 | <itemizedlist spacing="compact">
|
---|
| 42 | <listitem>
|
---|
| 43 | <para>Download (HTTP): <ulink url="&junit-download-http;"/></para>
|
---|
| 44 | </listitem>
|
---|
| 45 | <listitem>
|
---|
| 46 | <para>Download (FTP): <ulink url="&junit-download-ftp;"/></para>
|
---|
| 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
| 49 | <para>Download MD5 sum: &junit-md5sum;</para>
|
---|
| 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
| 52 | <para>Download size: &junit-size;</para>
|
---|
| 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>Estimated disk space required: &junit-buildsize;</para>
|
---|
| 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>Estimated build time: &junit-time;</para>
|
---|
| 59 | </listitem>
|
---|
| 60 | </itemizedlist>
|
---|
| 61 |
|
---|
[94c4ae3] | 62 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[debb88bf] | 63 | <itemizedlist spacing="compact">
|
---|
| 64 | <listitem>
|
---|
| 65 | <para>
|
---|
[94c4ae3] | 66 | Required file: <ulink
|
---|
[6dc9fd3] | 67 | url="http://hamcrest.googlecode.com/files/hamcrest-&hamcrest-version;.tgz">
|
---|
| 68 | http://hamcrest.googlecode.com/files/hamcrest-&hamcrest-version;.tgz </ulink>
|
---|
[debb88bf] | 69 | </para>
|
---|
| 70 | </listitem>
|
---|
| 71 | </itemizedlist>
|
---|
| 72 |
|
---|
[2876fbf] | 73 | <bridgehead renderas="sect3">JUnit Dependencies</bridgehead>
|
---|
| 74 |
|
---|
| 75 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[debb88bf] | 76 | <para role="required">
|
---|
[94c4ae3] | 77 | <xref linkend="apache-ant"/> and
|
---|
[debb88bf] | 78 | <xref linkend="unzip"/>
|
---|
| 79 | </para>
|
---|
[2876fbf] | 80 |
|
---|
| 81 | <para condition="html" role="usernotes">User Notes:
|
---|
| 82 | <ulink url="&blfs-wiki;/junit"/></para>
|
---|
| 83 |
|
---|
| 84 | </sect2>
|
---|
| 85 |
|
---|
| 86 | <sect2 role="installation">
|
---|
| 87 | <title>Installation of JUnit</title>
|
---|
| 88 |
|
---|
[6dc9fd3] | 89 | <!-- <para>To do a full build of JUnit from source, <xref linkend='apache-ant'/>
|
---|
[94c4ae3] | 90 | is required. However JUnit is useful in building Apache Ant. Copy the
|
---|
| 91 | JUnit-&junit-version; jar file to get started. Then come back to build
|
---|
| 92 | from source, if desired.</para>
|
---|
[debb88bf] | 93 |
|
---|
| 94 | <para>Install the <application>JUnit</application> jar file by running the following
|
---|
[2876fbf] | 95 | commands as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 96 |
|
---|
[debb88bf] | 97 | <screen role="root"><userinput>install -v -m755 -d /usr/share/java &&
|
---|
[1b5d270e] | 98 | cp -v junit-&junit-version;.jar /usr/share/java</userinput></screen>
|
---|
[94c4ae3] | 99 |
|
---|
| 100 | <para>At this point, make sure Apache-Ant is installed and then continue
|
---|
[e6a3602] | 101 | with the source build and installation. From the directory created when
|
---|
[94c4ae3] | 102 | extracting the JUnit sources, place the required hamcrest jar files where
|
---|
| 103 | needed and build the package:</para>
|
---|
[6dc9fd3] | 104 | -->
|
---|
| 105 | <para>Place the required hamcrest jar files where needed and build the
|
---|
| 106 | package:</para>
|
---|
[94c4ae3] | 107 |
|
---|
[6dc9fd3] | 108 | <screen><userinput>tar -xf ../hamcrest-&hamcrest-version;.tgz &&
|
---|
| 109 | cp -v hamcrest-&hamcrest-version;/hamcrest-core-&hamcrest-version;{,-sources}.jar lib/ &&
|
---|
[94c4ae3] | 110 | ant dist</userinput></screen>
|
---|
[debb88bf] | 111 |
|
---|
[94c4ae3] | 112 | <para>Testing is automatically done as a part of the build step.</para>
|
---|
| 113 |
|
---|
| 114 | <para>Install the files in the final location as the
|
---|
[debb88bf] | 115 | <systemitem class="username">root</systemitem> user:</para>
|
---|
[94c4ae3] | 116 |
|
---|
| 117 | <screen role="root"><userinput>install -v -m755 -d /usr/share/{doc,java}/junit-&junit-version; &&
|
---|
| 118 | chown -R root:root . &&
|
---|
| 119 |
|
---|
| 120 | cp -v -R junit*/javadoc/* /usr/share/doc/junit-&junit-version; &&
|
---|
| 121 | cp -v junit*/junit*.jar /usr/share/java/junit-&junit-version; &&
|
---|
[6dc9fd3] | 122 | cp -v hamcrest-&hamcrest-version;/hamcrest-core*.jar /usr/share/java/junit-&junit-version;</userinput></screen>
|
---|
[94c4ae3] | 123 |
|
---|
| 124 | <para>Finally, update the <envar>CLASSPATH</envar> variable:</para>
|
---|
[debb88bf] | 125 |
|
---|
[94c4ae3] | 126 | <screen><userinput>export CLASSPATH=$CLASSPATH:/usr/share/java/junit-&junit-version;</userinput></screen>
|
---|
[2876fbf] | 127 | </sect2>
|
---|
[94c4ae3] | 128 |
|
---|
[2876fbf] | 129 | <sect2 role="content">
|
---|
| 130 | <title>Contents</title>
|
---|
| 131 |
|
---|
| 132 | <segmentedlist>
|
---|
| 133 | <segtitle>Installed Programs</segtitle>
|
---|
[94c4ae3] | 134 | <segtitle>Installed Libraies</segtitle>
|
---|
[2876fbf] | 135 | <segtitle>Installed Directories</segtitle>
|
---|
| 136 |
|
---|
| 137 | <seglistitem>
|
---|
| 138 | <seg>None</seg>
|
---|
[94c4ae3] | 139 | <seg>hamcrest-core and junit jar files</seg>
|
---|
| 140 | <seg>/usr/share/doc/junit-&junit-version; and
|
---|
| 141 | /usr/share/java/junit-&junit-version;</seg>
|
---|
[2876fbf] | 142 | </seglistitem>
|
---|
| 143 | </segmentedlist>
|
---|
| 144 |
|
---|
| 145 | <variablelist>
|
---|
| 146 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 147 | <?dbfo list-presentation="list"?>
|
---|
| 148 | <?dbhtml list-presentation="table"?>
|
---|
| 149 |
|
---|
| 150 | <varlistentry id="junit.jar">
|
---|
[94c4ae3] | 151 | <term><filename class='libraryfile'>junit jar files</filename></term>
|
---|
[2876fbf] | 152 | <listitem>
|
---|
| 153 | <para>contains java classes to support the xUnit framework testing
|
---|
| 154 | architecture.</para>
|
---|
| 155 | <indexterm zone="junit junit.jar">
|
---|
| 156 | <primary sortas="c-junit.jar">junit-&junit-version;.jar</primary>
|
---|
| 157 | </indexterm>
|
---|
| 158 | </listitem>
|
---|
| 159 | </varlistentry>
|
---|
| 160 |
|
---|
| 161 | </variablelist>
|
---|
| 162 |
|
---|
| 163 | </sect2>
|
---|
[94c4ae3] | 164 |
|
---|
[2876fbf] | 165 | </sect1>
|
---|