junit.extensions.jfunc
Class JFuncTestCase

java.lang.Object
  |
  +--junit.extensions.jfunc.JFuncAssert
        |
        +--junit.extensions.jfunc.VerboseAssert
              |
              +--junit.extensions.jfunc.JFuncTestCase
All Implemented Interfaces:
java.lang.Cloneable, junit.framework.Test
Direct Known Subclasses:
JFuncTest.InnerTest, OrderedTest, SimpleTest, SuiteConstruction, SweetSuite

public abstract class JFuncTestCase
extends VerboseAssert
implements junit.framework.Test, java.lang.Cloneable

JFuncTestCase works the same as TestCase for most purposes, but it uses JFunc's assert classes which allow for other features like multiple failures and verbose assertions.

See Also:
TestCase, JFuncResult, JFuncSuite

Fields inherited from class junit.extensions.jfunc.JFuncAssert
result
 
Constructor Summary
JFuncTestCase()
          No-arg constructor to enable serialization.
JFuncTestCase(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  junit.framework.TestResult createResult()
          Creates a default TestResult object
 java.lang.String getName()
          Gets the name of a TestCase
 java.lang.String name()
          Deprecated. use getName()
 junit.framework.TestResult run()
          A convenience method to run this test, collecting the results with a default TestResult object.
 void run(junit.framework.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.
static java.lang.String shortName(java.lang.Class cl)
           
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.extensions.jfunc.VerboseAssert
vassert, vassert, vassert, vassert, vassert, vassert
 
Methods inherited from class junit.extensions.jfunc.JFuncAssert
assert, assert, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, getResult, getTest, isFatal, setFatal, setResult, setTest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JFuncTestCase

public JFuncTestCase()
No-arg constructor to enable serialization. This method is not intended to be used by mere mortals.

JFuncTestCase

public JFuncTestCase(java.lang.String name)
Constructs a test case with the given name.
Method Detail

countTestCases

public int countTestCases()
Counts the number of test cases executed by run(TestResult result).
Specified by:
countTestCases in interface junit.framework.Test

createResult

protected junit.framework.TestResult createResult()
Creates a default TestResult object
See Also:
TestResult

name

public java.lang.String name()
Deprecated. use getName()

Gets the name of the test case.

run

public junit.framework.TestResult run()
A convenience method to run this test, collecting the results with a default TestResult object.
See Also:
TestResult

run

public void run(junit.framework.TestResult result)
Runs the test case and collects the results in TestResult.
Specified by:
run in interface junit.framework.Test

runBare

public void runBare()
             throws java.lang.Throwable
Runs the bare test sequence.
Throws:
java.lang.Throwable - if any exception is thrown

runTest

protected void runTest()
                throws java.lang.Throwable
Override to run the test and assert its state.
Throws:
java.lang.Throwable - if any exception is thrown

setUp

protected void setUp()
              throws java.lang.Exception
Sets up the fixture, for example, open a network connection. This method is called before a test is executed.

tearDown

protected void tearDown()
                 throws java.lang.Exception
Tears down the fixture, for example, close a network connection. This method is called after a test is executed.

toString

public java.lang.String toString()
Returns a string representation of the test case
Overrides:
toString in class java.lang.Object

shortName

public static java.lang.String shortName(java.lang.Class cl)

getName

public java.lang.String getName()
Gets the name of a TestCase
Returns:
returns a String (may be null in the case where proxies are used)

setName

public void setName(java.lang.String name)
Sets the name of a TestCase
Parameters:
name - The name to set