[jboss-svn-commits] JBL Code SVN: r19240 - labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Mar 26 09:23:22 EDT 2008


Author: mark.proctor at jboss.com
Date: 2008-03-26 09:23:22 -0400 (Wed, 26 Mar 2008)
New Revision: 19240

Modified:
   labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/CompositeObjectSinkAdapterTest.java
Log:
JBRULES-1520 RightTuple merge for asynchronous Rete propagations
-fixed CompositeObjectSinkAdapterTest

Modified: labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/CompositeObjectSinkAdapterTest.java
===================================================================
--- labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/CompositeObjectSinkAdapterTest.java	2008-03-26 13:04:14 UTC (rev 19239)
+++ labs/jbossrules/trunk/drools-core/src/test/java/org/drools/reteoo/CompositeObjectSinkAdapterTest.java	2008-03-26 13:23:22 UTC (rev 19240)
@@ -25,8 +25,8 @@
 import org.drools.spi.PropagationContext;
 
 public class CompositeObjectSinkAdapterTest extends TestCase {
-    private ReteooRuleBase ruleBase;
-    private BuildContext   buildContext;
+    private ReteooRuleBase               ruleBase;
+    private BuildContext                 buildContext;
 
     private EqualityEvaluatorsDefinition equals = new EqualityEvaluatorsDefinition();
 
@@ -93,7 +93,8 @@
 
         final CompositeObjectSinkAdapter ad = new CompositeObjectSinkAdapter();
         final LiteralConstraint lit = new LiteralConstraint( new MockExtractor(),
-                                                             equals.getEvaluator( ValueType.STRING_TYPE, Operator.EQUAL ),
+                                                             equals.getEvaluator( ValueType.STRING_TYPE,
+                                                                                  Operator.EQUAL ),
                                                              new ObjectFieldImpl( "stilton" ) );
         final AlphaNode al = new AlphaNode( buildContext.getNextId(),
                                             lit,
@@ -119,7 +120,8 @@
 
         final CompositeObjectSinkAdapter ad = new CompositeObjectSinkAdapter();
         final LiteralConstraint lit = new LiteralConstraint( new MockExtractor(),
-                                                             equals.getEvaluator( ValueType.STRING_TYPE, Operator.EQUAL ),
+                                                             equals.getEvaluator( ValueType.STRING_TYPE,
+                                                                                  Operator.EQUAL ),
                                                              new ObjectFieldImpl( "stilton" ) );
         final AlphaNode al = new AlphaNode( buildContext.getNextId(),
                                             lit,
@@ -136,7 +138,8 @@
                       ad.getSinks()[0] );
 
         final LiteralConstraint lit2 = new LiteralConstraint( new MockExtractor(),
-                                                              equals.getEvaluator( ValueType.STRING_TYPE, Operator.EQUAL ),
+                                                              equals.getEvaluator( ValueType.STRING_TYPE,
+                                                                                   Operator.EQUAL ),
                                                               new ObjectFieldImpl( "cheddar" ) );
         final AlphaNode al2 = new AlphaNode( buildContext.getNextId(),
                                              lit2,
@@ -181,7 +184,8 @@
                                                                                         this.getClass().getClassLoader() );
 
         final LiteralConstraint lit = new LiteralConstraint( extractor,
-                                                             equals.getEvaluator( ValueType.STRING_TYPE, Operator.EQUAL ),
+                                                             equals.getEvaluator( ValueType.STRING_TYPE,
+                                                                                  Operator.EQUAL ),
                                                              new ObjectFieldImpl( "stilton" ) );
         final AlphaNode al = new AlphaNode( buildContext.getNextId(),
                                             lit,
@@ -198,7 +202,8 @@
                       ad.getSinks()[0] );
 
         final LiteralConstraint lit2 = new LiteralConstraint( extractor,
-                                                              equals.getEvaluator( ValueType.STRING_TYPE, Operator.EQUAL ),
+                                                              equals.getEvaluator( ValueType.STRING_TYPE,
+                                                                                   Operator.EQUAL ),
                                                               new ObjectFieldImpl( "cheddar" ) );
         final AlphaNode al2 = new AlphaNode( buildContext.getNextId(),
                                              lit2,
@@ -212,7 +217,8 @@
                       ad.hashableSinks.size() );
 
         final LiteralConstraint lit3 = new LiteralConstraint( extractor,
-                                                              equals.getEvaluator( ValueType.STRING_TYPE, Operator.EQUAL ),
+                                                              equals.getEvaluator( ValueType.STRING_TYPE,
+                                                                                   Operator.EQUAL ),
                                                               new ObjectFieldImpl( "stinky" ) );
         final AlphaNode al3 = new AlphaNode( buildContext.getNextId(),
                                              lit3,
@@ -240,7 +246,8 @@
                                                                                         this.getClass().getClassLoader() );
 
         final LiteralConstraint lit = new LiteralConstraint( extractor,
-                                                             equals.getEvaluator( extractor.getValueType(), Operator.EQUAL ),
+                                                             equals.getEvaluator( extractor.getValueType(),
+                                                                                  Operator.EQUAL ),
                                                              new LongFieldImpl( 65 ) ); // chars are handled as integers
         final AlphaNode al = new AlphaNode( buildContext.getNextId(),
                                             lit,
@@ -257,7 +264,8 @@
                       ad.getSinks()[0] );
 
         final LiteralConstraint lit2 = new LiteralConstraint( extractor,
-                                                              equals.getEvaluator( extractor.getValueType(), Operator.EQUAL ),
+                                                              equals.getEvaluator( extractor.getValueType(),
+                                                                                   Operator.EQUAL ),
                                                               new LongFieldImpl( 66 ) );
         final AlphaNode al2 = new AlphaNode( buildContext.getNextId(),
                                              lit2,
@@ -271,7 +279,8 @@
                       ad.hashableSinks.size() );
 
         final LiteralConstraint lit3 = new LiteralConstraint( extractor,
-                                                              equals.getEvaluator( extractor.getValueType(), Operator.EQUAL ),
+                                                              equals.getEvaluator( extractor.getValueType(),
+                                                                                   Operator.EQUAL ),
                                                               new LongFieldImpl( 67 ) );
         final AlphaNode al3 = new AlphaNode( buildContext.getNextId(),
                                              lit3,
@@ -293,7 +302,8 @@
                           cheese,
                           extractor );
         ObjectSink sink = (ObjectSink) ad.hashedSinkMap.get( hashKey );
-        assertSame( al2, sink );
+        assertSame( al2,
+                    sink );
 
         // should not find this one
         cheese.setCharType( 'X' );
@@ -319,7 +329,8 @@
                                                                                         "type",
                                                                                         this.getClass().getClassLoader() );
         final LiteralConstraint lit1 = new LiteralConstraint( extractor,
-                                                              equals.getEvaluator( ValueType.STRING_TYPE, Operator.EQUAL ),
+                                                              equals.getEvaluator( ValueType.STRING_TYPE,
+                                                                                   Operator.EQUAL ),
                                                               new ObjectFieldImpl( "stilton" ) );
         final AlphaNode al1 = new AlphaNode( buildContext.getNextId(),
                                              lit1,
@@ -327,7 +338,8 @@
                                              buildContext );
 
         final LiteralConstraint lit2 = new LiteralConstraint( extractor,
-                                                              equals.getEvaluator( ValueType.STRING_TYPE, Operator.EQUAL ),
+                                                              equals.getEvaluator( ValueType.STRING_TYPE,
+                                                                                   Operator.EQUAL ),
                                                               new ObjectFieldImpl( "brie" ) );
         final AlphaNode al2 = new AlphaNode( buildContext.getNextId(),
                                              lit2,
@@ -335,7 +347,8 @@
                                              buildContext );
 
         final LiteralConstraint lit3 = new LiteralConstraint( extractor,
-                                                              equals.getEvaluator( ValueType.STRING_TYPE, Operator.EQUAL ),
+                                                              equals.getEvaluator( ValueType.STRING_TYPE,
+                                                                                   Operator.EQUAL ),
                                                               new ObjectFieldImpl( "muzzarela" ) );
         final AlphaNode al3 = new AlphaNode( buildContext.getNextId(),
                                              lit3,
@@ -346,7 +359,9 @@
         ad.addObjectSink( al2 );
         ad.addObjectSink( al3 );
 
-        InternalFactHandle handle = new ReteooFactHandleFactory().newFactHandle( new Cheese(), false, null );
+        InternalFactHandle handle = new ReteooFactHandleFactory().newFactHandle( new Cheese(),
+                                                                                 false,
+                                                                                 null );
         try {
             ad.propagateAssertObject( handle,
                                       null,
@@ -361,11 +376,13 @@
         implements
         FieldExtractor {
 
-        public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
+        public void readExternal(ObjectInput in) throws IOException,
+                                                ClassNotFoundException {
         }
 
         public void writeExternal(ObjectOutput out) throws IOException {
         }
+
         public int getIndex() {
             //  Auto-generated method stub
             return 0;
@@ -488,15 +505,15 @@
         }
 
         public void assertLeftTuple(final LeftTuple tuple,
-                                final PropagationContext context,
-                                final InternalWorkingMemory workingMemory) {
+                                    final PropagationContext context,
+                                    final InternalWorkingMemory workingMemory) {
             //  Auto-generated method stub
 
         }
 
         public void retractLeftTuple(final LeftTuple tuple,
-                                 final PropagationContext context,
-                                 final InternalWorkingMemory workingMemory) {
+                                     final PropagationContext context,
+                                     final InternalWorkingMemory workingMemory) {
             //  Auto-generated method stub
 
         }
@@ -508,9 +525,9 @@
 
         }
 
-        public void retractObject(final InternalFactHandle handle,
-                                  final PropagationContext context,
-                                  final InternalWorkingMemory workingMemory) {
+        public void retractRightTuple(final RightTuple rightTuple,
+                                      final PropagationContext context,
+                                      final InternalWorkingMemory workingMemory) {
             //  Auto-generated method stub
 
         }




More information about the jboss-svn-commits mailing list