Package org.drools.base

Examples of org.drools.base.RuleNameMatchesAgendaFilter


        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        org.drools.event.rule.AgendaEventListener ael = mock( org.drools.event.rule.AgendaEventListener.class );
        ksession.addEventListener( ael );

        RuleNameMatchesAgendaFilter af = new RuleNameMatchesAgendaFilter( ".*b." );

        int rules = ksession.fireAllRules( af );
        assertEquals( 1,
                      rules );

View Full Code Here


        StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();

        org.drools.event.rule.AgendaEventListener ael = mock( org.drools.event.rule.AgendaEventListener.class );
        ksession.addEventListener( ael );

        RuleNameMatchesAgendaFilter af = new RuleNameMatchesAgendaFilter( ".*b." );

        int rules = ksession.fireAllRules( af );
        assertEquals( 1,
                      rules );

View Full Code Here

        InputStream in = getClass().getResourceAsStream( "NamedConsequences.drl" );

        StatelessSession session = getStatelessSession( in );

        session.setAgendaFilter( new RuleNameMatchesAgendaFilter( "No action - possibly commented out" ) );

        VerifierReport result = VerifierReportFactory.newVerifierReport();

        Collection< ? extends Object> testData = getTestData( this.getClass().getResourceAsStream( "ConsequenceTest.drl" ),
                                                              result.getVerifierData() );
View Full Code Here

        InputStream in = getClass().getResourceAsStream( "Consequence.drl" );

        StatelessSession session = getStatelessSession( in );

        session.setAgendaFilter( new RuleNameMatchesAgendaFilter( "No action - possibly commented out" ) );

        VerifierReport result = VerifierReportFactory.newVerifierReport();

        Collection< ? extends Object> testData = getTestData( this.getClass().getResourceAsStream( "ConsequenceTest2.drl" ),
                                                              result.getVerifierData() );
View Full Code Here

    @Test
    public void testLiteralRestrictionsIncompatibilityLessOrEqual() throws Exception {
        StatelessSession session = getStatelessSession(this.getClass().getResourceAsStream("Restrictions.drl"));

        session.setAgendaFilter(new RuleNameMatchesAgendaFilter("Incompatible LiteralRestrictions with ranges in pattern possibility, impossible equality less or equal"));

        Collection<Object> data = new ArrayList<Object>();

        Pattern pattern1 = VerifierComponentMockFactory.createPattern1();
        Pattern pattern2 = VerifierComponentMockFactory.createPattern2();
View Full Code Here

    @Test
    public void testLiteralRestrictionsIncompatibilityGreater() throws Exception {
        StatelessSession session = getStatelessSession(this.getClass().getResourceAsStream("Restrictions.drl"));

        session.setAgendaFilter(new RuleNameMatchesAgendaFilter("Incompatible LiteralRestrictions with ranges in pattern possibility, impossible equality greater"));

        Collection<Object> data = new ArrayList<Object>();

        Pattern pattern1 = VerifierComponentMockFactory.createPattern1();
        Pattern pattern2 = VerifierComponentMockFactory.createPattern2();
View Full Code Here

    @Test
    public void testLiteralRestrictionsIncompatibilityImpossibleRange() throws Exception {
        StatelessSession session = getStatelessSession(this.getClass().getResourceAsStream("Restrictions.drl"));

        session.setAgendaFilter(new RuleNameMatchesAgendaFilter("Incompatible LiteralRestrictions with ranges in pattern possibility, impossible range"));

        Collection<Object> data = new ArrayList<Object>();

        Pattern pattern1 = VerifierComponentMockFactory.createPattern1();
        Pattern pattern2 = VerifierComponentMockFactory.createPattern2();
View Full Code Here

    @Test
    public void testVariableRestrictionsIncompatibilityImpossibleRange() throws Exception {
        StatelessSession session = getStatelessSession(this.getClass().getResourceAsStream("Restrictions.drl"));

        session.setAgendaFilter(new RuleNameMatchesAgendaFilter("Incoherent VariableRestrictions in pattern possibility, impossible range"));

        Collection<Object> data = new ArrayList<Object>();

        VerifierRule rule = VerifierComponentMockFactory.createRule1();
View Full Code Here

    @Test
    public void testLiteralRestrictionOpposite() throws Exception {
        StatelessSession session = getStatelessSession( this.getClass().getResourceAsStream( "Restrictions.drl" ) );

        session.setAgendaFilter( new RuleNameMatchesAgendaFilter( "Opposite LiteralRestrictions" ) );

        Collection<Object> data = new ArrayList<Object>();

        Pattern pattern = VerifierComponentMockFactory.createPattern1();
View Full Code Here

    @Test
    public void testLiteralRestrictionOppositeWithRangesGreaterOrEqualAndLess() throws Exception {
        StatelessSession session = getStatelessSession( this.getClass().getResourceAsStream( "Restrictions.drl" ) );

        session.setAgendaFilter( new RuleNameMatchesAgendaFilter( "Opposite LiteralRestrictions with ranges, greater or equal - less" ) );

        Collection<Object> data = new ArrayList<Object>();

        Pattern pattern = VerifierComponentMockFactory.createPattern1();
View Full Code Here

TOP

Related Classes of org.drools.base.RuleNameMatchesAgendaFilter

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.