Package org.drools.spi

Examples of org.drools.spi.InstrumentedCondition


        brie = new MockAgendaItem( new MockTuple( ), brieRule );
        camembert = new MockAgendaItem( new MockTuple( ), camembertRule );
        stilton = new MockAgendaItem( new MockTuple( ), stiltonRule );

        brieRule.addCondition( new InstrumentedCondition( ) );

        camembertRule.addCondition( new InstrumentedCondition( ) );
        camembertRule.addCondition( new InstrumentedCondition( ) );

        stiltonRule.addCondition( new InstrumentedCondition( ) );
        stiltonRule.addCondition( new InstrumentedCondition( ) );
        stiltonRule.addCondition( new InstrumentedCondition( ) );
    }
View Full Code Here


        brie = new MockAgendaItem( new MockTuple( ), brieRule );
        camembert = new MockAgendaItem( new MockTuple( ), camembertRule );
        stilton = new MockAgendaItem( new MockTuple( ), stiltonRule );

        brieRule.addCondition( new InstrumentedCondition( ) );

        camembertRule.addCondition( new InstrumentedCondition( ) );
        camembertRule.addCondition( new InstrumentedCondition( ) );

        stiltonRule.addCondition( new InstrumentedCondition( ) );
        stiltonRule.addCondition( new InstrumentedCondition( ) );
        stiltonRule.addCondition( new InstrumentedCondition( ) );
    }
View Full Code Here

                // agenda.addToAgenda( ( ReteTuple ) tuple, tuple.getRule( ) );
                // System.err.println("fire");
            }
        } );
        // add condition
        InstrumentedCondition c1 = new InstrumentedCondition( );
        c1.addDeclaration( stringDecl1 );
        c1.isAllowed( true );
        InstrumentedCondition c2 = new InstrumentedCondition( );
        c2.addDeclaration( stringDecl2 );
        c2.isAllowed( true );
        InstrumentedCondition c3 = new InstrumentedCondition( );
        c3.addDeclaration( intDecl );
        c3.isAllowed( true );
        rule.addCondition( c1 );
        rule.addCondition( c2 );
        rule.addCondition( c3 );

        // rule.addCondition( new org.drools.spi.InstrumentedCondition( ) );
View Full Code Here

    }

    public void testWhatDoesThisTest() throws Exception
    {
        //one condition
        brieRule.addCondition( new InstrumentedCondition( ) );
        //one condition
        fetaRule.addCondition( new InstrumentedCondition( ) );
        //one condition
        cheddarRule.addCondition( new InstrumentedCondition( ) );
        //two conditions
        stiltonRule.addCondition( new InstrumentedCondition( ) );
        stiltonRule.addCondition( new InstrumentedCondition( ) );

        this.items.add( stilton );
        this.items.add( mozzarella );
        this.items.add( cheddar );
        this.items.add( camembert );
View Full Code Here

    }

    public void testAndWhatIsThisTesting() throws Exception
    {
        //one condition
        cheddarRule.addCondition( new InstrumentedCondition( ) );
        //one condition
        mozzarellaRule.addCondition( new InstrumentedCondition( ) );

        //one condition
        camembertRule.addCondition( new InstrumentedCondition( ) );
        //two conditions
        fetaRule.addCondition( new InstrumentedCondition( ) );
        fetaRule.addCondition( new InstrumentedCondition( ) );

        //three conditions
        stiltonRule.addCondition( new InstrumentedCondition( ) );
        stiltonRule.addCondition( new InstrumentedCondition( ) );
        stiltonRule.addCondition( new InstrumentedCondition( ) );

        this.items.add( stilton );
        this.items.add( mozzarella );
        this.items.add( cheddar );
        this.items.add( brie );
View Full Code Here

    public void testMatches()
    {
        Set decls = new HashSet( );

        InstrumentedCondition cond = new InstrumentedCondition( );

        cond.addDeclaration( this.stringDecl );
        cond.addDeclaration( this.objectDecl );

        assertTrue( !this.builder.matches( cond, decls ) );

        decls.add( this.stringDecl );
View Full Code Here

        source.addTupleDeclaration( this.stringDecl );

        sources.add( source );

        InstrumentedCondition cond = new InstrumentedCondition( );

        cond.addDeclaration( this.stringDecl );

        TupleSource found;

        found = this.builder.findMatchingTupleSourceForCondition( cond, sources );

        assertNotNull( found );

        assertSame( source, found );

        // ----------------------------------------
        // ----------------------------------------

        sources.clear( );

        source = new MockTupleSource( );

        source.addTupleDeclaration( this.objectDecl );

        found = this.builder.findMatchingTupleSourceForCondition( cond, sources );

        assertNull( found );

        // ----------------------------------------
        // ----------------------------------------

        cond.addDeclaration( this.objectDecl );

        sources.clear( );

        source = new MockTupleSource( );
View Full Code Here

TOP

Related Classes of org.drools.spi.InstrumentedCondition

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.