[jboss-svn-commits] JBL Code SVN: r31846 - in labs/jbossrules/branches/true_modify_20100215: drools-core/src/main/java/org/drools/reteoo and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Feb 25 19:37:40 EST 2010


Author: tirelli
Date: 2010-02-25 19:37:39 -0500 (Thu, 25 Feb 2010)
New Revision: 31846

Modified:
   labs/jbossrules/branches/true_modify_20100215/drools-compiler/src/test/java/org/drools/integrationtests/AccumulateTest.java
   labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/AccumulateNode.java
   labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/CollectNode.java
   labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/LeftTuple.java
Log:
JBRULES-2339: JBRULES-2340: fixing tests

Modified: labs/jbossrules/branches/true_modify_20100215/drools-compiler/src/test/java/org/drools/integrationtests/AccumulateTest.java
===================================================================
--- labs/jbossrules/branches/true_modify_20100215/drools-compiler/src/test/java/org/drools/integrationtests/AccumulateTest.java	2010-02-25 22:34:58 UTC (rev 31845)
+++ labs/jbossrules/branches/true_modify_20100215/drools-compiler/src/test/java/org/drools/integrationtests/AccumulateTest.java	2010-02-26 00:37:39 UTC (rev 31846)
@@ -1,6 +1,5 @@
 package org.drools.integrationtests;
 
-import java.io.File;
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.io.Reader;
@@ -15,8 +14,6 @@
 import org.drools.Cheese;
 import org.drools.Cheesery;
 import org.drools.FactHandle;
-import org.drools.KnowledgeBase;
-import org.drools.KnowledgeBaseFactory;
 import org.drools.Order;
 import org.drools.OrderItem;
 import org.drools.OuterClass;
@@ -27,17 +24,12 @@
 import org.drools.RuntimeDroolsException;
 import org.drools.StatefulSession;
 import org.drools.WorkingMemory;
-import org.drools.builder.KnowledgeBuilder;
-import org.drools.builder.KnowledgeBuilderFactory;
-import org.drools.builder.ResourceType;
 import org.drools.compiler.DrlParser;
 import org.drools.compiler.DroolsParserException;
 import org.drools.compiler.PackageBuilder;
 import org.drools.compiler.PackageBuilderConfiguration;
-import org.drools.io.ResourceFactory;
 import org.drools.lang.descr.PackageDescr;
 import org.drools.rule.Package;
-import org.drools.runtime.StatefulKnowledgeSession;
 
 public class AccumulateTest extends TestCase {
     protected RuleBase getRuleBase() throws Exception {

Modified: labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/AccumulateNode.java
===================================================================
--- labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/AccumulateNode.java	2010-02-25 22:34:58 UTC (rev 31845)
+++ labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/AccumulateNode.java	2010-02-26 00:37:39 UTC (rev 31846)
@@ -867,6 +867,7 @@
             parent.lastChild = matchings[0].getLeftParentPrevious();
             if ( parent.lastChild != null ) {
                 parent.lastChild.setLeftParentNext( null );
+                matchings[0].setLeftParentPrevious( null );
             }
         }
 

Modified: labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/CollectNode.java
===================================================================
--- labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/CollectNode.java	2010-02-25 22:34:58 UTC (rev 31845)
+++ labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/CollectNode.java	2010-02-26 00:37:39 UTC (rev 31846)
@@ -782,6 +782,7 @@
             parent.lastChild = matchings[0].getLeftParentPrevious();
             if ( parent.lastChild != null ) {
                 parent.lastChild.setLeftParentNext( null );
+                matchings[0].setLeftParentPrevious( null );
             }
         }
 

Modified: labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/LeftTuple.java
===================================================================
--- labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/LeftTuple.java	2010-02-25 22:34:58 UTC (rev 31845)
+++ labs/jbossrules/branches/true_modify_20100215/drools-core/src/main/java/org/drools/reteoo/LeftTuple.java	2010-02-26 00:37:39 UTC (rev 31846)
@@ -136,7 +136,6 @@
             
             handle.getLastLeftTuple().leftParentNext = this;
             this.leftParentPrevious = handle.getLastLeftTuple();
-            this.leftParentPrevious.leftParentNext = this;
             handle.setLastLeftTuple( this );
         }        
     }
@@ -150,14 +149,17 @@
                 this.leftParentPrevious.leftParentNext = this.leftParentNext;
                 this.leftParentNext.leftParentPrevious = this.leftParentPrevious;
             } else {
-                // remove the current LeftTuple from start start of the chain
-                this.leftParent.firstChild = this.leftParentNext;
+                if( this.leftParent.firstChild == this ) {
+                    // remove the current LeftTuple from start start of the chain
+                    this.leftParent.firstChild = this.leftParentNext;
+                }
                 this.leftParentNext.leftParentPrevious = null;
             }
             // re-add to end
             this.leftParentPrevious = this.leftParent.lastChild;
             this.leftParentPrevious.leftParentNext = this;
-            this.leftParent.lastChild = this;                       
+            this.leftParent.lastChild = this;            
+            this.leftParentNext = null;
         }
     }
     
@@ -169,14 +171,17 @@
                 this.rightParentPrevious.rightParentNext = this.rightParentNext;
                 this.rightParentNext.rightParentPrevious = this.rightParentPrevious;
             } else {
-                // remove the current LeftTuple from the start of the chain
-                this.rightParent.firstChild = this.rightParentNext;
+                if( this.rightParent.firstChild == this ) {
+                    // remove the current LeftTuple from the start of the chain
+                    this.rightParent.firstChild = this.rightParentNext;
+                }
                 this.rightParentNext.rightParentPrevious = null;
             }
             // re-add to end            
             this.rightParentPrevious = this.rightParent.lastChild;
             this.rightParentPrevious.rightParentNext = this;
-            this.rightParent.lastChild = this;             
+            this.rightParent.lastChild = this;    
+            this.rightParentNext = null;
         }
     }
 



More information about the jboss-svn-commits mailing list