@Test
public void testSingleDeploymentHelper() throws Exception {
int numFiles = 0;
int numDirs = 0;
SingleKieModuleDeploymentHelper deploymentHelper = KieModuleDeploymentHelper.newSingleInstance();
List<String> resourceFilePaths = new ArrayList<String>();
resourceFilePaths.add("builder/test/");
numFiles += 2;
resourceFilePaths.add("builder/simple_query_test.drl");
++numFiles;
List<Class<?>> kjarClasses = new ArrayList<Class<?>>();
kjarClasses.add(KieModuleDeploymentHelper.class);
numDirs += 5; // org.kie.api.builder.helper
kjarClasses.add(EnvironmentImpl.class);
numDirs += 3; // (org.)drools.core.impl
kjarClasses.add(org.drools.compiler.Cheese.class);
numDirs += 1; // (org.drools.)compiler
numFiles += 3;
String groupId = "org.kie.api.builder";
String artifactId = "test-kjar";
String version = "0.1-SNAPSHOT";
deploymentHelper.createKieJarAndDeployToMaven(groupId, artifactId, version,
"defaultKieBase", "defaultKieSession",
resourceFilePaths, kjarClasses);
// pom.xml, pom.properties
numFiles += 2;
// kmodule.xml, kmodule.info, kbase.cache