Examples of AfterMatchFiredEvent


Examples of org.kie.api.event.rule.AfterMatchFiredEvent

        ArgumentCaptor<org.kie.api.event.rule.AfterMatchFiredEvent> captor = ArgumentCaptor.forClass(org.kie.api.event.rule.AfterMatchFiredEvent.class);
        verify(ael,
               times(1)).afterMatchFired(captor.capture());

        AfterMatchFiredEvent aafe = captor.getValue();
        Assert.assertThat( (StockTick) aafe.getMatch().getDeclarationValue("f1"),
                           is(st1));
        Assert.assertThat( (StockTick) aafe.getMatch().getDeclarationValue("f2"),
                           is(st2));
    }
View Full Code Here

Examples of org.kie.api.event.rule.AfterMatchFiredEvent

        ArgumentCaptor<org.kie.api.event.rule.AfterMatchFiredEvent> captor = ArgumentCaptor.forClass(org.kie.api.event.rule.AfterMatchFiredEvent.class);
        verify(ael,
               times(1)).afterMatchFired(captor.capture());

        AfterMatchFiredEvent aafe = captor.getValue();
        Assert.assertThat(((Number) aafe.getMatch().getDeclarationValue("$sum")).intValue(),
                          is(95));
        Assert.assertThat(((Number) aafe.getMatch().getDeclarationValue("$cnt")).intValue(),
                          is(3));

    }
View Full Code Here

Examples of org.kie.api.event.rule.AfterMatchFiredEvent

        ArgumentCaptor<org.kie.api.event.rule.AfterMatchFiredEvent> captor = ArgumentCaptor.forClass(org.kie.api.event.rule.AfterMatchFiredEvent.class);
        verify(ael,
               times(1)).afterMatchFired(captor.capture());

        AfterMatchFiredEvent aafe = captor.getValue();
        Assert.assertThat(((Number) aafe.getMatch().getDeclarationValue("$sum")).intValue(),
                          is(33));
    }
View Full Code Here

Examples of org.kie.api.event.rule.AfterMatchFiredEvent

        ArgumentCaptor<org.kie.api.event.rule.AfterMatchFiredEvent> captor = ArgumentCaptor.forClass(org.kie.api.event.rule.AfterMatchFiredEvent.class);
        verify(ael,
               times(1)).afterMatchFired(captor.capture());

        AfterMatchFiredEvent aafe = captor.getValue();
        Assert.assertThat( (StockTick) aafe.getMatch().getDeclarationValue("f1"),
                           is(st1));
        Assert.assertThat( (StockTick) aafe.getMatch().getDeclarationValue("f2"),
                           is(st2));
    }
View Full Code Here

Examples of org.kie.api.event.rule.AfterMatchFiredEvent

        assertEquals( 3,
                      agendaList.size() );
        final BeforeMatchFiredEvent beforeEvent = (BeforeMatchFiredEvent) agendaList.get( 0 );
        assertSame( cheddarHandle,
                    beforeEvent.getMatch().getFactHandles().toArray()[0] );
        final AfterMatchFiredEvent afterEvent = (AfterMatchFiredEvent) agendaList.get( 1 );
        assertSame( cheddarHandle,
                    afterEvent.getMatch().getFactHandles().toArray()[0] );
        final AgendaGroupPoppedEvent poppedEvent = (AgendaGroupPoppedEvent) agendaList.get( 2 );
        assertEquals( "test group",
                      poppedEvent.getAgendaGroup().getName() );
    }
View Full Code Here

Examples of org.kie.api.event.rule.AfterMatchFiredEvent

public class RuleCoverageListenerTest {

    @Test
    public void testCoverage() throws Exception {
        // configuring mock event
        AfterMatchFiredEvent amfe = mock( AfterMatchFiredEvent.class );
        Match match = mock( Match.class );
        Rule rule = mock( Rule.class );
        when( amfe.getMatch() ).thenReturn( match );
        when( match.getRule() ).thenReturn( rule );
        when( rule.getName() ).thenReturn( "rule1" ).thenReturn( "rule2" ).thenReturn( "rule3" );

        HashSet<String> rules = new HashSet<String>();
        rules.add( "rule1" );
View Full Code Here

Examples of org.kie.api.event.rule.AfterMatchFiredEvent

public class RuleCoverageListenerTest {

    @Test
    public void testCoverage() throws Exception {
        // configuring mock event
        AfterMatchFiredEvent amfe = mock( AfterMatchFiredEvent.class );
        Match match = mock( Match.class );
        Rule rule = mock( Rule.class );
        when( amfe.getMatch() ).thenReturn( match );
        when( match.getRule() ).thenReturn( rule );
        when( rule.getName() ).thenReturn( "rule1" ).thenReturn( "rule2" ).thenReturn( "rule3" );

        HashSet<String> rules = new HashSet<String>();
        rules.add( "rule1" );
View Full Code Here

Examples of org.kie.api.event.rule.AfterMatchFiredEvent

        ArgumentCaptor<org.kie.api.event.rule.AfterMatchFiredEvent> captor = ArgumentCaptor.forClass(org.kie.api.event.rule.AfterMatchFiredEvent.class);
        verify(ael,
               times(1)).afterMatchFired(captor.capture());

        AfterMatchFiredEvent aafe = captor.getValue();
        Assert.assertThat(((Number) aafe.getMatch().getDeclarationValue("$sum")).intValue(),
                          is(95));
        Assert.assertThat(((Number) aafe.getMatch().getDeclarationValue("$cnt")).intValue(),
                          is(3));

    }
View Full Code Here

Examples of org.kie.api.event.rule.AfterMatchFiredEvent

        ArgumentCaptor<org.kie.api.event.rule.AfterMatchFiredEvent> captor = ArgumentCaptor.forClass(org.kie.api.event.rule.AfterMatchFiredEvent.class);
        verify(ael,
               times(1)).afterMatchFired(captor.capture());

        AfterMatchFiredEvent aafe = captor.getValue();
        Assert.assertThat(((Number) aafe.getMatch().getDeclarationValue("$sum")).intValue(),
                          is(33));
    }
View Full Code Here

Examples of org.kie.api.event.rule.AfterMatchFiredEvent

        ArgumentCaptor<org.kie.api.event.rule.AfterMatchFiredEvent> captor = ArgumentCaptor.forClass(org.kie.api.event.rule.AfterMatchFiredEvent.class);
        verify(ael,
               times(1)).afterMatchFired(captor.capture());

        AfterMatchFiredEvent aafe = captor.getValue();
        Assert.assertThat( (StockTick) aafe.getMatch().getDeclarationValue("f1"),
                           is(st1));
        Assert.assertThat( (StockTick) aafe.getMatch().getDeclarationValue("f2"),
                           is(st2));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.