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

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Apr 1 16:58:08 EDT 2008


Author: tirelli
Date: 2008-04-01 16:58:08 -0400 (Tue, 01 Apr 2008)
New Revision: 19369

Added:
   labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/reteoo/MockLeftTupleSink.java
   labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/reteoo/MockRightTupleSink.java
Modified:
   labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/PackageBuilderTest.java
Log:
JBRULES-1520: replicating classes to fix classpath problem

Modified: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/PackageBuilderTest.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/PackageBuilderTest.java	2008-04-01 20:19:07 UTC (rev 19368)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/compiler/PackageBuilderTest.java	2008-04-01 20:58:08 UTC (rev 19369)
@@ -32,7 +32,7 @@
 import org.drools.DroolsTestCase;
 import org.drools.FactHandle;
 import org.drools.Primitives;
-import org.drools.QueryResults;
+import org.drools.QueryResults; 
 import org.drools.RuleBase;
 import org.drools.RuleBaseFactory;
 import org.drools.StatefulSession;

Added: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/reteoo/MockLeftTupleSink.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/reteoo/MockLeftTupleSink.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/reteoo/MockLeftTupleSink.java	2008-04-01 20:58:08 UTC (rev 19369)
@@ -0,0 +1,168 @@
+package org.drools.reteoo;
+
+/*
+ * Copyright 2005 JBoss Inc
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+
+import org.drools.FactException;
+import org.drools.RuleBaseConfiguration;
+import org.drools.common.BaseNode;
+import org.drools.common.InternalWorkingMemory;
+import org.drools.common.NodeMemory;
+import org.drools.spi.PropagationContext;
+
+public class MockLeftTupleSink extends LeftTupleSource
+    implements
+    LeftTupleSinkNode,
+    NodeMemory {
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 400L;
+    private final List        asserted         = new ArrayList();
+    private final List        retracted        = new ArrayList();
+
+    private LeftTupleSinkNode     previousTupleSinkNode;
+    private LeftTupleSinkNode     nextTupleSinkNode;
+
+    public MockLeftTupleSink() {
+        super( 0 );
+    }
+
+    public MockLeftTupleSink(final int id) {
+        super( id );
+    }
+
+    public void assertLeftTuple(final LeftTuple tuple,
+                            final PropagationContext context,
+                            final InternalWorkingMemory workingMemory) {
+        this.asserted.add( new Object[]{tuple, context, workingMemory} );
+
+    }
+
+    public void retractLeftTuple(final LeftTuple tuple,
+                             final PropagationContext context,
+                             final InternalWorkingMemory workingMemory) {
+        this.retracted.add( new Object[]{tuple, context, workingMemory} );
+
+    }
+
+    public List getAsserted() {
+        return this.asserted;
+    }
+
+    public List getRetracted() {
+        return this.retracted;
+    }
+
+    public void ruleAttached() {
+        // TODO Auto-generated method stub
+    }
+
+    public int getId() {
+        return this.id;
+    }
+
+    public Object createMemory(final RuleBaseConfiguration config) {
+        return new HashMap();
+    }
+
+    public void attach() {
+        // TODO Auto-generated method stub
+
+    }
+
+    public void updateSink(final LeftTupleSink sink,
+                           final PropagationContext context,
+                           final InternalWorkingMemory workingMemory) throws FactException {
+        // TODO Auto-generated method stub
+
+    }
+
+    protected void doRemove(final RuleRemovalContext context,
+                            final ReteooBuilder builder,
+                            final BaseNode node,
+                            final InternalWorkingMemory[] workingMemories) {
+    }
+
+    public void attach(final InternalWorkingMemory[] workingMemories) {
+        // TODO Auto-generated method stub
+
+    }
+
+    public List getPropagatedTuples(final ReteooWorkingMemory workingMemory,
+                                    final LeftTupleSink sink) {
+        // TODO Auto-generated method stub
+        return Collections.EMPTY_LIST;
+    }
+
+    /**
+     * Returns the next node
+     * @return
+     *      The next TupleSinkNode
+     */
+    public LeftTupleSinkNode getNextLeftTupleSinkNode() {
+        return this.nextTupleSinkNode;
+    }
+
+    /**
+     * Sets the next node 
+     * @param next
+     *      The next TupleSinkNode
+     */
+    public void setNextLeftTupleSinkNode(final LeftTupleSinkNode next) {
+        this.nextTupleSinkNode = next;
+    }
+
+    /**
+     * Returns the previous node
+     * @return
+     *      The previous TupleSinkNode
+     */
+    public LeftTupleSinkNode getPreviousLeftTupleSinkNode() {
+        return this.previousTupleSinkNode;
+    }
+
+    /**
+     * Sets the previous node 
+     * @param previous
+     *      The previous TupleSinkNode
+     */
+    public void setPreviousLeftTupleSinkNode(final LeftTupleSinkNode previous) {
+        this.previousTupleSinkNode = previous;
+    }
+
+    public boolean isLeftTupleMemoryEnabled() {
+        // TODO Auto-generated method stub
+        return false;
+    }
+
+    public void setLeftTupleMemoryEnabled(boolean tupleMemoryEnabled) {
+        // TODO Auto-generated method stub
+        
+    }
+
+    @Override
+    public void networkUpdated() {
+        // TODO Auto-generated method stub
+        
+    }
+
+}
\ No newline at end of file

Added: labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/reteoo/MockRightTupleSink.java
===================================================================
--- labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/reteoo/MockRightTupleSink.java	                        (rev 0)
+++ labs/jbossrules/trunk/drools-compiler/src/test/java/org/drools/reteoo/MockRightTupleSink.java	2008-04-01 20:58:08 UTC (rev 19369)
@@ -0,0 +1,26 @@
+package org.drools.reteoo;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.drools.common.InternalWorkingMemory;
+import org.drools.spi.PropagationContext;
+
+public class MockRightTupleSink
+    implements
+    RightTupleSink {
+    
+    private final List        retracted        = new ArrayList();
+
+    public void retractRightTuple(RightTuple rightTuple,
+                                  PropagationContext context,
+                                  InternalWorkingMemory workingMemory) {
+        this.retracted.add( new Object[]{rightTuple, context, workingMemory} );
+
+    }
+    
+    public List getRetracted() {
+        return this.retracted;
+    }    
+
+}




More information about the jboss-svn-commits mailing list