org.drools.ide.common.client.modeldriven.testing
Class Scenario

java.lang.Object
  extended by org.drools.ide.common.client.modeldriven.testing.Scenario
All Implemented Interfaces:
Serializable, PortableObject

public class Scenario
extends Object
implements PortableObject

This represents a test scenario. It also encapsulates the result of a scenario run.

See Also:
Serialized Form

Constructor Summary
Scenario()
           
 
Method Summary
 int[] countFailuresTotal()
           
protected  boolean fieldExpectationFailed(VerifyField verifyField)
           
 List<String> getFactNamesInScope(ExecutionTrace executionTrace, boolean includeGlobals)
          This will return a list of fact names that are in scope (including globals).
 Map<String,FactData> getFactTypes()
           
 Map<String,List<FactData>> getFactTypesToFactData()
           
 List<Fixture> getFixtures()
           
 List<FactData> getGlobals()
           
 Date getLastRunResult()
           
 int getMaxRuleFirings()
           
 List<String> getRules()
           
 Map<String,String> getVariableTypes()
           
 void insertBetween(Fixture fixtureBeforeTheNewOne, Fixture newFixture)
          Will slip in a fixture after the specified one, but before the next execution trace.
 boolean isFactDataReferenced(FactData factData)
           
 boolean isFactNameReserved(String factName)
           
protected  boolean isFactNameUsedInFactDataFixtures(String factName)
           
protected  boolean isFactNameUsedInGlobals(String factName)
           
 boolean isInclusive()
           
 void removeExecutionTrace(ExecutionTrace executionTrace)
          Remove fixtures between this ExecutionTrace and the previous one.
 void removeFixture(Fixture f)
          Remove the specified fixture.
protected  boolean ruleFailedToFire(VerifyRuleFired verifyRuleFired)
           
 void setInclusive(boolean inclusive)
           
 void setLastRunResult(Date lastRunResult)
           
 boolean wasSuccessful()
          Returns true if this was a totally successful scenario, based on the results contained.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Scenario

public Scenario()
Method Detail

wasSuccessful

public boolean wasSuccessful()
Returns true if this was a totally successful scenario, based on the results contained.


insertBetween

public void insertBetween(Fixture fixtureBeforeTheNewOne,
                          Fixture newFixture)
Will slip in a fixture after the specified one, but before the next execution trace.


removeFixture

public void removeFixture(Fixture f)
Remove the specified fixture.


removeExecutionTrace

public void removeExecutionTrace(ExecutionTrace executionTrace)
Remove fixtures between this ExecutionTrace and the previous one.


getFactTypes

public Map<String,FactData> getFactTypes()
Returns:
A mapping of variable names to their fact data.

getVariableTypes

public Map<String,String> getVariableTypes()
Returns:
A mapping of variable names to their fact type.

getFactTypesToFactData

public Map<String,List<FactData>> getFactTypesToFactData()
Returns:
A mapping of Fact types to their Fact definitions.

getFactNamesInScope

public List<String> getFactNamesInScope(ExecutionTrace executionTrace,
                                        boolean includeGlobals)
This will return a list of fact names that are in scope (including globals).

Returns:
List

isFactNameReserved

public boolean isFactNameReserved(String factName)
Returns:
true if a fact name is already in use.

isFactNameUsedInFactDataFixtures

protected boolean isFactNameUsedInFactDataFixtures(String factName)

isFactNameUsedInGlobals

protected boolean isFactNameUsedInGlobals(String factName)

isFactDataReferenced

public boolean isFactDataReferenced(FactData factData)
Returns:
true if a fact is actually used (ie if its not, its safe to remove it).

countFailuresTotal

public int[] countFailuresTotal()
Returns:
int[0] = failures, int[1] = total;

fieldExpectationFailed

protected boolean fieldExpectationFailed(VerifyField verifyField)

ruleFailedToFire

protected boolean ruleFailedToFire(VerifyRuleFired verifyRuleFired)

getFixtures

public List<Fixture> getFixtures()

getMaxRuleFirings

public int getMaxRuleFirings()

getGlobals

public List<FactData> getGlobals()

setLastRunResult

public void setLastRunResult(Date lastRunResult)

getLastRunResult

public Date getLastRunResult()

getRules

public List<String> getRules()

setInclusive

public void setInclusive(boolean inclusive)

isInclusive

public boolean isInclusive()


Copyright © 2001-2012 JBoss by Red Hat. All Rights Reserved.