KieModuleDeploymentHelper { public static final SingleKieModuleDeploymentHelper newSingleInstance() { return new KieModuleDeploymentHelperImpl(); }  static final FluentKieModuleDeploymentHelper newFluentInstance(); static final SingleKieModuleDeploymentHelper newSingleInstance();  }
@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; kjarClasses.add(EnvironmentImpl.class); numDirs += 3; kjarClasses.add( Cheese.class); numDirs += 1; 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); numFiles += 2; numFiles +=3; numDirs += 4; 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()); }