org.jactr.tools.test
Class ExecutionTester

java.lang.Object
  extended by org.jactr.tools.test.ExecutionTester

public class ExecutionTester
extends java.lang.Object

Utility class for ensuring that model's fire correctly

Author:
developer

Constructor Summary
ExecutionTester()
           
 
Method Summary
 void exceptionCaught(java.lang.Throwable thrown)
          called by the model listener so that Junit tests can handle the exception gracefully
 java.util.Collection<java.lang.Throwable> test(java.net.URL url, java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> productionSequenceMap, java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> failedProductionMap)
          test run.
 java.util.Collection<java.lang.Throwable> test(java.net.URL url, java.lang.String modelName, java.util.Collection<java.lang.String> productionSequence, java.util.Collection<java.lang.String> failedProductions)
           
 void verifyModelState(org.jactr.core.model.IModel model, org.jactr.core.production.IInstantiation instantiation)
          this can be overriden if you want to check the state of the model just after a production has fired
 void verifyThatProductionShouldFire(org.jactr.core.model.IModel model, org.jactr.core.production.IInstantiation instantiation)
          called by the proceduralModuleListener after each production fires
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutionTester

public ExecutionTester()
Method Detail

exceptionCaught

public void exceptionCaught(java.lang.Throwable thrown)
called by the model listener so that Junit tests can handle the exception gracefully

Parameters:
thrown -

verifyThatProductionShouldFire

public final void verifyThatProductionShouldFire(org.jactr.core.model.IModel model,
                                                 org.jactr.core.production.IInstantiation instantiation)
called by the proceduralModuleListener after each production fires

Parameters:
model -
instantiation -

verifyModelState

public void verifyModelState(org.jactr.core.model.IModel model,
                             org.jactr.core.production.IInstantiation instantiation)
this can be overriden if you want to check the state of the model just after a production has fired

Parameters:
model -

test

public java.util.Collection<java.lang.Throwable> test(java.net.URL url,
                                                      java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> productionSequenceMap,
                                                      java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> failedProductionMap)
test run.

Parameters:
url - of the environment file
productionSequenceMap - keyed on model name, a sequence of productions that should fire
failedProductionMap - keyed on model name, a set of productions that should never fire

test

public java.util.Collection<java.lang.Throwable> test(java.net.URL url,
                                                      java.lang.String modelName,
                                                      java.util.Collection<java.lang.String> productionSequence,
                                                      java.util.Collection<java.lang.String> failedProductions)
Parameters:
url -
modelName - not null
productionSequence - not null or empty
failedProductions - not null