Package org.drools.base

Examples of org.drools.base.ClassFieldExtractor


                                                                       null,
                                                                       null );

        final MockObjectSource source = new MockObjectSource( 15 );

        final ClassFieldExtractor extractor = ClassFieldExtractorCache.getExtractor( Cheese.class,
                                                                                     "type",
                                                                                     getClass().getClassLoader() );

        final FieldValue field = FieldFactory.getFieldValue( "cheddar" );
View Full Code Here


                                                                       queryObjectType,
                                                                       rete,
                                                                       3 );
        queryObjectTypeNode.attach();

        ClassFieldExtractor extractor = ClassFieldExtractorCache.getExtractor( DroolsQuery.class,
                                                                               "name",
                                                                               DroolsQuery.class.getClassLoader() );

        FieldValue field = FieldFactory.getFieldValue( "query-1" );
View Full Code Here

import org.drools.util.FactHandleIndexHashTable.FieldIndexEntry;

public class FieldIndexEntryTest extends TestCase {

    public void testSingleEntry() {
        final ClassFieldExtractor extractor = ClassFieldExtractorCache.getExtractor( Cheese.class,
                                                                                     "type",
                                                                                     getClass().getClassLoader() );

        final FieldIndex fieldIndex = new FieldIndex( extractor,
                                                      null,
View Full Code Here

        index.remove( h1 );
        assertNull( index.getFirst() );
    }

    public void testTwoEntries() {
        final ClassFieldExtractor extractor = ClassFieldExtractorCache.getExtractorCheese.class,
                                                                                      "type",
                                                                                      getClass().getClassLoader() );
        final FieldIndex fieldIndex = new FieldIndex( extractor,
                                                      null,
                                                      StringFactory.getInstance().getEvaluator( Operator.EQUAL ) );
View Full Code Here

        // check index type does not change, as this fact is removed
        stilton1.setType( "cheddar" );
    }

    public void testThreeEntries() {
        final ClassFieldExtractor extractor = ClassFieldExtractorCache.getExtractor( Cheese.class,
                                                                                     "type",
                                                                                     getClass().getClassLoader() );
        final FieldIndex fieldIndex = new FieldIndex( extractor,
                                                      null,
                                                      StringFactory.getInstance().getEvaluator( Operator.EQUAL ) );
View Full Code Here

                                                                       PropagationContext.ASSERTION,
                                                                       null,
                                                                       null );
        final ReteooWorkingMemory workingMemory = new ReteooWorkingMemory( 1,
                                                                           (ReteooRuleBase) RuleBaseFactory.newRuleBase() );
        final ClassFieldExtractor extractor = ClassFieldExtractorCache.getExtractor( Cheese.class,
                                                                                     "type",
                                                                                     getClass().getClassLoader() );

        final FieldValue field = FieldFactory.getFieldValue( "stilton" );
        final LiteralConstraint constraint = new LiteralConstraint( extractor,
View Full Code Here

                                                                       null );

        final ReteooWorkingMemory workingMemory = new ReteooWorkingMemory( 1,
                                                                           (ReteooRuleBase) RuleBaseFactory.newRuleBase() );

        final ClassFieldExtractor priceExtractor = ClassFieldExtractorCache.getExtractor( Cheese.class,
                                                                                          "price",
                                                                                          getClass().getClassLoader() );

        final ClassFieldExtractor ageExtractor = ClassFieldExtractorCache.getExtractor( Person.class,
                                                                                        "age",
                                                                                        getClass().getClassLoader() );

        final Pattern pattern = new Pattern( 0,
                                             new ClassObjectType( Person.class ) );
View Full Code Here

                                                                       PropagationContext.ASSERTION,
                                                                       null,
                                                                       null );
        final ReteooWorkingMemory workingMemory = new ReteooWorkingMemory( 1,
                                                                           (ReteooRuleBase) RuleBaseFactory.newRuleBase() );
        final ClassFieldExtractor extractor = ClassFieldExtractorCache.getExtractor( Cheese.class,
                                                                                     "type",
                                                                                     getClass().getClassLoader() );

        final FieldValue field = FieldFactory.getFieldValue( "stilton" );
        final LiteralConstraint constraint = new LiteralConstraint( extractor,
View Full Code Here

public class FieldIndexEntryTest extends TestCase {
    ClassFieldExtractorCache cache = ClassFieldExtractorCache.getInstance();

    public void testSingleEntry() {
        final ClassFieldExtractor extractor = cache.getExtractor( Cheese.class,
                                                                  "type",
                                                                  getClass().getClassLoader() );

        final FieldIndex fieldIndex = new FieldIndex( extractor,
                                                      null,
View Full Code Here

        index.remove( h1 );
        assertNull( index.getFirst() );
    }

    public void testTwoEntries() {
        final ClassFieldExtractor extractor = cache.getExtractor( Cheese.class,
                                                                  "type",
                                                                  getClass().getClassLoader() );
        final FieldIndex fieldIndex = new FieldIndex( extractor,
                                                      null,
                                                      StringFactory.getInstance().getEvaluator( Operator.EQUAL ) );
View Full Code Here

TOP

Related Classes of org.drools.base.ClassFieldExtractor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.