org.apache.cactus.internal.server.runner
Class WebappTestRunner

java.lang.Object
  extended by junit.runner.BaseTestRunner
      extended by org.apache.cactus.internal.server.runner.WebappTestRunner
All Implemented Interfaces:
junit.framework.TestListener

public class WebappTestRunner
extends junit.runner.BaseTestRunner

JUnit Test Runner that can load test cases that are in the classpath of a webapp. This test runner is supposed to be executed from within the webapp.

Version:
$Id: WebappTestRunner.java 238991 2004-05-22 11:34:50Z vmassol $

Field Summary
 
Fields inherited from class junit.runner.BaseTestRunner
SUITE_METHODNAME
 
Constructor Summary
WebappTestRunner()
           
 
Method Summary
 void addError(junit.framework.Test theTest, java.lang.Throwable theThrowable)
          
 void addFailure(junit.framework.Test theTest, junit.framework.AssertionFailedError theAssertionFailedError)
          
 void endTest(junit.framework.Test theTest)
          
 java.lang.String getErrorMessage()
           
 java.lang.Class loadSuiteClass(java.lang.String theSuiteClassName)
          Returns the loaded Class for a suite name.
protected  void runFailed(java.lang.String theMessage)
          Event called by the base test runner when it fails to load a test suite.
 void startTest(junit.framework.Test theTest)
          
 void testEnded(java.lang.String theTestName)
          Event called by the base test runner when the test ends.
 void testFailed(int theStatus, junit.framework.Test theTest, java.lang.Throwable theThrowable)
          Event called by the base test runner when the test fails.
 void testStarted(java.lang.String theTestName)
          Event called by the base test runner when the test starts.
 
Methods inherited from class junit.runner.BaseTestRunner
clearStatus, elapsedTimeAsString, extractClassName, getFilteredTrace, getFilteredTrace, getLoader, getPreference, getPreference, getPreferences, getTest, inMac, inVAJava, processArguments, savePreferences, setLoading, setPreference, setPreferences, showStackRaw, truncate, useReloadingTestSuiteLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebappTestRunner

public WebappTestRunner()
Method Detail

loadSuiteClass

public java.lang.Class loadSuiteClass(java.lang.String theSuiteClassName)
                               throws java.lang.ClassNotFoundException
Returns the loaded Class for a suite name.

Overrides:
loadSuiteClass in class junit.runner.BaseTestRunner
Throws:
java.lang.ClassNotFoundException

runFailed

protected void runFailed(java.lang.String theMessage)
Event called by the base test runner when it fails to load a test suite.

Specified by:
runFailed in class junit.runner.BaseTestRunner
Parameters:
theMessage - the message of the failure

getErrorMessage

public java.lang.String getErrorMessage()
Returns:
the error message provided by BaseTestRunner if it failed to load the test suite

testEnded

public void testEnded(java.lang.String theTestName)
Event called by the base test runner when the test ends.

Specified by:
testEnded in class junit.runner.BaseTestRunner
Parameters:
theTestName - the test case name

testFailed

public void testFailed(int theStatus,
                       junit.framework.Test theTest,
                       java.lang.Throwable theThrowable)
Event called by the base test runner when the test fails.

Specified by:
testFailed in class junit.runner.BaseTestRunner
Parameters:
theStatus - the status code of the error
theTest - the test object that failed
theThrowable - the exception that was thrown

testStarted

public void testStarted(java.lang.String theTestName)
Event called by the base test runner when the test starts.

Specified by:
testStarted in class junit.runner.BaseTestRunner
Parameters:
theTestName - the test case name

addError

public void addError(junit.framework.Test theTest,
                     java.lang.Throwable theThrowable)

Specified by:
addError in interface junit.framework.TestListener
Overrides:
addError in class junit.runner.BaseTestRunner
See Also:
BaseTestRunner.addError(Test, Throwable)

addFailure

public void addFailure(junit.framework.Test theTest,
                       junit.framework.AssertionFailedError theAssertionFailedError)

Specified by:
addFailure in interface junit.framework.TestListener
Overrides:
addFailure in class junit.runner.BaseTestRunner
See Also:
BaseTestRunner.addFailure(Test, AssertionFailedError)

endTest

public void endTest(junit.framework.Test theTest)

Specified by:
endTest in interface junit.framework.TestListener
Overrides:
endTest in class junit.runner.BaseTestRunner
See Also:
BaseTestRunner.endTest(Test)

startTest

public void startTest(junit.framework.Test theTest)

Specified by:
startTest in interface junit.framework.TestListener
Overrides:
startTest in class junit.runner.BaseTestRunner
See Also:
BaseTestRunner.startTest(Test)


Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.