TPTP 4.4.0 Testing Tools Project
Public API Specification

org.eclipse.hyades.test.common.junit
Class HyadesTestRunner

java.lang.Object
  extended byorg.eclipse.hyades.test.common.runner.HyadesRunner
      extended byorg.eclipse.hyades.test.common.junit.HyadesTestRunner
All Implemented Interfaces:
junit.framework.TestListener
Direct Known Subclasses:
HyadesJUnitRunner

public class HyadesTestRunner
extends HyadesRunner
implements junit.framework.TestListener

Since:
1.0.1

Nested Class Summary
protected static class HyadesTestRunner.Invocation
          Describes an invocation element in the parent stack.
protected static class HyadesTestRunner.Loop
          Describes a loop in the parent stack.
protected static interface HyadesTestRunner.ParentObject
          Describes an element in the parent stack.
protected static class HyadesTestRunner.RootObject
          Describes the root of the parent stack.
 
Nested classes inherited from class org.eclipse.hyades.test.common.runner.HyadesRunner
HyadesRunner.Commandhandler
 
Field Summary
protected static boolean SYSOUT
           
 
Fields inherited from class org.eclipse.hyades.test.common.runner.HyadesRunner
agent, AGENT_NAME, agentCollection, agentName, comptestAgent, TEST_CLASS, TEST_CLASS_INDEX, TEST_ID, TEST_ID_INDEX, testClass, testID
 
Constructor Summary
HyadesTestRunner()
          Constructor for HyadesTestRunner
HyadesTestRunner(org.eclipse.hyades.internal.execution.remote.RemoteComponentSkeleton agent)
           
HyadesTestRunner(java.lang.String[] args)
           
HyadesTestRunner(java.lang.String[] args, java.util.Vector commandHandler)
           
 
Method Summary
protected  java.lang.String _peekParentEventID()
           
protected  java.lang.String _peekParentEventID(java.lang.Integer threadID)
           
protected  HyadesTestRunner.ParentObject _popParentObject()
           
protected  void _pushParentObject(HyadesTestRunner.ParentObject object)
           
 void _seedParentStack(java.lang.Thread t)
           
 void addError(junit.framework.Test test, java.lang.Throwable throwable)
           
 void addFailure(junit.framework.Test test, junit.framework.AssertionFailedError throwable)
           
protected  java.lang.String appendLoopIterationToID(java.lang.String ID, IHyadesTest parentTest)
           
protected  java.lang.String computeVerdictId(java.lang.String parentId)
           
protected  junit.framework.TestResult createTestResult()
          Creates the TestResult to be used for the test run.
 void endTest(junit.framework.Test test)
           
protected  java.util.Collection filterTests(junit.framework.Test parent, java.util.Collection tests)
          Deprecated. This method does not work properly when tests contains non-TPTP JUnit tests (i.e. tests that do not implement IHyadesTest). Use HyadesTestRunner.Invocation instances from the stack getParentStack() to determine which tests are direct children of a given parent.
protected  long getCurrentTime()
          Returns the current timestamp.
protected  VerdictEvent getDefaultVerdictEvent(junit.framework.Test test)
          Deprecated. Use getDefaultVerdictEvent(Test, org.eclipse.hyades.test.common.junit.HyadesTestRunner.Invocation) instead.
protected  VerdictEvent getDefaultVerdictEvent(junit.framework.Test test, HyadesTestRunner.Invocation parent)
          Returns the default verdict event, which is pass for test cases and the arbiter evaluation for test suites.
 java.util.Collection getErrorTests()
          Returns a collection with the hirarchy ids of the test cases that have ended because of an error.
 java.util.Collection getFailureTests()
          Returns a collection with the hirarchy ids of the test cases that have ended because of a failure.
protected  java.lang.String getLastEventText(boolean runnerStopped, long elapsedTime)
           
static java.util.Stack getParentStack()
           
static java.lang.Integer getParentThreadID(java.lang.Integer i)
           
static java.lang.Integer getParentThreadID(java.lang.Thread t)
           
 junit.framework.Test getRoot()
          Returns the root test, ie. the test that is passed to this runner.
 java.util.Collection getSucceedTests()
          Returns a collection with the hirarchy ids of the test cases that have been succeed.
protected static java.lang.String getTestName(junit.framework.Test test)
           
protected  boolean isRedundantVerdict(junit.framework.Test test, HyadesTestRunner.Invocation parent)
           
static java.lang.String peekParentEventID()
          Deprecated. Use the non-static method _peekParentEventID() instead.
static java.lang.String peekParentEventID(java.lang.Integer threadID)
          Deprecated. Use the non-static method _peekParentEventID(Integer) instead.
protected  HyadesTestRunner.Invocation peekParentInvocation()
           
protected  HyadesTestRunner.Invocation peekParentInvocation(java.lang.Integer threadID)
           
protected  HyadesTestRunner.ParentObject peekParentObject()
           
protected  HyadesTestRunner.ParentObject peekParentObject(java.lang.Integer threadID)
           
static HyadesTestRunner.ParentObject popParentObject()
          Deprecated. Use the non-static method _popParentObject() instead.
protected  void propagateVerdict(junit.framework.Test test, VerdictEvent event)
           
static void pushParentObject(HyadesTestRunner.ParentObject object)
          Deprecated. Use the non-static method _pushParentObject(org.eclipse.hyades.test.common.junit.HyadesTestRunner.ParentObject) instead.
 void run(java.lang.Class testClass)
          Runs a suite extracted from a TestCase subclass.
 void run(junit.framework.Test test)
          Runs a single test and collects its results.
protected  void runnerExit(boolean runnerStopped, long elapsedTime)
          The runner is up to finish its activities.
protected  void runnerStarted()
          The runner has started.
static void seedParentStack(java.lang.Thread t)
          Deprecated. Use the non-static method _seedParentStack(Thread) instead.
static void setParentStack(java.util.Stack parentStack)
           
static void setParentThread(java.lang.Thread child, java.lang.Thread parent)
           
protected  void setRoot(junit.framework.Test root)
          Sets the root test, ie. the test that is passed to this runner.
 void startTest(junit.framework.Test test)
           
protected  void writeEvent(ExecutionEvent executionEvent)
          Writes an event.
 
Methods inherited from class org.eclipse.hyades.test.common.runner.HyadesRunner
dispose, getAgent, handleCustomCommand, isOKToStart, setOKToStart, setRunnerProperties, writeExecEvent, writeExecEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SYSOUT

protected static final boolean SYSOUT
See Also:
Constant Field Values
Constructor Detail

HyadesTestRunner

public HyadesTestRunner()
Constructor for HyadesTestRunner


HyadesTestRunner

public HyadesTestRunner(org.eclipse.hyades.internal.execution.remote.RemoteComponentSkeleton agent)

HyadesTestRunner

public HyadesTestRunner(java.lang.String[] args)

HyadesTestRunner

public HyadesTestRunner(java.lang.String[] args,
                        java.util.Vector commandHandler)
Method Detail

setParentThread

public static void setParentThread(java.lang.Thread child,
                                   java.lang.Thread parent)

getParentThreadID

public static java.lang.Integer getParentThreadID(java.lang.Thread t)

getParentThreadID

public static java.lang.Integer getParentThreadID(java.lang.Integer i)

getParentStack

public static java.util.Stack getParentStack()

setParentStack

public static void setParentStack(java.util.Stack parentStack)

peekParentEventID

public static java.lang.String peekParentEventID()
Deprecated. Use the non-static method _peekParentEventID() instead.


_peekParentEventID

protected java.lang.String _peekParentEventID()
Since:
4.2

peekParentObject

protected HyadesTestRunner.ParentObject peekParentObject()
Since:
4.2

peekParentInvocation

protected HyadesTestRunner.Invocation peekParentInvocation()
Since:
4.2

peekParentEventID

public static java.lang.String peekParentEventID(java.lang.Integer threadID)
Deprecated. Use the non-static method _peekParentEventID(Integer) instead.


_peekParentEventID

protected java.lang.String _peekParentEventID(java.lang.Integer threadID)
Since:
4.2

peekParentObject

protected HyadesTestRunner.ParentObject peekParentObject(java.lang.Integer threadID)
Since:
4.2

peekParentInvocation

protected HyadesTestRunner.Invocation peekParentInvocation(java.lang.Integer threadID)
Since:
4.2

pushParentObject

public static void pushParentObject(HyadesTestRunner.ParentObject object)
Deprecated. Use the non-static method _pushParentObject(org.eclipse.hyades.test.common.junit.HyadesTestRunner.ParentObject) instead.


_pushParentObject

protected void _pushParentObject(HyadesTestRunner.ParentObject object)
Since:
4.2

popParentObject

public static HyadesTestRunner.ParentObject popParentObject()
Deprecated. Use the non-static method _popParentObject() instead.


_popParentObject

protected HyadesTestRunner.ParentObject _popParentObject()
Returns:
Since:
4.2

seedParentStack

public static void seedParentStack(java.lang.Thread t)
Deprecated. Use the non-static method _seedParentStack(Thread) instead.


_seedParentStack

public void _seedParentStack(java.lang.Thread t)
Since:
4.2

getRoot

public junit.framework.Test getRoot()
Returns the root test, ie. the test that is passed to this runner.

Returns:
Test

setRoot

protected void setRoot(junit.framework.Test root)
Sets the root test, ie. the test that is passed to this runner.

Parameters:
root -

getSucceedTests

public java.util.Collection getSucceedTests()
Returns a collection with the hirarchy ids of the test cases that have been succeed.

Returns:
Collection

getFailureTests

public java.util.Collection getFailureTests()
Returns a collection with the hirarchy ids of the test cases that have ended because of a failure.

Returns:
Collection

getErrorTests

public java.util.Collection getErrorTests()
Returns a collection with the hirarchy ids of the test cases that have ended because of an error.

Returns:
Collection

run

public void run(java.lang.Class testClass)
Runs a suite extracted from a TestCase subclass.

Parameters:
testClass -

run

public void run(junit.framework.Test test)
Runs a single test and collects its results. This method can be used to start a test run from your program.


createTestResult

protected junit.framework.TestResult createTestResult()
Creates the TestResult to be used for the test run.

Returns:
TestResult

getCurrentTime

protected long getCurrentTime()
Returns the current timestamp.

Returns:
long

runnerStarted

protected void runnerStarted()
The runner has started.


runnerExit

protected void runnerExit(boolean runnerStopped,
                          long elapsedTime)
The runner is up to finish its activities.

Parameters:
runnerStopped -

getLastEventText

protected java.lang.String getLastEventText(boolean runnerStopped,
                                            long elapsedTime)

startTest

public void startTest(junit.framework.Test test)
Specified by:
startTest in interface junit.framework.TestListener
See Also:
TestListener.startTest(junit.framework.Test)

getTestName

protected static java.lang.String getTestName(junit.framework.Test test)

endTest

public void endTest(junit.framework.Test test)
Specified by:
endTest in interface junit.framework.TestListener
See Also:
TestListener.endTest(junit.framework.Test)

propagateVerdict

protected void propagateVerdict(junit.framework.Test test,
                                VerdictEvent event)

getDefaultVerdictEvent

protected VerdictEvent getDefaultVerdictEvent(junit.framework.Test test,
                                              HyadesTestRunner.Invocation parent)
Returns the default verdict event, which is pass for test cases and the arbiter evaluation for test suites.

Parameters:
test -
Returns:
VerdictEvent

isRedundantVerdict

protected boolean isRedundantVerdict(junit.framework.Test test,
                                     HyadesTestRunner.Invocation parent)

getDefaultVerdictEvent

protected VerdictEvent getDefaultVerdictEvent(junit.framework.Test test)
Deprecated. Use getDefaultVerdictEvent(Test, org.eclipse.hyades.test.common.junit.HyadesTestRunner.Invocation) instead.

Returns the default verdict event, which is pass for test cases and the arbiter evaluation for test suites.

Parameters:
test -
Returns:
VerdictEvent

addError

public void addError(junit.framework.Test test,
                     java.lang.Throwable throwable)
Specified by:
addError in interface junit.framework.TestListener
See Also:
TestListener.addError(junit.framework.Test, java.lang.Throwable)

addFailure

public void addFailure(junit.framework.Test test,
                       junit.framework.AssertionFailedError throwable)
Specified by:
addFailure in interface junit.framework.TestListener
See Also:
TestListener.addFailure(junit.framework.Test, junit.framework.AssertionFailedError)

writeEvent

protected void writeEvent(ExecutionEvent executionEvent)
Writes an event.

Parameters:
executionEvent -

filterTests

protected java.util.Collection filterTests(junit.framework.Test parent,
                                           java.util.Collection tests)
Deprecated. This method does not work properly when tests contains non-TPTP JUnit tests (i.e. tests that do not implement IHyadesTest). Use HyadesTestRunner.Invocation instances from the stack getParentStack() to determine which tests are direct children of a given parent.

Filters and retains from a collection of tests, the tests are direct children of a parent test.

Parameters:
parent -
tests -
Returns:

computeVerdictId

protected java.lang.String computeVerdictId(java.lang.String parentId)

appendLoopIterationToID

protected java.lang.String appendLoopIterationToID(java.lang.String ID,
                                                   IHyadesTest parentTest)

TPTP 4.4.0 Testing Tools Project
Public API Specification