Package org.drools.base

Examples of org.drools.base.RuleNameMatchesAgendaFilter


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

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

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

        Pattern pattern = VerifierComponentMockFactory.createPattern1();
        LiteralRestriction r1 = LiteralRestriction.createRestriction( pattern,
View Full Code Here


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

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

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

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

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

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

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

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

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

        session.setAgendaFilter( new RuleNameMatchesAgendaFilter( "Pattern possibility that is always true" ) );

        VerifierReport result = VerifierReportFactory.newVerifierReport();
        Collection<Object> data = new ArrayList<Object>();

        session.setGlobal( "result",
View Full Code Here

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

        session.setAgendaFilter( new RuleNameMatchesAgendaFilter( "Pattern that is always true" ) );

        VerifierReport result = VerifierReportFactory.newVerifierReport();
        Collection<Object> data = new ArrayList<Object>();

        session.setGlobal( "result",
View Full Code Here

        StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);

        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 = createKnowledgeSession(kbase);

        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

  public void testUselessIntegerGapsLesser() throws Exception {
    StatelessSession session = getStatelessSession(this.getClass()
        .getResourceAsStream("rangeChecks/Clean.drl"));

    session.setAgendaFilter(new RuleNameMatchesAgendaFilter(
        "Remove useless integer gaps lesser or lesser and equal"));

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

    Field f = new Field();
View Full Code Here

 
  public void testUselessIntegerGapsGreater() throws Exception {
    StatelessSession session = getStatelessSession(this.getClass()
        .getResourceAsStream("rangeChecks/Clean.drl"));
   
    session.setAgendaFilter(new RuleNameMatchesAgendaFilter(
    "Remove useless integer gaps greater or greater and equal"));
   
    Collection<Object> testData = new ArrayList<Object>();
   
    Field f = new Field();
View Full Code Here

 
  public void testUselessDoubleGapsLesser() throws Exception {
    StatelessSession session = getStatelessSession(this.getClass()
        .getResourceAsStream("rangeChecks/Clean.drl"));
   
    session.setAgendaFilter(new RuleNameMatchesAgendaFilter(
    "Remove useless double gaps lesser or lesser and equal"));
   
    Collection<Object> testData = new ArrayList<Object>();
   
    Field f = new Field();
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.