[jboss-svn-commits] JBL Code SVN: r14996 - in labs/jbossrules/trunk/drools-core/src: test/java/org/drools/reteoo and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Sep 10 13:16:48 EDT 2007


Author: tirelli
Date: 2007-09-10 13:16:48 -0400 (Mon, 10 Sep 2007)
New Revision: 14996

Modified:
   labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/AlphaNode.java
   labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/AlphaNodeTest.java
Log:
JBRULES-1177: fixing tests

Modified: labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/AlphaNode.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/AlphaNode.java	2007-09-10 17:14:46 UTC (rev 14995)
+++ labs/jbossrules/trunk/drools-core/src/main/java/org/drools/reteoo/AlphaNode.java	2007-09-10 17:16:48 UTC (rev 14996)
@@ -61,8 +61,8 @@
 
     private boolean                        objectMemoryAllowed;
 
-    // a reference to the ObjectSink being currently updated
-    private ObjectSink                     sinkBeingUpdated;
+    // a reference to the ObjectSink currently being updated
+    private transient ObjectSink           sinkBeingUpdated;
 
     /**
      * Construct an <code>AlphaNode</code> with a unique id using the provided

Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/AlphaNodeTest.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/AlphaNodeTest.java	2007-09-10 17:14:46 UTC (rev 14995)
+++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/AlphaNodeTest.java	2007-09-10 17:16:48 UTC (rev 14996)
@@ -41,7 +41,7 @@
 
 public class AlphaNodeTest extends DroolsTestCase {
 
-    public void xxxtestMemory() {
+    public void testMemory() {
         RuleBaseConfiguration config = new RuleBaseConfiguration();
         config.setAlphaMemory( false );
         ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase( config );
@@ -59,7 +59,7 @@
         assertNotNull( memory );
     }
 
-    public void xxxtestLiteralConstraintAssertObjectWithMemory() throws Exception {
+    public void testLiteralConstraintAssertObjectWithMemory() throws Exception {
         RuleBaseConfiguration config = new RuleBaseConfiguration();
         config.setAlphaMemory( true );
         ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase( config );
@@ -146,7 +146,7 @@
                     memory.contains( f0 ) );
     }
 
-    public void xxxtestIsMemoryAllowedOverride() throws Exception {
+    public void testIsMemoryAllowedOverride() throws Exception {
         RuleBaseConfiguration config = new RuleBaseConfiguration();
         config.setAlphaMemory( true );
         ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase( config );
@@ -209,7 +209,7 @@
                       memory.size() );
     }
 
-    public void xxxtestLiteralConstraintAssertObjectWithoutMemory() throws Exception {
+    public void testLiteralConstraintAssertObjectWithoutMemory() throws Exception {
         RuleBaseConfiguration config = new RuleBaseConfiguration();
         config.setAlphaMemory( false );
         ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase( config );
@@ -295,7 +295,7 @@
                      memory.contains( f0 ) );
     }
 
-    public void xxxtestLiteralConstraintAssertSequentialMode() throws Exception {
+    public void testLiteralConstraintAssertSequentialMode() throws Exception {
         RuleBaseConfiguration config = new RuleBaseConfiguration();
         config.setSequential( true );
         ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase( config );
@@ -383,7 +383,7 @@
      * on the previous two tests. This just test AlphaNode With a different
      * Constraint type.
      */
-    public void xxxtestReturnValueConstraintAssertObject() throws Exception {
+    public void testReturnValueConstraintAssertObject() throws Exception {
         RuleBaseConfiguration config = new RuleBaseConfiguration();
         config.setAlphaMemory( false );
         ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase( config );
@@ -451,7 +451,7 @@
                       sink.getAsserted() );
     }
 
-    public void xxxtestRetractObjectWithMemory() throws Exception {
+    public void testRetractObjectWithMemory() throws Exception {
         RuleBaseConfiguration config = new RuleBaseConfiguration();
         config.setAlphaMemory( true );
         ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase( config );
@@ -535,7 +535,7 @@
 
     }
 
-    public void xxxtestRetractObjectWithoutMemory() throws Exception {
+    public void testRetractObjectWithoutMemory() throws Exception {
         RuleBaseConfiguration config = new RuleBaseConfiguration();
         config.setAlphaMemory( false );
         ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase( config );
@@ -620,7 +620,7 @@
 
     }
 
-    public void xxxtestUpdateSinkWithMemory() throws FactException,
+    public void testUpdateSinkWithMemory() throws FactException,
                                           IntrospectionException {
         // An AlphaNode with memory should not try and repropagate from its source
         // Also it should only update the latest tuple sinky
@@ -673,6 +673,17 @@
                                 context,
                                 workingMemory );
 
+        // Create a fact that should not be propagated, since the alpha node restriction will filter it out
+        final Cheese stilton = new Cheese( "stilton",
+                                           10 );
+        final DefaultFactHandle handle2 = new DefaultFactHandle( 2,
+                                                                 stilton );
+        // adding handle to the mock source
+        source.addFact( handle2 );
+
+        alphaNode.assertObject( handle2,
+                                context,
+                                workingMemory );
         assertLength( 1,
                       sink1.getAsserted() );
 




More information about the jboss-svn-commits mailing list