Refine search
@Test public void testTransformUrl() { String actualPath = ClasspathKieProject.fixURLFromKProjectPath(url); Assertions.assertThat(actualPath).isEqualTo(expectedPath); } }
public void afterKmoduleSet() { log.debug(" :: Starting Blueprint KieObjectsInjector for kmodule ("+contextId+") :: "); if ( resources == null || resources.isEmpty()) { configFileURL = getClass().getResource("/"); if (configFileURL == null) { createOsgiKieModule(); return; } configFilePath = configFileURL.getPath(); } else { configFileURL = resources.get(0); configFilePath = configFileURL.getPath(); log.debug(" :: Trying to intialize the KieModule from " + configFileURL + " :: "); } if ( configFilePath == null) { throw new RuntimeException("Failure creating a KieModule. Unable to determine the Configuration File Path."); } String pomProperties = ClasspathKieProject.getPomProperties(configFilePath); releaseId = ReleaseIdImpl.fromPropertiesString(pomProperties); KieModuleModel kieModuleModel = getKieModuleModel(); injectKieModule(kieModuleModel); addKieModuleToRepo(kieModuleModel); log.debug(" :: Completed Injecting KieObjects from the Blueprint Bean Processor ("+contextId+") :: "); }
if (kModuleRootPath.endsWith(WEB_INF_CLASSES_PATH_SUFFIX)) { String configFilePathForWebApps = kModuleRootPath.substring(0, kModuleRootPath.indexOf(WEB_INF_CLASSES_PATH_SUFFIX)); pomProperties = ClasspathKieProject.getPomProperties(configFilePathForWebApps); pomProperties = ClasspathKieProject.getPomProperties(kModuleRootPath);
protected InternalKieModule createKieModule(KieModuleModel kieProject) { String rootPath = parseKModuleRootPath(kModuleRootUrl); if (rootPath.lastIndexOf(':') >= 2) { // avoid to trucate Windows paths like C:\my\folder\... rootPath = rootPath.substring(rootPath.lastIndexOf(':') + 1); } return ClasspathKieProject.createInternalKieModule(kieProject, releaseId, rootPath); }
public void afterKmoduleSet() { log.debug(" :: Starting Blueprint KieObjectsInjector for kmodule ("+contextId+") :: "); if ( resources == null || resources.isEmpty()) { configFileURL = getClass().getResource("/"); if (configFileURL == null) { createOsgiKieModule(); return; } configFilePath = configFileURL.getPath(); } else { configFileURL = resources.get(0); configFilePath = configFileURL.getPath(); log.debug(" :: Trying to intialize the KieModule from " + configFileURL + " :: "); } if ( configFilePath == null) { throw new RuntimeException("Failure creating a KieModule. Unable to determine the Configuration File Path."); } String pomProperties = ClasspathKieProject.getPomProperties(configFilePath); releaseId = ReleaseIdImpl.fromPropertiesString(pomProperties); KieModuleModel kieModuleModel = getKieModuleModel(); injectKieModule(kieModuleModel); addKieModuleToRepo(kieModuleModel); log.debug(" :: Completed Injecting KieObjects from the Blueprint Bean Processor ("+contextId+") :: "); }
if (kModuleRootPath.endsWith(WEB_INF_CLASSES_PATH_SUFFIX)) { String configFilePathForWebApps = kModuleRootPath.substring(0, kModuleRootPath.indexOf(WEB_INF_CLASSES_PATH_SUFFIX)); pomProperties = ClasspathKieProject.getPomProperties(configFilePathForWebApps); pomProperties = ClasspathKieProject.getPomProperties(kModuleRootPath);
protected InternalKieModule createKieModule(KieModuleModel kieProject) { String rootPath = parseKModuleRootPath(kModuleRootUrl); if (rootPath.lastIndexOf(':') >= 2) { // avoid to trucate Windows paths like C:\my\folder\... rootPath = rootPath.substring(rootPath.lastIndexOf(':') + 1); } return ClasspathKieProject.createInternalKieModule(kieProject, releaseId, rootPath); }
@Test public void testParsePomPropertiesFromJarDir() throws Exception { createKieModule(MODULE_JARDIR_NAME, false, MODULE_JARDIR_VERSION); final File kModuleDir = getFileManager().newFile(MODULE_JARDIR_NAME + "-" + MODULE_JARDIR_VERSION); Assertions.assertThat(kModuleDir).isNotNull(); Assertions.assertThat(kModuleDir).isDirectory(); kModuleDir.renameTo(new File(kModuleDir.getAbsolutePath() + ".jar")); final File kModuleFile = getFileManager().newFile(MODULE_JARDIR_NAME + "-" + MODULE_JARDIR_VERSION + ".jar"); final String pomProperties = ClasspathKieProject.getPomProperties(kModuleFile.getAbsolutePath()); checkPomProperties(pomProperties, MODULE_JARDIR_NAME, MODULE_JARDIR_VERSION); }
protected void addKieModuleToRepo(KieModuleModel kieModuleModel) { String rootPath = configFilePath; if ( rootPath.lastIndexOf( ':' ) >= 2 ) { // avoid to trucate Windows paths like C:\my\folder\... rootPath = configFilePath.substring( rootPath.lastIndexOf( ':' ) + 1 ); } KieBuilderImpl.setDefaultsforEmptyKieModule(kieModuleModel); InternalKieModule internalKieModule = ClasspathKieProject.createInternalKieModule(kieModuleModel, releaseId, rootPath); if ( internalKieModule != null ) { KieServices ks = KieServices.Factory.get(); ks.getRepository().addKieModule(internalKieModule); log.info(" :: Added KieModule From KieObjectsInjector ::"); } }
private String parseKModuleRootPath(URL kModuleRootUrl) { return ClasspathKieProject.fixURLFromKProjectPath(kModuleRootUrl); }
@Test public void testParsePomPropertiesFromJarFile() throws Exception { createKieModule(MODULE_JARFILE_NAME, true, MODULE_JARFILE_VERSION); final File kModuleFile = getFileManager().newFile(MODULE_JARFILE_NAME + "-" + MODULE_JARFILE_VERSION + ".jar"); final String pomProperties = ClasspathKieProject.getPomProperties( kModuleFile.getAbsolutePath() ); checkPomProperties(pomProperties, MODULE_JARFILE_NAME, MODULE_JARFILE_VERSION); }
protected void addKieModuleToRepo(KieModuleModel kieModuleModel) { String rootPath = configFilePath; if ( rootPath.lastIndexOf( ':' ) >= 2 ) { // avoid to trucate Windows paths like C:\my\folder\... rootPath = configFilePath.substring( rootPath.lastIndexOf( ':' ) + 1 ); } KieBuilderImpl.setDefaultsforEmptyKieModule(kieModuleModel); InternalKieModule internalKieModule = ClasspathKieProject.createInternalKieModule(kieModuleModel, releaseId, rootPath); if ( internalKieModule != null ) { KieServices ks = KieServices.Factory.get(); ks.getRepository().addKieModule(internalKieModule); log.info(" :: Added KieModule From KieObjectsInjector ::"); } }
private String parseKModuleRootPath(URL kModuleRootUrl) { return ClasspathKieProject.fixURLFromKProjectPath(kModuleRootUrl); }