Search in sources :

Example 1 with TestKnowledgeBase

use of org.openksavi.sponge.examples.TestKnowledgeBase in project sponge by softelnet.

the class EngineBuilderTest method createAndStartupEngine.

private SpongeEngine createAndStartupEngine() {
    EchoPlugin plugin = new EchoPlugin();
    plugin.setName("testPlugin");
    plugin.setEcho("Echo text!");
    // @formatter:off
    SpongeEngine engine = DefaultSpongeEngine.builder().systemProperty("system.property", "1").property("test.property", "TEST").plugin(plugin).knowledgeBase(new TestKnowledgeBase("testJavaKb")).build();
    // @formatter:on
    engine.getConfigurationManager().setMainProcessingUnitThreadCount(2);
    engine.getConfigurationManager().setEventClonePolicy(EventClonePolicy.DEEP);
    engine.startup();
    return engine;
}
Also used : EchoPlugin(org.openksavi.sponge.examples.EchoPlugin) TestKnowledgeBase(org.openksavi.sponge.examples.TestKnowledgeBase) DefaultSpongeEngine(org.openksavi.sponge.core.engine.DefaultSpongeEngine) SpongeEngine(org.openksavi.sponge.engine.SpongeEngine)

Aggregations

DefaultSpongeEngine (org.openksavi.sponge.core.engine.DefaultSpongeEngine)1 SpongeEngine (org.openksavi.sponge.engine.SpongeEngine)1 EchoPlugin (org.openksavi.sponge.examples.EchoPlugin)1 TestKnowledgeBase (org.openksavi.sponge.examples.TestKnowledgeBase)1