39273928392939303931393239333934393539363937
ks.fireAllRules(); assertTrue( list.contains( 0 ) ); assertEquals( 1, list.size() ); ks.dispose(); } @Test
40144015401640174018401940204021402240234024
ks.fireAllRules(); assertEquals( 5, list.size() ); assertEquals( Arrays.asList( 99, "b", 11, Object.class, 42 ), list ); ks.dispose(); } @Test public void testMultipleModifications() {
41284129413041314132413341344135413641374138
ks.fireAllRules(); assertTrue( list.contains( 1 ) ); assertEquals( 1, list.size() ); ks.dispose(); } @Test
42184219422042214222422342244225422642274228
assertTrue( list.contains( "HH" ) ); assertTrue( list.contains( "HH" ) ); assertTrue( list.contains( "HD" ) ); assertEquals( 9, list.size() ); ks.dispose(); }
42594260426142624263426442654266426742684269
ks.insert( "go2" ); ks.fireAllRules(); System.out.println( "---------------------------------------" ); ks.dispose(); }
43124313431443154316431743184319432043214322
ks.insert( "go3" ); ks.fireAllRules(); assertEquals( Arrays.asList( 100 ), list ); ks.dispose(); } @Test public void testTraitNoType() {
17701771177217731774177517761777177817791780
assertThat( ((Number) activation.getDeclarationValue( "$min" )).intValue(), is( 3 ) ); assertThat( ((Number) activation.getDeclarationValue( "$avg" )).intValue(), is( 10 ) ); ksession.dispose(); } public static class DataSet { public Cheese[] cheese;
19481949195019511952195319541955195619571958
"end"; KnowledgeBase kbase = loadKnowledgeBaseFromString( drl ); StatefulKnowledgeSession ksession = createKnowledgeSession(kbase); ksession.fireAllRules(); ksession.dispose(); } public static class MyObj { public static class NestedObj { public long value;
19992000200120022003200420052006200720082009
final List<Number> results = new ArrayList<Number>(); ksession.setGlobal( "results", results ); ksession.fireAllRules(); ksession.dispose(); assertEquals( 1, results.size() ); assertEquals( 9.0, results.get( 0 ) ); }
107108109110111112113114115116117
throw new RuntimeException(e); } } assertTrue(success); ksession.dispose(); } public static class Bean { private int seed;