本文整理匯總了Java中org.kie.workbench.common.services.shared.project.KieModuleService.resolvePackage方法的典型用法代碼示例。如果您正苦於以下問題:Java KieModuleService.resolvePackage方法的具體用法?Java KieModuleService.resolvePackage怎麽用?Java KieModuleService.resolvePackage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.kie.workbench.common.services.shared.project.KieModuleService
的用法示例。
在下文中一共展示了KieModuleService.resolvePackage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testResolvePackageWithNonProjectPath
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithNonProjectPath() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL testUrl = this.getClass().getResource("/");
final org.uberfire.java.nio.file.Path testNioPath = fs.getPath(testUrl.toURI());
final Path testPath = paths.convert(testNioPath);
//Test a non-Project Path resolves to null
final Package result = moduleService.resolvePackage(testPath);
assertNull(result);
}
示例2: testResolvePackageWithSrcPath
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithSrcPath() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoKModule/src");
final org.uberfire.java.nio.file.Path nioRootPath = fs.getPath(rootUrl.toURI());
final Path rootPath = paths.convert(nioRootPath);
//Test a non-Project Path resolves to null
final Package result = moduleService.resolvePackage(rootPath);
assertNull(result);
}
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:18,代碼來源:ModuleServiceImplResolvePackageInvalidNoKModuleTest.java
示例3: testResolvePackageWithSrcPath
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithSrcPath() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoPOM/src");
final org.uberfire.java.nio.file.Path nioRootPath = fs.getPath(rootUrl.toURI());
final Path rootPath = paths.convert(nioRootPath);
//Test a non-Project Path resolves to null
final Package result = moduleService.resolvePackage(rootPath);
assertNull(result);
}
示例4: testResolvePackageWithMainPath
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithMainPath() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoPOM/src/main");
final org.uberfire.java.nio.file.Path nioRootPath = fs.getPath(rootUrl.toURI());
final Path rootPath = paths.convert(nioRootPath);
//Test a non-Project Path resolves to null
final Package result = moduleService.resolvePackage(rootPath);
assertNull(result);
}
示例5: testResolvePackageDefaultResources
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageDefaultResources() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoKModule/src/main/resources");
final org.uberfire.java.nio.file.Path nioRootPath = fs.getPath(rootUrl.toURI());
final Path rootPath = paths.convert(nioRootPath);
final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoKModule/src/main/resources");
final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
final Path testPath = paths.convert(nioTestPath);
//Test a non-Project Path resolves to null
final Package result = moduleService.resolvePackage(testPath);
assertNull(result);
}
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:22,代碼來源:ModuleServiceImplResolvePackageInvalidNoKModuleTest.java
示例6: testResolvePackageDefaultResources
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageDefaultResources() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoPOM/src/main/resources");
final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
final Path testPath = paths.convert(nioTestPath);
//Test a non-Project Path resolves to null
final Package result = moduleService.resolvePackage(testPath);
assertNull(result);
}
示例7: testResolvePackageWithJavaFileInDefaultPackage
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithJavaFileInDefaultPackage() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoPOM/src/main/java/Bean.java");
final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
final Path testPath = paths.convert(nioTestPath);
//Test a non-Project Path resolves to null
final Package result = moduleService.resolvePackage(testPath);
assertNull(result);
}
示例8: testResolvePackageWithJavaFileInSubPackage
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithJavaFileInSubPackage() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoPOM/src/main/java/org/kie/test/Bean.java");
final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
final Path testPath = paths.convert(nioTestPath);
//Test a non-Project Path resolves to null
final Package result = moduleService.resolvePackage(testPath);
assertNull(result);
}
示例9: testResolvePackageWithResourcesFileInDefaultPackage
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithResourcesFileInDefaultPackage() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureValid/src/main/resources/rule1.drl");
final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
final Path testPath = paths.convert(nioTestPath);
//Test a Resources file resolves to the containing package
final Package result = moduleService.resolvePackage(testPath);
assertEquals("",
result.getPackageName());
}
示例10: testResolvePackageWithResourcesFileInSubPackage
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithResourcesFileInSubPackage() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoPOM/src/main/resources/org/kie/test/rule1.drl");
final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
final Path testPath = paths.convert(nioTestPath);
//Test a non-Project Path resolves to null
final Package result = moduleService.resolvePackage(testPath);
assertNull(result);
}
示例11: testResolvePackageWithRootPath
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithRootPath() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureValid");
final org.uberfire.java.nio.file.Path nioRootPath = fs.getPath(rootUrl.toURI());
final Path rootPath = paths.convert(nioRootPath);
//Test a root resolves to null
final Package result = moduleService.resolvePackage(rootPath);
assertNull(result);
}
示例12: testResolvePackageWithSrcPath
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithSrcPath() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureValid/src");
final org.uberfire.java.nio.file.Path nioRootPath = fs.getPath(rootUrl.toURI());
final Path rootPath = paths.convert(nioRootPath);
//Test a root/src resolves to null
final Package result = moduleService.resolvePackage(rootPath);
assertNull(result);
}
示例13: testResolvePackageWithMainPath
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithMainPath() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureValid/src/main");
final org.uberfire.java.nio.file.Path nioRootPath = fs.getPath(rootUrl.toURI());
final Path rootPath = paths.convert(nioRootPath);
//Test a root/src/main resolves to null
final Package result = moduleService.resolvePackage(rootPath);
assertNull(result);
}
示例14: testResolvePackageDefaultJava
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageDefaultJava() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureValid/src/main/java");
final org.uberfire.java.nio.file.Path nioRootPath = fs.getPath(rootUrl.toURI());
final Path rootPath = paths.convert(nioRootPath);
final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureValid/src/main/java");
final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
final Path testPath = paths.convert(nioTestPath);
//Test /src/main/java resolves as the default package
final Package result = moduleService.resolvePackage(testPath);
assertEquals(rootPath.toURI(),
result.getPackageMainSrcPath().toURI());
}
示例15: testResolvePackageWithKModuleFile
import org.kie.workbench.common.services.shared.project.KieModuleService; //導入方法依賴的package包/類
@Test
public void testResolvePackageWithKModuleFile() throws Exception {
final Bean moduleServiceBean = (Bean) beanManager.getBeans(KieModuleService.class).iterator().next();
final CreationalContext cc = beanManager.createCreationalContext(moduleServiceBean);
final KieModuleService moduleService = (KieModuleService) beanManager.getReference(moduleServiceBean,
KieModuleService.class,
cc);
final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureValid/src/main/resources/META-INF/kmodule.xml");
final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
final Path testPath = paths.convert(nioTestPath);
//Test a kModule.xml file resolves to a null package
final Package result = moduleService.resolvePackage(testPath);
assertNull(result);
}