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

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.ibm.team.fvt.tests.scenario.ScenarioStep
All Implemented Interfaces:
junit.framework.Test

public class ScenarioStep
extends junit.framework.TestCase

Manage a list of tests to execute in a scenario step.

Scenario may have several steps usually defines in a subclass of Scenario.

The step provides easy access to configuration information through its ScenarioRun stored instance.

This step is connected to a web page. The page might be stored by the step when loaded. If so, it's given to the ScenarioRun to allow next test or step to have the last page used by previous step in hand when starting.

The step also stores all workaround used during the tests and can provide information about them.

Design: To be finalized


Constructor Summary
ScenarioStep()
           
 
Method Summary
 java.lang.String getStepName()
          Return the step name of the current BVT running test case.
 void runTest()
          Override JUnit framework execution in order to take a snapshot when a failure occurs during the test run.
 void setName(java.lang.String name)
          Override to store our own test name.
 void setRun(ScenarioRun run)
          Store the scenario run.
 void setUp()
          Override the default set up command.
 void setUpSuite()
          Common set up for each scenario step.
 void takeSnapshotFailure()
          Takes a failure snapshot.
 void takeSnapshotInfo(java.lang.String title)
          Takes a graph snapshot.
 void takeSnapshotWarning()
          Takes a warning snapshot.
 void tearDownSuite()
          Common tear down for each scenario step.
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScenarioStep

public ScenarioStep()
Method Detail

getStepName

public java.lang.String getStepName()
Return the step name of the current BVT running test case.

The step name is the name of the current test suite without the package name.

Returns:
The step name as a String of the current running test.

runTest

public void runTest()
             throws java.lang.Throwable
Override JUnit framework execution in order to take a snapshot when a failure occurs during the test run.

It also display any workaround which has been used in the meanwhile.

Design Needs finalization

Overrides:
runTest in class junit.framework.TestCase
Throws:
java.lang.Throwable

setName

public void setName(java.lang.String name)
Override to store our own test name.

Overrides:
setName in class junit.framework.TestCase
Parameters:
name - The name of the test case.

setRun

public void setRun(ScenarioRun run)
Store the scenario run.

Parameters:
run - The scenario run for the current step

setUp

public void setUp()
           throws java.lang.Exception
Override the default set up command.

Overrides:
setUp in class junit.framework.TestCase
Throws:
java.lang.Exception

setUpSuite

public void setUpSuite()
Common set up for each scenario step.

The default is to display the step title and the time at which it has been started. Can be overriden if necessary.

See Also:
ScenarioUtils.printStepStart(ScenarioStep)

takeSnapshotFailure

public void takeSnapshotFailure()
Takes a failure snapshot.


takeSnapshotInfo

public void takeSnapshotInfo(java.lang.String title)
Takes a graph snapshot.

Parameters:
title - The title to display in the console when taking the snapshot

takeSnapshotWarning

public void takeSnapshotWarning()
Takes a warning snapshot.


tearDownSuite

public void tearDownSuite()
Common tear down for each scenario step.

The default is to do nothing. Can be overridden if necessary.