junit-3.8.2/ 0000755 0001750 0001750 00000000000 10402050446 011634 5 ustar mkoch mkoch junit-3.8.2/javadoc/ 0000755 0001750 0001750 00000000000 10402050444 013241 5 ustar mkoch mkoch junit-3.8.2/javadoc/index-all.html 0000644 0001750 0001750 00000140021 10402050444 016002 0 ustar mkoch mkoch
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
TestFailure
collects a failed test together with
the caught exception.TestResult
collects the results of executing
a test case.TestSuite
is a Composite
of Tests.
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.TestSuite
A TestSuite
is a Composite
of Tests.
It runs a collection of test cases. Here is an example using
the dynamic test definition.
TestSuite suite= new TestSuite(); suite.addTest(new MathTest("testAdd")); suite.addTest(new MathTest("testDivideByZero"));Alternatively, a TestSuite can extract the tests to be run automatically. To do so you pass the class of your TestCase class to the TestSuite constructor.
TestSuite suite= new TestSuite(MathTest.class);This constructor creates a suite with all the methods starting with "test" that take no arguments.
A final option is to do the same for a large array of test classes.
Class[] testClasses = { MathTest.class, AnotherTest.class } TestSuite suite= new TestSuite(testClasses);
Test
Constructor Summary | |
TestSuite()
Constructs an empty TestSuite. |
|
TestSuite(java.lang.Class theClass)
Constructs a TestSuite from the given class. |
|
TestSuite(java.lang.Class[] classes)
Constructs a TestSuite from the given array of classes. |
|
TestSuite(java.lang.Class[] classes,
java.lang.String name)
Constructs a TestSuite from the given array of classes with the given name. |
|
TestSuite(java.lang.Class theClass,
java.lang.String name)
Constructs a TestSuite from the given class with the given name. |
|
TestSuite(java.lang.String name)
Constructs an empty TestSuite. |
Method Summary | |
void |
addTest(Test test)
Adds a test to the suite. |
void |
addTestSuite(java.lang.Class testClass)
Adds the tests from the given class to the suite |
int |
countTestCases()
Counts the number of test cases that will be run by this test. |
static Test |
createTest(java.lang.Class theClass,
java.lang.String name)
...as the moon sets over the early morning Merlin, Oregon mountains, our intrepid adventurers type... |
java.lang.String |
getName()
Returns the name of the suite. |
static java.lang.reflect.Constructor |
getTestConstructor(java.lang.Class theClass)
Gets a constructor which takes a single String as its argument or a no arg constructor. |
void |
run(TestResult result)
Runs the tests and collects their result in a TestResult. |
void |
runTest(Test test,
TestResult result)
|
void |
setName(java.lang.String name)
Sets the name of the suite. |
Test |
testAt(int index)
Returns the test at the given index |
int |
testCount()
Returns the number of tests in this suite |
java.util.Enumeration |
tests()
Returns the tests as an enumeration |
java.lang.String |
toString()
|
static Test |
warning(java.lang.String message)
Returns a test which will fail and log a warning message. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TestSuite()
public TestSuite(java.lang.Class theClass)
public TestSuite(java.lang.Class theClass, java.lang.String name)
TestSuite(Class)
public TestSuite(java.lang.String name)
public TestSuite(java.lang.Class[] classes)
classes
- public TestSuite(java.lang.Class[] classes, java.lang.String name)
TestSuite(Class[])
Method Detail |
public static Test createTest(java.lang.Class theClass, java.lang.String name)
public static java.lang.reflect.Constructor getTestConstructor(java.lang.Class theClass) throws java.lang.NoSuchMethodException
java.lang.NoSuchMethodException
public static Test warning(java.lang.String message)
public void addTest(Test test)
public void addTestSuite(java.lang.Class testClass)
public int countTestCases()
countTestCases
in interface Test
public java.lang.String getName()
public void run(TestResult result)
run
in interface Test
public void runTest(Test test, TestResult result)
public void setName(java.lang.String name)
name
- The name to setpublic Test testAt(int index)
public int testCount()
public java.util.Enumeration tests()
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Protectable can be run and can throw a Throwable.
TestResult
Method Summary | |
void |
protect()
Run the the following method protected. |
Method Detail |
public void protect() throws java.lang.Throwable
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Error
junit.framework.AssertionFailedError
junit.framework.ComparisonFailure
Thrown when an assert equals for Strings failed. Inspired by a patch from Alex Chaffee mailto:alex@purpletech.com
Constructor Summary | |
ComparisonFailure(java.lang.String message,
java.lang.String expected,
java.lang.String actual)
Constructs a comparison failure. |
Method Summary | |
java.lang.String |
getActual()
Gets the actual string value |
java.lang.String |
getExpected()
Gets the expected string value |
java.lang.String |
getMessage()
Returns "..." in place of common prefix and "..." in place of common suffix between expected and actual. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ComparisonFailure(java.lang.String message, java.lang.String expected, java.lang.String actual)
message
- the identifying message or nullexpected
- the expected string valueactual
- the actual string valueMethod Detail |
public java.lang.String getMessage()
Throwable.getMessage()
public java.lang.String getActual()
public java.lang.String getExpected()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
A set of assert methods. Messages are only displayed when an assert fails.
Constructor Summary | |
protected |
Assert()
Protect constructor since it is a static only class |
Method Summary | |
static void |
assertEquals(boolean expected,
boolean actual)
Asserts that two booleans are equal. |
static void |
assertEquals(byte expected,
byte actual)
Asserts that two bytes are equal. |
static void |
assertEquals(char expected,
char actual)
Asserts that two chars are equal. |
static void |
assertEquals(double expected,
double actual,
double delta)
Asserts that two doubles are equal concerning a delta. |
static void |
assertEquals(float expected,
float actual,
float delta)
Asserts that two floats are equal concerning a delta. |
static void |
assertEquals(int expected,
int actual)
Asserts that two ints are equal. |
static void |
assertEquals(long expected,
long actual)
Asserts that two longs are equal. |
static void |
assertEquals(java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects are equal. |
static void |
assertEquals(short expected,
short actual)
Asserts that two shorts are equal. |
static void |
assertEquals(java.lang.String message,
boolean expected,
boolean actual)
Asserts that two booleans are equal. |
static void |
assertEquals(java.lang.String message,
byte expected,
byte actual)
Asserts that two bytes are equal. |
static void |
assertEquals(java.lang.String message,
char expected,
char actual)
Asserts that two chars are equal. |
static void |
assertEquals(java.lang.String message,
double expected,
double actual,
double delta)
Asserts that two doubles are equal concerning a delta. |
static void |
assertEquals(java.lang.String message,
float expected,
float actual,
float delta)
Asserts that two floats are equal concerning a delta. |
static void |
assertEquals(java.lang.String message,
int expected,
int actual)
Asserts that two ints are equal. |
static void |
assertEquals(java.lang.String message,
long expected,
long actual)
Asserts that two longs are equal. |
static void |
assertEquals(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects are equal. |
static void |
assertEquals(java.lang.String message,
short expected,
short actual)
Asserts that two shorts are equal. |
static void |
assertEquals(java.lang.String expected,
java.lang.String actual)
Asserts that two Strings are equal. |
static void |
assertEquals(java.lang.String message,
java.lang.String expected,
java.lang.String actual)
Asserts that two Strings are equal. |
static void |
assertFalse(boolean condition)
Asserts that a condition is false. |
static void |
assertFalse(java.lang.String message,
boolean condition)
Asserts that a condition is false. |
static void |
assertNotNull(java.lang.Object object)
Asserts that an object isn't null. |
static void |
assertNotNull(java.lang.String message,
java.lang.Object object)
Asserts that an object isn't null. |
static void |
assertNotSame(java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects do not refer to the same object. |
static void |
assertNotSame(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects do not refer to the same object. |
static void |
assertNull(java.lang.Object object)
Asserts that an object is null. |
static void |
assertNull(java.lang.String message,
java.lang.Object object)
Asserts that an object is null. |
static void |
assertSame(java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects refer to the same object. |
static void |
assertSame(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
Asserts that two objects refer to the same object. |
static void |
assertTrue(boolean condition)
Asserts that a condition is true. |
static void |
assertTrue(java.lang.String message,
boolean condition)
Asserts that a condition is true. |
static void |
fail()
Fails a test with no message. |
static void |
fail(java.lang.String message)
Fails a test with the given message. |
static void |
failNotEquals(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
|
static void |
failNotSame(java.lang.String message,
java.lang.Object expected,
java.lang.Object actual)
|
static void |
failSame(java.lang.String message)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected Assert()
Method Detail |
public static void assertTrue(java.lang.String message, boolean condition)
public static void assertTrue(boolean condition)
public static void assertFalse(java.lang.String message, boolean condition)
public static void assertFalse(boolean condition)
public static void fail(java.lang.String message)
public static void fail()
public static void assertEquals(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
public static void assertEquals(java.lang.Object expected, java.lang.Object actual)
public static void assertEquals(java.lang.String message, java.lang.String expected, java.lang.String actual)
public static void assertEquals(java.lang.String expected, java.lang.String actual)
public static void assertEquals(java.lang.String message, double expected, double actual, double delta)
public static void assertEquals(double expected, double actual, double delta)
public static void assertEquals(java.lang.String message, float expected, float actual, float delta)
public static void assertEquals(float expected, float actual, float delta)
public static void assertEquals(java.lang.String message, long expected, long actual)
public static void assertEquals(long expected, long actual)
public static void assertEquals(java.lang.String message, boolean expected, boolean actual)
public static void assertEquals(boolean expected, boolean actual)
public static void assertEquals(java.lang.String message, byte expected, byte actual)
public static void assertEquals(byte expected, byte actual)
public static void assertEquals(java.lang.String message, char expected, char actual)
public static void assertEquals(char expected, char actual)
public static void assertEquals(java.lang.String message, short expected, short actual)
public static void assertEquals(short expected, short actual)
public static void assertEquals(java.lang.String message, int expected, int actual)
public static void assertEquals(int expected, int actual)
public static void assertNotNull(java.lang.Object object)
public static void assertNotNull(java.lang.String message, java.lang.Object object)
public static void assertNull(java.lang.Object object)
public static void assertNull(java.lang.String message, java.lang.Object object)
public static void assertSame(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
public static void assertSame(java.lang.Object expected, java.lang.Object actual)
public static void assertNotSame(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
public static void assertNotSame(java.lang.Object expected, java.lang.Object actual)
public static void failSame(java.lang.String message)
public static void failNotSame(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
public static void failNotEquals(java.lang.String message, java.lang.Object expected, java.lang.Object actual)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
A test case defines the fixture to run multiple tests. To define a test case
1) implement a subclass of TestCase
2) define instance variables that store the state of the fixture
3) initialize the fixture state by overriding setUp
4) clean-up after a test by overriding tearDown
.
Each test runs in its own fixture so there
can be no side effects among test runs.
Here is an example:
public class MathTest extends TestCase { protected double fValue1; protected double fValue2; protected void setUp() { fValue1= 2.0; fValue2= 3.0; } }For each test implement a method which interacts with the fixture. Verify the expected results with assertions specified by calling
assertTrue
with a boolean.
public void testAdd() { double result= fValue1 + fValue2; assertTrue(result == 5.0); }Once the methods are defined you can run them. The framework supports both a static type safe and more dynamic way to run a test. In the static way you override the runTest method and define the method to be invoked. A convenient way to do so is with an anonymous inner class.
TestCase test= new MathTest("add") { public void runTest() { testAdd(); } }; test.run();The dynamic way uses reflection to implement
runTest
. It dynamically finds
and invokes a method.
In this case the name of the test case has to correspond to the test method
to be run.
TestCase test= new MathTest("testAdd"); test.run();The tests to be run can be collected into a TestSuite. JUnit provides different test runners which can run a test suite and collect the results. A test runner either expects a static method
suite
as the entry
point to get a test to run or it will extract the suite automatically.
public static Test suite() { suite.addTest(new MathTest("testAdd")); suite.addTest(new MathTest("testDivideByZero")); return suite; }
TestResult
,
TestSuite
Constructor Summary | |
TestCase()
No-arg constructor to enable serialization. |
|
TestCase(java.lang.String name)
Constructs a test case with the given name. |
Method Summary | |
int |
countTestCases()
Counts the number of test cases executed by run(TestResult result). |
protected TestResult |
createResult()
Creates a default TestResult object |
java.lang.String |
getName()
Gets the name of a TestCase |
TestResult |
run()
A convenience method to run this test, collecting the results with a default TestResult object. |
void |
run(TestResult result)
Runs the test case and collects the results in TestResult. |
void |
runBare()
Runs the bare test sequence. |
protected void |
runTest()
Override to run the test and assert its state. |
void |
setName(java.lang.String name)
Sets the name of a TestCase |
protected void |
setUp()
Sets up the fixture, for example, open a network connection. |
protected void |
tearDown()
Tears down the fixture, for example, close a network connection. |
java.lang.String |
toString()
Returns a string representation of the test case |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TestCase()
public TestCase(java.lang.String name)
Method Detail |
public int countTestCases()
countTestCases
in interface Test
protected TestResult createResult()
TestResult
public TestResult run()
TestResult
public void run(TestResult result)
run
in interface Test
public void runBare() throws java.lang.Throwable
java.lang.Throwable
- if any exception is thrownprotected void runTest() throws java.lang.Throwable
java.lang.Throwable
- if any exception is thrownprotected void setUp() throws java.lang.Exception
java.lang.Exception
protected void tearDown() throws java.lang.Exception
java.lang.Exception
public java.lang.String toString()
public java.lang.String getName()
public void setName(java.lang.String name)
name
- The name to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Test can be run and collect its results.
TestResult
Method Summary | |
int |
countTestCases()
Counts the number of test cases that will be run by this test. |
void |
run(TestResult result)
Runs a test and collects its result in a TestResult instance. |
Method Detail |
public int countTestCases()
public void run(TestResult result)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
Interface Summary | |
Protectable | A Protectable can be run and can throw a Throwable. |
Test | A Test can be run and collect its results. |
TestListener | A Listener for test progress |
Class Summary | |
Assert | A set of assert methods. |
ComparisonCompactor | |
TestCase | A test case defines the fixture to run multiple tests. |
TestFailure | A TestFailure collects a failed test together with
the caught exception. |
TestResult | A TestResult collects the results of executing
a test case. |
TestSuite | A TestSuite is a Composite of Tests. |
Error Summary | |
AssertionFailedError | Thrown when an assertion failed. |
ComparisonFailure | Thrown when an assert equals for Strings failed. |
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.TestResult
A TestResult
collects the results of executing
a test case. It is an instance of the Collecting Parameter pattern.
The test framework distinguishes between failures and errors.
A failure is anticipated and checked for with assertions. Errors are
unanticipated problems like an ArrayIndexOutOfBoundsException
.
Test
Field Summary | |
protected java.util.Vector |
fErrors
|
protected java.util.Vector |
fFailures
|
protected java.util.Vector |
fListeners
|
protected int |
fRunTests
|
Constructor Summary | |
TestResult()
|
Method Summary | |
void |
addError(Test test,
java.lang.Throwable t)
Adds an error to the list of errors. |
void |
addFailure(Test test,
AssertionFailedError t)
Adds a failure to the list of failures. |
void |
addListener(TestListener listener)
Registers a TestListener |
void |
endTest(Test test)
Informs the result that a test was completed. |
int |
errorCount()
Gets the number of detected errors. |
java.util.Enumeration |
errors()
Returns an Enumeration for the errors |
int |
failureCount()
Gets the number of detected failures. |
java.util.Enumeration |
failures()
Returns an Enumeration for the failures |
void |
removeListener(TestListener listener)
Unregisters a TestListener |
protected void |
run(TestCase test)
Runs a TestCase. |
int |
runCount()
Gets the number of run tests. |
void |
runProtected(Test test,
Protectable p)
Runs a TestCase. |
boolean |
shouldStop()
Checks whether the test run should stop |
void |
startTest(Test test)
Informs the result that a test will be started. |
void |
stop()
Marks that the test run should stop. |
boolean |
wasSuccessful()
Returns whether the entire test was successful or not. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.util.Vector fFailures
protected java.util.Vector fErrors
protected java.util.Vector fListeners
protected int fRunTests
Constructor Detail |
public TestResult()
Method Detail |
public void addError(Test test, java.lang.Throwable t)
public void addFailure(Test test, AssertionFailedError t)
public void addListener(TestListener listener)
public void removeListener(TestListener listener)
public void endTest(Test test)
public int errorCount()
public java.util.Enumeration errors()
public int failureCount()
public java.util.Enumeration failures()
protected void run(TestCase test)
public int runCount()
public void runProtected(Test test, Protectable p)
public boolean shouldStop()
public void startTest(Test test)
public void stop()
public boolean wasSuccessful()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.TestFailure
A TestFailure
collects a failed test together with
the caught exception.
TestResult
Field Summary | |
protected Test |
fFailedTest
|
protected java.lang.Throwable |
fThrownException
|
Constructor Summary | |
TestFailure(Test failedTest,
java.lang.Throwable thrownException)
Constructs a TestFailure with the given test and exception. |
Method Summary | |
java.lang.String |
exceptionMessage()
|
Test |
failedTest()
Gets the failed test. |
boolean |
isFailure()
|
java.lang.Throwable |
thrownException()
Gets the thrown exception. |
java.lang.String |
toString()
Returns a short description of the failure. |
java.lang.String |
trace()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Test fFailedTest
protected java.lang.Throwable fThrownException
Constructor Detail |
public TestFailure(Test failedTest, java.lang.Throwable thrownException)
Method Detail |
public Test failedTest()
public java.lang.Throwable thrownException()
public java.lang.String toString()
public java.lang.String trace()
public java.lang.String exceptionMessage()
public boolean isFailure()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Listener for test progress
Method Summary | |
void |
addError(Test test,
java.lang.Throwable t)
An error occurred. |
void |
addFailure(Test test,
AssertionFailedError t)
A failure occurred. |
void |
endTest(Test test)
A test ended. |
void |
startTest(Test test)
A test started. |
Method Detail |
public void addError(Test test, java.lang.Throwable t)
public void addFailure(Test test, AssertionFailedError t)
public void endTest(Test test)
public void startTest(Test test)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.ComparisonCompactor
Constructor Summary | |
ComparisonCompactor(int contextLength,
java.lang.String expected,
java.lang.String actual)
|
Method Summary | |
java.lang.String |
compact(java.lang.String message)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ComparisonCompactor(int contextLength, java.lang.String expected, java.lang.String actual)
Method Detail |
public java.lang.String compact(java.lang.String message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Error
junit.framework.AssertionFailedError
Thrown when an assertion failed.
Constructor Summary | |
AssertionFailedError()
|
|
AssertionFailedError(java.lang.String message)
|
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AssertionFailedError()
public AssertionFailedError(java.lang.String message)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interfaces
Protectable Test TestListener |
Classes
Assert ComparisonCompactor TestCase TestFailure TestResult TestSuite |
Errors
AssertionFailedError ComparisonFailure |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.extensions.TestDecorator
A Decorator for Tests. Use TestDecorator as the base class for defining new test decorators. Test decorator subclasses can be introduced to add behaviour before or after a test is run.
Field Summary | |
protected Test |
fTest
|
Constructor Summary | |
TestDecorator(Test test)
|
Method Summary | |
void |
basicRun(TestResult result)
The basic run behaviour. |
int |
countTestCases()
Counts the number of test cases that will be run by this test. |
Test |
getTest()
|
void |
run(TestResult result)
Runs a test and collects its result in a TestResult instance. |
java.lang.String |
toString()
|
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected Test fTest
Constructor Detail |
public TestDecorator(Test test)
Method Detail |
public void basicRun(TestResult result)
public int countTestCases()
Test
countTestCases
in interface Test
public void run(TestResult result)
Test
run
in interface Test
public java.lang.String toString()
public Test getTest()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.TestSuite
junit.extensions.ActiveTestSuite
A TestSuite for active Tests. It runs each test in a separate thread and waits until all threads have terminated. -- Aarhus Radisson Scandinavian Center 11th floor
Constructor Summary | |
ActiveTestSuite()
|
|
ActiveTestSuite(java.lang.Class theClass)
|
|
ActiveTestSuite(java.lang.Class theClass,
java.lang.String name)
|
|
ActiveTestSuite(java.lang.String name)
|
Method Summary | |
void |
run(TestResult result)
Runs the tests and collects their result in a TestResult. |
void |
runFinished()
|
void |
runTest(Test test,
TestResult result)
|
Methods inherited from class junit.framework.TestSuite |
addTest, addTestSuite, countTestCases, createTest, getName, getTestConstructor, setName, testAt, testCount, tests, toString, warning |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ActiveTestSuite()
public ActiveTestSuite(java.lang.Class theClass)
public ActiveTestSuite(java.lang.String name)
public ActiveTestSuite(java.lang.Class theClass, java.lang.String name)
Method Detail |
public void run(TestResult result)
TestSuite
run
in interface Test
run
in class TestSuite
public void runTest(Test test, TestResult result)
runTest
in class TestSuite
public void runFinished()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.extensions.TestDecorator
junit.extensions.TestSetup
A Decorator to set up and tear down additional fixture state. Subclass TestSetup and insert it into your tests when you want to set up additional state once before the tests are run.
Field Summary |
Fields inherited from class junit.extensions.TestDecorator |
fTest |
Constructor Summary | |
TestSetup(Test test)
|
Method Summary | |
void |
run(TestResult result)
Runs a test and collects its result in a TestResult instance. |
protected void |
setUp()
Sets up the fixture. |
protected void |
tearDown()
Tears down the fixture. |
Methods inherited from class junit.extensions.TestDecorator |
basicRun, countTestCases, getTest, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public TestSetup(Test test)
Method Detail |
public void run(TestResult result)
Test
run
in interface Test
run
in class TestDecorator
protected void setUp() throws java.lang.Exception
java.lang.Exception
protected void tearDown() throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
Class Summary | |
ActiveTestSuite | A TestSuite for active Tests. |
ExceptionTestCase | A TestCase that expects an Exception of class fExpected to be thrown. |
RepeatedTest | A Decorator that runs a test repeatedly. |
TestDecorator | A Decorator for Tests. |
TestSetup | A Decorator to set up and tear down additional fixture state. |
|
||||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.framework.TestCase
junit.extensions.ExceptionTestCase
A TestCase that expects an Exception of class fExpected to be thrown. The other way to check that an expected exception is thrown is:
try { shouldThrow(); } catch (SpecialException e) { return; } fail("Expected SpecialException");To use ExceptionTestCase, create a TestCase like:
new ExceptionTestCase("testShouldThrow", SpecialException.class);
Constructor Summary | |
ExceptionTestCase(java.lang.String name,
java.lang.Class exception)
|
Method Summary | |
protected void |
runTest()
Execute the test method expecting that an Exception of class fExpected or one of its subclasses will be thrown |
Methods inherited from class junit.framework.TestCase |
countTestCases, createResult, getName, run, run, runBare, setName, setUp, tearDown, toString |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ExceptionTestCase(java.lang.String name, java.lang.Class exception)
Method Detail |
protected void runTest() throws java.lang.Throwable
runTest
in class TestCase
java.lang.Throwable
- if any exception is thrown
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Classes
ActiveTestSuite ExceptionTestCase RepeatedTest TestDecorator TestSetup |
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjunit.framework.Assert
junit.extensions.TestDecorator
junit.extensions.RepeatedTest
A Decorator that runs a test repeatedly.
Field Summary |
Fields inherited from class junit.extensions.TestDecorator |
fTest |
Constructor Summary | |
RepeatedTest(Test test,
int repeat)
|
Method Summary | |
int |
countTestCases()
Counts the number of test cases that will be run by this test. |
void |
run(TestResult result)
Runs a test and collects its result in a TestResult instance. |
java.lang.String |
toString()
|
Methods inherited from class junit.extensions.TestDecorator |
basicRun, getTest |
Methods inherited from class junit.framework.Assert |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RepeatedTest(Test test, int repeat)
Method Detail |
public int countTestCases()
Test
countTestCases
in interface Test
countTestCases
in class TestDecorator
public void run(TestResult result)
Test
run
in interface Test
run
in class TestDecorator
public java.lang.String toString()
toString
in class TestDecorator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
Packages | |
junit.extensions | |
junit.framework |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
All Classes
Packages
|
junit-3.8.2/javadoc/stylesheet.css 0000644 0001750 0001750 00000002544 10402050444 016151 0 ustar mkoch mkoch /* Javadoc style sheet */ /* makes unvisted linkes red (red bad) */ A {color:red;} /* makes visted linkes the same green as the toolbar (green good) */ A:visited {color:#03A35D;} /* Define colors, fonts and other style attributes here to override the defaults */ /* Page background color */ body { background-color: #FFFFFF } /* Table colors */ .TableHeadingColor { background: #03A35D} /* Green */ .TableSubHeadingColor { background: #03A35D } /* Green */ .TableRowColor { background: #FFFFFF } /* White */ /* Font used in left-hand frame lists */ .FrameTitleFont { font-size: normal; font-family: normal } .FrameHeadingFont { font-size: normal; font-family: normal } .FrameItemFont { font-size: normal; font-family: normal } /* Example of smaller, sans-serif font in frames */ /* .FrameItemFont { font-size: 10pt; font-family: Helvetica, Arial, sans-serif } */ /* Navigation bar fonts and colors */ .NavBarCell1 { background-color:#03A35D;}/* Green */ .NavBarCell1Rev { background-color:#006400;}/* Dark green */ .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} junit-3.8.2/javadoc/help-doc.html 0000644 0001750 0001750 00000020173 10402050444 015625 0 ustar mkoch mkoch
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:
- Interfaces (italic)
- Classes
- Exceptions
- Errors
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
- Class inheritance diagram
- Direct Subclasses
- All Known Subinterfaces
- All Known Implementing Classes
- Class/interface declaration
- Class/interface description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Field Detail
- Constructor Detail
- Method Detail
There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting withjava.lang.Object
. The interfaces do not inherit fromjava.lang.Object
.
- When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.
- When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
This help file applies to API documentation generated using the standard doclet.
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
Package junit.framework |
Class junit.framework.AssertionFailedError extends java.lang.Error implements Serializable |
serialVersionUID: 1l
Class junit.framework.ComparisonFailure extends AssertionFailedError implements Serializable |
serialVersionUID: 1l
Serialized Fields |
java.lang.String fExpected
java.lang.String fActual
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |
|
||||||||||
PREV NEXT | FRAMES NO FRAMES |