public void setProperty(String name, String value) { delegate.setProperty(name, value); }
ksessionConfig.setProperty("keep.reference", "true"); final KieSession ksession = kbase.newKieSession(ksessionConfig, null); ksession.addEventListener(agendaEventListener);
@Test public void testClockTypeConfiguration() { // setting the option using the type safe method config.setOption( ClockTypeOption.get("pseudo") ); // checking the type safe getOption() method assertEquals( ClockTypeOption.get("pseudo"), config.getOption( ClockTypeOption.class ) ); // checking the string based getProperty() method assertEquals( "pseudo", config.getProperty( ClockTypeOption.PROPERTY_NAME ) ); // setting the options using the string based setProperty() method config.setProperty( ClockTypeOption.PROPERTY_NAME, "realtime" ); // checking the type safe getOption() method assertEquals( ClockTypeOption.get("realtime"), config.getOption( ClockTypeOption.class ) ); // checking the string based getProperty() method assertEquals( "realtime", config.getProperty( ClockTypeOption.PROPERTY_NAME ) ); }
@Test public void testBeliefSystemType() { config.setOption( BeliefSystemTypeOption.get( BeliefSystemType.JTMS.toString() ) ); assertEquals( BeliefSystemTypeOption.get( BeliefSystemType.JTMS.toString() ), config.getOption( BeliefSystemTypeOption.class ) ); // checking the string based getProperty() method assertEquals( BeliefSystemType.JTMS.getId(), config.getProperty( BeliefSystemTypeOption.PROPERTY_NAME ) ); // setting the options using the string based setProperty() method config.setProperty( BeliefSystemTypeOption.PROPERTY_NAME, BeliefSystemType.DEFEASIBLE.getId() ); // checking the type safe getOption() method assertEquals( BeliefSystemTypeOption.get( BeliefSystemType.DEFEASIBLE.getId() ), config.getOption( BeliefSystemTypeOption.class ) ); // checking the string based getProperty() method assertEquals( BeliefSystemType.DEFEASIBLE.getId(), config.getProperty( BeliefSystemTypeOption.PROPERTY_NAME ) ); }