org.drools.testframework
Class ScenarioRunner

java.lang.Object
  extended by org.drools.testframework.ScenarioRunner

public class ScenarioRunner
extends Object

This actually runs the test scenarios.


Constructor Summary
ScenarioRunner(Scenario scenario, org.drools.base.TypeResolver resolver, org.drools.common.InternalWorkingMemory wm)
          This constructor is normally used by Guvnor for running tests on a users request.
ScenarioRunner(String xml, org.drools.RuleBase ruleBase)
          Use this constructor if you have a scenario in a file, for instance.
 
Method Summary
 HashSet<String> getImports(org.drools.rule.Package aPackage)
           
 boolean wasSuccess()
          True if the scenario was run with 100% success.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScenarioRunner

public ScenarioRunner(Scenario scenario,
                      org.drools.base.TypeResolver resolver,
                      org.drools.common.InternalWorkingMemory wm)
               throws ClassNotFoundException,
                      InvocationTargetException,
                      NoSuchMethodException,
                      InstantiationException,
                      IllegalAccessException
This constructor is normally used by Guvnor for running tests on a users request.

Parameters:
scenario - The scenario to run.
resolver - A populated type resolved to be used to resolve the types in the scenario.

For info on how to invoke this, see ContentPackageAssemblerTest.testPackageWithRuleflow in guvnor-webapp This requires that the classloader for the thread context be set appropriately. The PackageBuilder can provide a suitable TypeResolver for a given package header, and the Package config can provide a classloader.

Throws:
ClassNotFoundException
InvocationTargetException
NoSuchMethodException
InstantiationException
IllegalAccessException

ScenarioRunner

public ScenarioRunner(String xml,
                      org.drools.RuleBase ruleBase)
               throws ClassNotFoundException,
                      InvocationTargetException,
                      NoSuchMethodException,
                      InstantiationException,
                      IllegalAccessException
Use this constructor if you have a scenario in a file, for instance.

Throws:
ClassNotFoundException
InvocationTargetException
NoSuchMethodException
InstantiationException
IllegalAccessException
Method Detail

getImports

public HashSet<String> getImports(org.drools.rule.Package aPackage)

wasSuccess

public boolean wasSuccess()
True if the scenario was run with 100% success.



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