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

java.lang.Object
  extended by com.ibm.team.fvt.tests.scenario.ScenarioExecution

public abstract class ScenarioExecution
extends java.lang.Object

Manage scenario execution.

This class is responsible to initialize and store the configuration and the data.

It also controls the scenario behavior when failure occurs using following arguments:

Another important thing done by this class is to store the current page to be able to pass it from test to test inside a scenario step and also from step to step inside the scenario. That allow easy transition between tests when a test ends on the same page where the following one starts.


Constructor Summary
ScenarioExecution()
           
 
Method Summary
 void addMandatoryTests(java.util.List<org.junit.runners.model.FrameworkMethod> tests)
          Add a list of mandatory tests.
 void finish()
          Ends the scenario execution.
 WebBrowser getBrowser()
          Return the browser used to run the scenario
 Config getConfig()
          Return the scenario configuration to use during the run.
 ScenarioData getData()
          Return the scenario data to use during the run.
 WebPage getPage()
          Return the current page.
 Topology getTopology()
          Return the scenario topology used during the run.
 boolean hasException()
           
 boolean isSingleStep()
           
 void runTest(org.junit.runners.model.Statement statement, org.junit.runners.model.FrameworkMethod frameworkMethod)
          Run the current test and take specific actions when some typical exception or error occurs (e.g.
 void setPage(WebPage page)
          Set the current scenario page.
 void setSingleStep(boolean singleStep)
           
 boolean shouldStop()
           
 void takeSnapshotFailure()
          Takes a failure snapshot.
 void takeSnapshotInfo(java.lang.String title)
          Takes a graph snapshot.
 void takeSnapshotWarning()
          Takes a warning snapshot.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScenarioExecution

public ScenarioExecution()
Method Detail

addMandatoryTests

public void addMandatoryTests(java.util.List<org.junit.runners.model.FrameworkMethod> tests)
Add a list of mandatory tests.

Parameters:
tests - The mandatory tests to add

finish

public void finish()
Ends the scenario execution.


getBrowser

public WebBrowser getBrowser()
Return the browser used to run the scenario

Returns:
The WebBrowser.

getConfig

public Config getConfig()
Return the scenario configuration to use during the run.

Returns:
The scenario Config.

getData

public ScenarioData getData()
Return the scenario data to use during the run.

Returns:
The scenario data as ScenarioData.

getPage

public WebPage getPage()
Return the current page.

Returns:
The web page as WebPage.

getTopology

public Topology getTopology()
Return the scenario topology used during the run.

Returns:
The scenario Topology.

hasException

public boolean hasException()
Returns:
the hasException

isSingleStep

public boolean isSingleStep()
Returns:
the singleStep

runTest

public void runTest(org.junit.runners.model.Statement statement,
                    org.junit.runners.model.FrameworkMethod frameworkMethod)
             throws java.lang.Throwable
Run the current test and take specific actions when some typical exception or error occurs (e.g. take a snapshot when a error occurs, retry when allowed).

Design Needs finalization

Throws:
java.lang.Throwable

setPage

public void setPage(WebPage page)
Set the current scenario page.


setSingleStep

public void setSingleStep(boolean singleStep)
Parameters:
singleStep - the singleStep to set

shouldStop

public boolean shouldStop()
Returns:
the shouldStop

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.


toString

public java.lang.String toString()

Return the current step.test names

Overrides:
toString in class java.lang.Object