@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( 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
    numFiles +=3;
    
    // META-INF/maven/org.kie.api.builder/test-kjar
    numDirs += 4;
    // defaultKiebase, META-INF/defaultKieBase
    numDirs += 2;
    File artifactFile = MavenRepository.getMavenRepository().resolveArtifact(groupId + ":" + artifactId + ":" + version).getFile();
    zip = new ZipInputStream(new FileInputStream(artifactFile));
    Set<String> jarFiles = new HashSet<String>();
    Set<String> jarDirs = new HashSet<String>();
    ZipEntry ze = zip.getNextEntry();
    logger.debug("Getting files from deployed jar: " );
    while( ze != null ) { 
        String fileName = ze.getName();
        if( fileName.endsWith("drl")
                || fileName.endsWith("class")
                || fileName.endsWith("xml")
                || fileName.endsWith("info")
                || fileName.endsWith("properties")
                || fileName.endsWith("cache") ) { 
            jarFiles.add(fileName);
            logger.debug("> " + fileName);
        } else { 
            jarDirs.add(fileName);
            logger.debug("] " + fileName);
        }
        ze = zip.getNextEntry();
    }
    assertEquals("Num files in kjar", numFiles, jarFiles.size());
}