You are on page 1of 2

JUnit Quick Reference TestSuite junit.

framework
Object
Assert junit.framework TestSuite Test
Object 6 rarely used methods not shown
Assert public . . . . . . . . . . void addTest (Test test)
protected . . . . . . . . . . Assert () public . . . . . . . . . void addTestSuite (Class testClass)
public static . . . . . void assertEquals (String message, public . . . . . . . . . . void run (TestResult result)
Object expected, Object actual) public . . . .Enumeration tests ()
public static . . . . . . void assertEquals (Object expected, Object actual) public . . . . . . . . . . . . . TestSuite ()
public static . . . . . void assertEquals (String message, [double|float] expected, public . . . . . . . . . . . . TestSuite (Class theClass)
[double|float] actual, [double|float] delta) public . . . . . . . . . . . . . TestSuite (String name)
public static . . . . . . void assertEquals ([double|float] expected, [double|float] actual, public . . . . . . . . String toString ()
[double|float] delta)
public static . . . . . void assertEquals (String message, TestDecorator junit.extensions
[boolean|byte|char|int|long|short] expected, Object
[boolean|byte|char|int|long|short] actual) junit.framework.Assert
public static . . . . . . void assertEquals ([boolean|byte|char|int|long|short] expected, TestDecorator junit.framework.Test
[boolean|byte|char|int|long|short] actual)
public static . . . . . void assertNotNull (String message, Object object) 28 static methods from Assert not shown
public static . . . . . . void assertNotNull (Object object) public . . . . . . . . . . void basicRun (junit.framework.TestResult result)
public static . . . . . void assertNull (String message, Object object) public . . . . . . . . . . int countTestCases ()
public static . . . . . . void assertNull (Object object) protected . . . . . . . . . . fTest
public static . . . . . void assertSame (String message, . . . junit.framework.Test
Object expected, Object actual) public . . . . . . . . . . . . getTest ()
public static . . . . . . void assertSame (Object expected, Object actual) . . . junit.framework.Test
public static . . . . . void assertTrue (String message, boolean condition) public . . . . . . . . . . void run (junit.framework.TestResult result)
public static . . . . . . void assertTrue (boolean condition) public . . . . . . . . . . . . TestDecorator (junit.framework.Test test)
public static . . . . . void fail (String message) public . . . . . . . . .String toString ()
public static . . . . . . void fail ()
Test Template
Test (interface) junit.framework import junit.framework.*;
Test
public . . . . . . . . . . int countTestCases () public class TestTemplate extends TestCase {
public . . . . . . . . . . void run (TestResult result) //Variables, inner classes used by tests

TestCase (abstract) junit.framework public static Test suite () { return new TestSuite(TestTemplate.class); }
Object public TestTemplate (String name) { super(name); }
Assert
TestCase Test protected void setUp () { /* Code to set up a fresh scaffold for each test */ }
protected void tearDown () { /* Code to destroy the scaffold after each test */ }
28 static methods from Assert not shown
public void testSomething () { /* do something and assert success */ }
public . . . . . . . . . . int countTestCases ()
// other test methods
protected . . .TestResult createResult ()
}
public . . . . . . . . String getName ()
public . . . . . . . . .String name ()
public . . . . . TestResult run ()
public . . . . . . . . . . void run (TestResult result)
public . . . . . . . . . void runBare ()
protected . . . . . . . void runTest ()
public . . . . . . . . . void setName (String name)
protected . . . . . . . void setUp ()
protected . . . . . . . void tearDown () www.delphis.com
public . . . . . . . . . . . . . TestCase (String name) Covers JUnit 3.7. Please send questions and comments to junit@delphis.com.
public . . . . . . . . String toString () Copyright °
c 2001, 2002 Delphi Consultants, LLC. ALL RIGHTS RESERVED.
Acknowledgment to Patrick Chan for the class reference format used on this card.
JUnit Quick Reference TestSuite junit.framework
Object
Assert junit.framework TestSuite Test
Object 6 rarely used methods not shown
Assert public . . . . . . . . . . void addTest (Test test)
protected . . . . . . . . . . Assert () public . . . . . . . . . void addTestSuite (Class testClass)
public static . . . . . void assertEquals (String message, public . . . . . . . . . . void run (TestResult result)
Object expected, Object actual) public . . . .Enumeration tests ()
public static . . . . . . void assertEquals (Object expected, Object actual) public . . . . . . . . . . . . . TestSuite ()
public static . . . . . void assertEquals (String message, [double|float] expected, public . . . . . . . . . . . . TestSuite (Class theClass)
[double|float] actual, [double|float] delta) public . . . . . . . . . . . . . TestSuite (String name)
public static . . . . . . void assertEquals ([double|float] expected, [double|float] actual, public . . . . . . . . String toString ()
[double|float] delta)
public static . . . . . void assertEquals (String message, TestDecorator junit.extensions
[boolean|byte|char|int|long|short] expected, Object
[boolean|byte|char|int|long|short] actual) junit.framework.Assert
public static . . . . . . void assertEquals ([boolean|byte|char|int|long|short] expected, TestDecorator junit.framework.Test
[boolean|byte|char|int|long|short] actual)
public static . . . . . void assertNotNull (String message, Object object) 28 static methods from Assert not shown
public static . . . . . . void assertNotNull (Object object) public . . . . . . . . . . void basicRun (junit.framework.TestResult result)
public static . . . . . void assertNull (String message, Object object) public . . . . . . . . . . int countTestCases ()
public static . . . . . . void assertNull (Object object) protected . . . . . . . . . . fTest
public static . . . . . void assertSame (String message, . . . junit.framework.Test
Object expected, Object actual) public . . . . . . . . . . . . getTest ()
public static . . . . . . void assertSame (Object expected, Object actual) . . . junit.framework.Test
public static . . . . . void assertTrue (String message, boolean condition) public . . . . . . . . . . void run (junit.framework.TestResult result)
public static . . . . . . void assertTrue (boolean condition) public . . . . . . . . . . . . TestDecorator (junit.framework.Test test)
public static . . . . . void fail (String message) public . . . . . . . . .String toString ()
public static . . . . . . void fail ()
Test Template
Test (interface) junit.framework import junit.framework.*;
Test
public . . . . . . . . . . int countTestCases () public class TestTemplate extends TestCase {
public . . . . . . . . . . void run (TestResult result) //Variables, inner classes used by tests
TestCase (abstract) junit.framework public static Test suite () { return new TestSuite(TestTemplate.class); }
Object public TestTemplate (String name) { super(name); }
Assert
TestCase Test protected void setUp () { /* Code to set up a fresh scaffold for each test */ }
protected void tearDown () { /* Code to destroy the scaffold after each test */ }
28 static methods from Assert not shown
public void testSomething () { /* do something and assert success */ }
public . . . . . . . . . . int countTestCases ()
// other test methods
protected . . .TestResult createResult ()
}
public . . . . . . . . String getName ()
public . . . . . . . . .String name ()
public . . . . . TestResult run ()
public . . . . . . . . . . void run (TestResult result)
public . . . . . . . . . void runBare ()
protected . . . . . . . void runTest ()
public . . . . . . . . . void setName (String name)
protected . . . . . . . void setUp ()
protected . . . . . . . void tearDown () www.delphis.com
public . . . . . . . . . . . . . TestCase (String name) Covers JUnit 3.7. Please send questions and comments to junit@delphis.com.
c 2001, 2002 Delphi Consultants, LLC. ALL RIGHTS RESERVED.
Copyright °
public . . . . . . . . String toString ()
Acknowledgment to Patrick Chan for the class reference format used on this card.