org.apache.commons.cactus
Class AbstractTestCase

java.lang.Object
  |
  +--junit.framework.Assert
        |
        +--junit.framework.TestCase
              |
              +--org.apache.commons.cactus.AbstractTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
ServletTestCase

public abstract class AbstractTestCase
extends junit.framework.TestCase

Abstract class that specific test cases (ServletTestCase, FilterTestCase, ...) must extend. Provides generally useful methods fro writing a specific test case.

Version:
1.1

Field Summary
 java.lang.String currentTestMethod
          The name of the current test method being executed.
 
Constructor Summary
AbstractTestCase(java.lang.String theName)
          Constructs a JUnit test case with the given name.
 
Method Summary
 void runBare()
          Runs the bare test sequence.
 void runBareServerTest()
          Run the test that was specified in the constructor on the server side, calling setUp() and tearDown().
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, name, run, run, setName, toString
 
Methods inherited from class junit.framework.Assert
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
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentTestMethod

public java.lang.String currentTestMethod
The name of the current test method being executed. This name is valid both on the client side and on the server side, meaning you can call it from a testXXX(), setUp() or tearDown() method, as well as from beginXXX() and endXXX() methods.
Constructor Detail

AbstractTestCase

public AbstractTestCase(java.lang.String theName)
Constructs a JUnit test case with the given name.
Parameters:
theName - the name of the test case
Method Detail

runBare

public void runBare()
             throws java.lang.Throwable
Runs the bare test sequence. This method is overridden from the JUnit TestCase class in order to prevent the latter to call the setUp() and tearDown() methods which, in our case, need to be ran in the servlet engine by the servlet redirector class.
Overrides:
runBare in class junit.framework.TestCase
Throws:
java.lang.Throwable - if any exception is thrown

runBareServerTest

public void runBareServerTest()
                       throws java.lang.Throwable
Run the test that was specified in the constructor on the server side, calling setUp() and tearDown().


Copyright © 2000-2001 Apache Software Foundation. All Rights Reserved.