org.apache.cactus
Class AbstractTestSuite
java.lang.Object
org.apache.cactus.AbstractTestSuite
- All Implemented Interfaces:
- junit.framework.Test
- Direct Known Subclasses:
- ServletTestSuite
- public abstract class AbstractTestSuite
- extends java.lang.Object
- implements junit.framework.Test
Test Suite that wraps all the tests of the suite in Cactus Test Case
objects so that pure JUnit tests can be run on the server side.
- Since:
- 1.5
- Version:
- $Id: AbstractTestSuite.java,v 1.6 2003/07/12 16:08:12 vmassol Exp $
- Author:
- Vincent Massol
Method Summary |
void |
addTest(junit.framework.Test theTest)
|
void |
addTestSuite(java.lang.Class theTestClass)
|
int |
countTestCases()
|
protected abstract junit.framework.Test |
createCactusTestCase(java.lang.String theName,
junit.framework.Test theTest)
|
protected abstract junit.framework.Test |
createTestSuite(java.lang.Class theTestClass)
|
java.lang.String |
getName()
|
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(junit.framework.TestResult theResult)
|
void |
runTest(junit.framework.Test theTest,
junit.framework.TestResult theResult)
|
void |
setName(java.lang.String theName)
|
junit.framework.Test |
testAt(int theIndex)
|
int |
testCount()
|
java.util.Enumeration |
tests()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
AbstractTestSuite
public AbstractTestSuite()
- See Also:
TestSuite.TestSuite()
AbstractTestSuite
public AbstractTestSuite(java.lang.Class theClass)
- See Also:
TestSuite.TestSuite(Class)
AbstractTestSuite
public AbstractTestSuite(java.lang.String theName)
- See Also:
TestSuite.TestSuite(String)
addTest
public void addTest(junit.framework.Test theTest)
- See Also:
TestSuite.addTest(Test)
addTestSuite
public void addTestSuite(java.lang.Class theTestClass)
- See Also:
TestSuite.addTestSuite(Class)
countTestCases
public int countTestCases()
- Specified by:
countTestCases
in interface junit.framework.Test
- See Also:
TestSuite.countTestCases()
run
public void run(junit.framework.TestResult theResult)
- Specified by:
run
in interface junit.framework.Test
- See Also:
TestSuite.run(TestResult)
runTest
public void runTest(junit.framework.Test theTest,
junit.framework.TestResult theResult)
- See Also:
TestSuite.runTest(Test, TestResult)
testAt
public junit.framework.Test testAt(int theIndex)
- See Also:
TestSuite.testAt(int)
getTestConstructor
public static java.lang.reflect.Constructor getTestConstructor(java.lang.Class theClass)
throws java.lang.NoSuchMethodException
- Gets a constructor which takes a single String as
its argument or a no arg constructor.
- Parameters:
theClass
- the class for which to find the constructor
- Returns:
- the valid constructor found
- Throws:
java.lang.NoSuchMethodException
- if no valid constructor is
found
testCount
public int testCount()
- See Also:
TestSuite.testCount()
tests
public java.util.Enumeration tests()
- See Also:
TestSuite.tests()
toString
public java.lang.String toString()
- See Also:
TestSuite.toString()
setName
public void setName(java.lang.String theName)
- See Also:
TestSuite.setName(String)
getName
public java.lang.String getName()
- See Also:
TestSuite.getName()
createTestSuite
protected abstract junit.framework.Test createTestSuite(java.lang.Class theTestClass)
- Parameters:
theTestClass
- the test class containing the tests to be included
in the Cactus Test Suite
- Returns:
- a Cactus Test Suite (ex: ServletTestSuite) initialized with a
test class
createCactusTestCase
protected abstract junit.framework.Test createCactusTestCase(java.lang.String theName,
junit.framework.Test theTest)
- Parameters:
theName
- the name of the Cactus Test CasetheTest
- the wrapped test
- Returns:
- a Cactus Test Case object initialized with the give name and
wrapped test
Copyright © 2000-2003 Apache Software Foundation. All Rights Reserved.