Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A programmer-oriented testing framework for Java.

This branch is 6 commits ahead, 1811 commits behind junit-team:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.settings
build
doc
org/junit
src
.classpath
.cvsignore
.project
README.html
acknowledgements.txt
build.xml
cpl-v10.html
done.txt
stylesheet.css
to-do.txt

README.html

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
   <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
   <meta name="Author" content="Erich Gamma, Kent Beck, and David Saff">
   <title>JUnit 4.3.1</title>
</head>
<body>

<h1>
<b><font color="#00CC00">J</font><font color="#FF0000">U</font><font color="#000000">nit
4.3.1</b></h1> 
<br>Brought to you by <a href="http://www.threeriversinstitute.org">Kent Beck</a>, Erich 

Gamma, and <a href="http://david.saff.net">David Saff</a>. 
<br>FAQ edited by <a href="http://www.clarkware.com">Mike Clark</a>. Web mastering by Erik 
Meade.
<br>(see also <a href="http://www.junit.org">JUnit.org</a>)

<hr WIDTH="100%">
<br>27 March 2007
<p>JUnit is a simple framework to write repeatable tests. It is an instance
of the xUnit architecture for unit testing frameworks.
<ul>
<li>
<a href="#Summary of">Summary of Changes</a></li>

<li>
<a href="#Contents">Contents</a></li>

<li>
<a href="#Installation">Installation</a></li>

<li>
<a href="#Getting">Getting Started</a></li>

<li>
<a href="#Documentation">Documentation</a></li>
<li>
<a href="#Known Defects">Known Defects</a></li>
</ul>

<h2>
<a NAME="Summary of"></a>Summary of Changes in version 4.3.1</h2>
<p>
<ul>
<li>Bug fix: 4.3 introduced a 
<a href="https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1684562&group_id=15278">bug</a>
that caused a NullPointerException
when comparing a null reference to a non-null reference in <tt>assertEquals</tt>.
This has been fixed.
<li>Bug fix: The binary jar for 4.3 <a href="https://sourceforge.net/tracker/?func=detail&atid=115278&aid=1686931&group_id=15278">accidentally</a> included the tests and sample code,
which are now removed for a smaller download, but, as always, available from the
full zip.
</ul>
</p>

<h2>
<a NAME="Summary of"></a>Summary of Changes with version 4.3</h2>
<p>
<ul>
<li>Changes in array equality.  Using <tt>assertEquals</tt> to compare array contents is now deprecated.
In the future, <tt>assertEquals</tt> will revert to its pre-4.0 meaning of comparing objects based on
Java's <tt>Object.equals</tt> semantics.  To compare array contents, use the new, more reliable 
<tt>Assert.assertArrayEquals</tt> methods.
<li>The <tt>@Ignore</tt> annotation can now be applied to classes, to ignore the entire class, instead of
individual methods.
<li>Originally, developers who wanted to use a static <tt>suite()</tt> method from JUnit 3.x with a JUnit 4.x
runner had to annotate the class with <tt>@RunWith(AllTests.class)</tt>.  In the common case, this requirement
has been removed.  However, when such a class is wrapped with a JUnit4TestAdapter (which we believe is rare), the
results may not be as expected.
<li>Improved error messages for array comparison("arrays first differed at element [1][0]")
<li>Bug fix: Inaccessible base class is caught at test construction time.
<li>Bug fix: Circular suites are caught at test construction time.
<li>Bug fix: Test constructors that throw exceptions are reported correctly.
<li><b>For committers and extenders</b>
<ul>
<li>Sources now are in a separate "src" directory (this means a big break in the CVS history)
<li>Improved documentation in <tt>Request</tt>, <tt>RunWith</tt>
</ul>
</ul>
</p>

<h2>
<a NAME="Summary of"></a>Summary of Changes with version 4.2</h2>
<p>
<ul>
<li>Bug fix: Inaccessible base class is caught at test construction time.
<li>Bug fix: Circular suites are caught at test construction time.
<li>Improved error messages for array comparison("arrays first differed at element [1][0]")
<li>Test constructors that throw exceptions are reported correctly.
</ul>
</p>


<h2>
<a NAME="Summary of"></a>Summary of Changes with version 4.1</h2>
<p>
<ul>
<li>Bug fix: listeners now get a correct test running time, rather than always being told 0 secs.
<li>The @RunWith annotation is now inherited by subclasses: 
all subclasses of an abstract test class will be run by the same runner.
<li>The build script fails if the JUnit unit tests fail
<li>The faq has been updated
<li>Javadoc has been improved, with more internal links, and package descriptions added (Thanks, Matthias Schmidt!)
<li>An acknowledgements.txt file has been created to credit outside contributions
<li>The <tt>Enclosed</tt> runner, which runs all of the static inner classes of a given class, has been added
to <tt>org.junit.runners</tt>.
</ul>
</p>

<h2>Summary of Changes with version 4.0</h2>
<p>
The architecture of JUnit 4.0 is a substantial departure from that of earlier releases. 
Instead of 
tagging test classes by subclassing junit.framework.TestCase and tagging test methods by 
starting their name with "test", you now tag test methods with the @Test annotation.
</p>


<h2>
<a NAME="Contents"></a>Contents of the Release</h2>

<table CELLSPACING=0 CELLPADDING=0 >
<tr>
<td><tt>README.html&nbsp;</tt></td>

<td>this file</td>
</tr>

<tr>
<td><tt>junit-4.3.1.jar</tt></td>

<td>a jar file with the JUnit framework</td>
</tr>

<tr>
<td><tt>junit-4.3.1-src.jar</tt></td>

<td>a jar file with the source code of the JUnit framework</td>
</tr>

<tr>
<td><tt>org/junit</tt></td>

<td>the source code of the basic JUnit annotations and classes</td>
</tr>

<tr>
<td><tt>&nbsp;&nbsp;&nbsp; samples</tt></td>

<td>sample test cases</td>
</tr>

<tr>
<td><tt>&nbsp;&nbsp;&nbsp; tests</tt></td>

<td>test cases for JUnit itself</td>
</tr>

<tr>
<td><tt>javadoc</tt></td>

<td>javadoc generated documentation</td>
</tr>

<tr>
<td><tt>doc</tt></td>

<td>documentation and articles</td>
</tr>
</table>

<h2>
<a NAME="Installation"></a>Installation</h2>
Below are the installation steps for installing JUnit:
<ol>
<li>
unzip the junit4.3.1.zip file</li>

<li>
add<i> </i><b>junit-4.3.1.jar</b> to the CLASSPATH. For example: 
<tt> set classpath=%classpath%;INSTALL_DIR\junit-4.2.jar;INSTALL_DIR</tt></li>

<li>
test the installation by running <tt>java org.junit.runner.JUnitCore org.junit.tests.AllTests.</tt></li>

<br><b><font color="#FF0000">Notice</font></b>: that the tests are not
contained in the junit-4.3.1.jar but in the installation directory directly.
Therefore make sure that the installation directory is on the class path
</ol>
<b><font color="#FF0000">Important</font></b>: don't install junit-4.3.1.jar
into the extension directory of your JDK installation. If you do so the
test class on the files system will not be found.
<h2>
<a NAME="Getting"></a>Getting Started</h2>
To get started with unit testing and JUnit read the article:
<a href="doc/cookbook/cookbook.htm">JUnit Cookbook</a>.
<br>This article describes basic test writing using JUnit 4.
<p>You find additional samples in the org.junit.samples package:
<ul>
<li>
SimpleTest.java - some simple test cases</li>

<li>
VectorTest.java - test cases for java.util.Vector</li>
</ul>

<h2>
<a NAME="Documentation"></a>Documentation</h2>

<blockquote><a href="doc/cookbook/cookbook.htm">JUnit Cookbook</a>
<br>&nbsp;&nbsp;&nbsp; A cookbook for implementing tests with JUnit.
<br><a href="javadoc/index.html">Javadoc</a>
<br>&nbsp;&nbsp;&nbsp; API documentation generated with javadoc.
<br><a href="doc/faq/faq.htm">Frequently asked questions</a>
<br>&nbsp;&nbsp;&nbsp; Some frequently asked questions about using JUnit.
<br><a href="cpl-v10.html">License</a>
<br>&nbsp;&nbsp;&nbsp; The terms of the common public license used for JUnit.<br>
</blockquote>
The following documents still describe JUnit 3.8.
<blockquote>
<br><a href="doc/testinfected/testing.htm">Test Infected - Programmers
Love Writing Tests</a>
<br>&nbsp;&nbsp;&nbsp; An article demonstrating the development process
with JUnit.
<br><a href="doc/cookstour/cookstour.htm">JUnit - A cooks tour</a>
</blockquote>

<h2><a NAME="Known Defects"></a>Known Defects</h2>
<ul>
<li>Multi-dimensional arrays are not processed correctly by assertEquals.</li>
</ul>

<hr WIDTH="100%">
<!--webbot bot="HTMLMarkup" startspan --><a href="http://sourceforge.net"><IMG
                  src="http://sourceforge.net/sflogo.php?group_id=15278"
                  width="88" height="31" border="0" alt="SourceForge Logo"></a><!--webbot
bot="HTMLMarkup" endspan -->
</body>
</html>
Something went wrong with that request. Please try again.