satin.testing
Class TestGroup

java.lang.Object
  |
  +--satin.testing.Test
        |
        +--satin.testing.TestComponent
              |
              +--satin.testing.TestGroup

public abstract class TestGroup
extends TestComponent

A group of Testcases. This is a simple mechanism for grouping together Testcase objects. It provides the following capabilities:

In your derived class, all you need to do is override the constructor, in which you will instantiate the contained ("child") test objects, adding each one to the list of child objects by calling the add method. When your test object is run by calling the run method, the execute method will iterate over the list of child tests in the order they were added, running each one by calling its run method. You need not override the execute method, though you can do so if you need more sophisticated behaviour.

Author:
Ed Stauff

Field Summary
protected final java.lang.String description
          The description string that was passed to the constructor.
final TestLog log
          The log for this test.
protected final java.util.Vector subTests
          The list of testcases contained by this test.
 
Fields inherited from class satin.testing.Test
lastException
 
Constructor Summary
TestGroup(TestLog log, java.lang.String description)
          The constructor.
 
Method Summary
void add(Testcase t)
          Adds a testcase to this group.
protected boolean continueOnFailure(TestComponent failedTest)
          Returns whether to continue the test if a testcase fails.
protected void execute()
          This method calls run on on each of the testcases, in the order they were added.
final TestLog getLog()
          Returns the log file.
 
Methods inherited from class satin.testing.Test
cleanup, doCleanup, doExecute, doSetup, doVerify, run, setup, verify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public final TestLog log
The log for this test. All test output should be directed to this log. You can use this field or the getLog method interchangeably.

subTests

protected final java.util.Vector subTests
The list of testcases contained by this test.

description

protected final java.lang.String description
The description string that was passed to the constructor.
Constructor Detail

TestGroup

public TestGroup(TestLog log,
                 java.lang.String description)
The constructor.

Parameters:
log
the log for the test.
description
an identifier or brief description for the test group.
Method Detail

add

public void add(Testcase t)
Adds a testcase to this group. You typically call this method in the constructor of your test class derived from TestGroup.

Parameters:
t
the testcase to be added.

execute

protected void execute()
                throws java.lang.Exception
This method calls run on on each of the testcases, in the order they were added.

Overrides:
execute in class Test

continueOnFailure

protected boolean continueOnFailure(TestComponent failedTest)
Returns whether to continue the test if a testcase fails. This method returns true by default; override it if you want it to return false.

Parameters:
failedTest
the test that failed.

getLog

public final TestLog getLog()
Returns the log file. This method must never return null. All test output should be directed to this log. You can use this method or the log field interchangeably.

Overrides:
getLog in class Test
Revision History

7/31/01 Ed Stauff - made changes per code review.

5/21/01 Ed Stauff - removed overridden run method.

5/15/01 Ed Stauff - changes per 2nd API review.

4/10/01 - added TestComponent class.

3/22/01 - API reviewed by Test Automation team.



Generated on 5/9/2001 19:37 from TestGroup.java (PRIVATE SOURCES)