[jboss-svn-commits] JBL Code SVN: r11889 - labs/jbossrules/trunk/experimental/drools-testing/src/org/drools/testing/core/engine.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed May 16 08:09:01 EDT 2007
Author: mshaw
Date: 2007-05-16 08:09:01 -0400 (Wed, 16 May 2007)
New Revision: 11889
Modified:
labs/jbossrules/trunk/experimental/drools-testing/src/org/drools/testing/core/engine/TestRunner.java
Log:
Modified: labs/jbossrules/trunk/experimental/drools-testing/src/org/drools/testing/core/engine/TestRunner.java
===================================================================
--- labs/jbossrules/trunk/experimental/drools-testing/src/org/drools/testing/core/engine/TestRunner.java 2007-05-16 12:05:39 UTC (rev 11888)
+++ labs/jbossrules/trunk/experimental/drools-testing/src/org/drools/testing/core/engine/TestRunner.java 2007-05-16 12:09:01 UTC (rev 11889)
@@ -4,7 +4,9 @@
import org.drools.rule.Package;
import org.drools.testing.core.exception.RuleTestLanguageException;
import org.drools.testing.core.exception.RuleTestServiceUnavailableException;
+import org.drools.testing.core.model.Fact;
import org.drools.testing.core.model.Scenario;
+import org.drools.testing.core.utils.ObjectUtils;
import org.drools.testing.core.wrapper.RuleBaseWrapper;
/**
@@ -26,6 +28,7 @@
public class TestRunner {
private org.drools.testing.core.model.TestSuite testSuite;
+ private Package pkg;
public TestRunner (org.drools.testing.core.model.TestSuite otherValue) {
this.testSuite = otherValue;
@@ -40,6 +43,7 @@
* @throws RuleTestLanguageException
*/
public boolean run (Package pkg) throws RuleTestLanguageException {
+ this.pkg = pkg;
try {
RuleBaseWrapper.getInstance().getRuleBase().addPackage(pkg);
}catch (Exception e) {
@@ -70,12 +74,14 @@
*/
private void parseScenario (Scenario scenario) throws RuleTestLanguageException {
+
// create the working memory
WorkingMemory wm = RuleBaseWrapper.getInstance().getRuleBase().newWorkingMemory(true);
// assert the facts
for (int i=0; i<scenario.getFacts().length; i++) {
-
+ Fact factDefn = scenario.getFacts()[i];
+ Class classDefn = ObjectUtils.getClassDefn(factDefn.getType(), pkg.getImports(),null);
}
}
}
More information about the jboss-svn-commits
mailing list