Package org.kie.internal.runtime

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


        Thread.sleep(100*40*1);
        ksession.fireAllRules();

        assertEquals( Arrays.asList( 1L, 2L, 3L, 3L, 3L, 3L, -1 ), list );

        ksession.dispose();
    }

    @Test
    public void testDuplicateFiring2() throws InterruptedException {

View Full Code Here


        StockTick event2 = new StockTick( 3, "XXX", 1.0, 0 );
        System.out.println("4. rule invocation");
        ksession.insert( event2 );
        ksession.fireAllRules();

        ksession.dispose();

        assertEquals( Arrays.asList( 1L, 2L, 1L, 1L ), list );
    }

View Full Code Here

            list.clear();

            System.out.println( "-------------- SLEEP ------------" );
        }

        ksession.dispose();
    }

    @Test
    public void testExpirationOnModification() throws InterruptedException {
        //DROOLS-374
View Full Code Here

        ksession.insert( "go" );
        ksession.fireAllRules();

        assertEquals( Arrays.asList( 1L, 2L, 1L ), list );

        ksession.dispose();
    }



    @Test
View Full Code Here

        // The event should still be there...

        assertEquals( 1, ksession.getObjects().size() );

        ksession.dispose();
    }

    @Test @Ignore("Cannot reproduce with pseudoclock and takes too long with system clock")
    public void testTimedRuleWithAccumulate() {
        // BZ-1083103
View Full Code Here

        assertEquals( 1,
                      results.size() );
        assertEquals( do2,
                      results.iterator().next().get( "$do" ) );

        ksession.dispose();
    }

}
View Full Code Here

        ksession.fireAllRules();

        assertEquals( 4,
                      p1.getAddresses().size() );

        ksession.dispose();

        // Should not fail here
        ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, null, env);
    }
}
View Full Code Here

            long start = System.currentTimeMillis();
            ksession.fireAllRules();
            long time = System.currentTimeMillis() - start;
            System.err.println( time );
            totalTime += time;
            ksession.dispose();
        }
       
        System.out.println( "average : " + totalTime / 5 );
    }
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

            System.out.println( o );
        }

        assertEquals( 0, ks.getObjects().size() );

        ks.dispose();
    }


    @Test
    public void testUpdateLegacyClass(  ) {
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.