Package org.kie.internal.runtime

Examples of org.kie.internal.runtime.StatefulKnowledgeSession.dispose()


        ksession.insert( new Message( "test" ) );
        int rules = ksession.fireAllRules();
        assertEquals( 1, rules );

        ksession.dispose();

        try {
            // the following should raise an IllegalStateException as the session was already disposed
            ksession.fireAllRules();
            fail( "An IllegallStateException should have been raised as the session was disposed before the method call." );
View Full Code Here


        StatefulKnowledgeSession ksession = createKnowledgeSession( kbase );

        ksession.insert( new Triangle() );
        int rules = ksession.fireAllRules();
        assertEquals( 1, rules );
        ksession.dispose();
    }

    @Test
    public void testNestedAccessors2() throws Exception {
        String rule = "package org.drools.compiler\n" +
View Full Code Here

        List<org.kie.api.event.rule.AfterMatchFiredEvent> values = captor.getAllValues();
        assertThat( (Cheesery) values.get( 0 ).getMatch().getObjects().get( 0 ), is( c1 ) );
        assertThat( (Cheesery) values.get( 1 ).getMatch().getObjects().get( 0 ), is( c2 ) );

        ksession.dispose();
    }

    @Test
    public void testMVELConstraintsWithFloatingPointNumbersInScientificNotation() {
View Full Code Here

        fact.setS( "asdf" );
        fact.setI( 10 );
        ksession.insert( fact );
        ksession.fireAllRules();

        ksession.dispose();
    }

    public static class TestUtility {
        public static Boolean utilMethod(String s1,
                                         String s2) {
View Full Code Here

        ksession.insert( new Person( "michael",
                                    "stilton",
                                    25 ) );
       
        ksession.fireAllRules();
        ksession.dispose();
       
        assertEquals( 3, list.size() );
 
        assertEquals( "Young man cheddar",
                      list.get( 0 ) );
View Full Code Here

        ksession.insert( new Person( "Jane",
                                    "stilton",
                                    55 ) );

        ksession.fireAllRules();
        ksession.dispose();

        assertEquals( 2, list.size() );

        assertTrue(list.contains("Young man cheddar"));
        assertTrue(list.contains("Jane eats cheddar"));
View Full Code Here

        assertNotNull(kbase.getRule("org.drools.decisiontable", "привет мир"));
        assertNotNull(kbase.getRule("org.drools.decisiontable", "你好世界"));
        assertNotNull(kbase.getRule("org.drools.decisiontable", "hallå världen"));
        assertNotNull(kbase.getRule("org.drools.decisiontable", "مرحبا العالم"));

        ksession.dispose();
    }
 
    public static class Člověk {

        private int věk;
View Full Code Here

        ksession.setGlobal("list", list);

        ksession.fireAllRules();
        assertEquals(1, list.size());
        assertEquals("working", list.get(0));
        ksession.dispose();

        ksession = kbase.newStatefulKnowledgeSession();

        list.clear();
        ksession.setGlobal("list", list);
View Full Code Here

        ksession.setGlobal("list", list);

        ksession.fireAllRules();
        assertEquals(1, list.size());
        assertEquals("working", list.get(0));
        ksession.dispose();
    }

    @Test
    public void testWildcardImportForTypeField() throws Exception {
        // DROOLS-348
View Full Code Here

        ksession.insert( "go" );

        ksession.fireAllRules();

        assertTrue( list.isEmpty() );
        ksession.dispose();
    }

    @Test
    public void testInitialFactLeaking() {
        // DROOLS-239
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.