com.ibm.team.fvt.tests.scenario
Class Scenario

java.lang.Object
  extended by junit.framework.TestSuite
      extended by com.ibm.team.fvt.tests.scenario.Scenario
All Implemented Interfaces:
junit.framework.Test

public class Scenario
extends junit.framework.TestSuite

A test suite representing a scenario.

Extends TestSuite to add several functionalities:

  1. Filters test cases when ScenarioRun.RUN_TEST_ID parameter is set
  2. Propagate scenario run information to each scenario step
  3. Invoke ScenarioStep.setUpSuite() method before running the first test case of a scenario step
  4. Invoke ScenarioStep.tearDownSuite() method after having run the last test case of a scenario step
  5. Manages the scenario execution when a failure occurs.
    By default the scenario will always stop as soon as a failure occurs. That allow to resume it more safely. If this behavior needs to be changed, then stopOnFailure has to be set to true using Scenario(Class, boolean) constructor.


Constructor Summary
Scenario()
           
Scenario(java.lang.Class<? extends junit.framework.TestCase> clazz)
           
Scenario(java.lang.Class<? extends junit.framework.TestCase> clazz, boolean stopOnFailure)
           
 
Method Summary
 void addTestSuite(java.lang.Class<? extends junit.framework.TestCase> testClass)
           
 void runTest(junit.framework.Test test, junit.framework.TestResult result)
          Overrides super implementation in order to: Propagate the scenario run information just after having built the JUnit tests hierarchy Call the ScenarioStep.setUpSuite() method at the beginning of the test suite run Manage the execution continuation in case of test failure Call the ScenarioStep.tearDownSuite() method at the end of the test suite run Ends properly the scenario run (see ScenarioRun.tearDown())
 
Methods inherited from class junit.framework.TestSuite
addTest, countTestCases, createTest, getName, getTestConstructor, run, setName, testAt, testCount, tests, toString, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Scenario

public Scenario()

Scenario

public Scenario(java.lang.Class<? extends junit.framework.TestCase> clazz)

Scenario

public Scenario(java.lang.Class<? extends junit.framework.TestCase> clazz,
                boolean stopOnFailure)
Method Detail

addTestSuite

public void addTestSuite(java.lang.Class<? extends junit.framework.TestCase> testClass)
Overrides:
addTestSuite in class junit.framework.TestSuite

runTest

public void runTest(junit.framework.Test test,
                    junit.framework.TestResult result)
Overrides super implementation in order to:
  1. Propagate the scenario run information just after having built the JUnit tests hierarchy
  2. Call the ScenarioStep.setUpSuite() method at the beginning of the test suite run
  3. Manage the execution continuation in case of test failure
  4. Call the ScenarioStep.tearDownSuite() method at the end of the test suite run
  5. Ends properly the scenario run (see ScenarioRun.tearDown())

Overrides:
runTest in class junit.framework.TestSuite