Created
August 9, 2015 20:05
-
-
Save bsbodden/a711ae28f09429a41c2d to your computer and use it in GitHub Desktop.
Base Drools JUnit Test Case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.integrallis.drools.junit; | |
import org.kie.api.KieServices; | |
import org.kie.api.runtime.KieContainer; | |
import org.kie.api.runtime.KieSession; | |
import org.junit.After; | |
import org.junit.Before; | |
public abstract class BaseDroolsTestCase { | |
private static KieContainer kContainer; | |
protected KieSession knowledgeSession; | |
private String sessionName; | |
public BaseDroolsTestCase(String sessionName) { | |
this.sessionName = sessionName; | |
KieServices ks = KieServices.Factory.get(); | |
kContainer = ks.getKieClasspathContainer(); | |
} | |
@Before | |
public void setUp() throws Exception { | |
knowledgeSession = kContainer.newKieSession(sessionName); | |
} | |
@After | |
public void tearDown() throws Exception { | |
knowledgeSession.dispose(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment