當前位置: 首頁>>代碼示例>>Java>>正文


Java KieModuleService類代碼示例

本文整理匯總了Java中org.kie.workbench.common.services.shared.project.KieModuleService的典型用法代碼示例。如果您正苦於以下問題:Java KieModuleService類的具體用法?Java KieModuleService怎麽用?Java KieModuleService使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


KieModuleService類屬於org.kie.workbench.common.services.shared.project包,在下文中一共展示了KieModuleService類的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);
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:18,代碼來源:ModuleServiceImplResolvePackageInvalidNoKModuleTest.java

示例2: setUp

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Before
public void setUp() throws Exception {
    PackageNameSearchProvider.PackageNameSearch nameSearch = mock(PackageNameSearchProvider.PackageNameSearch.class);
    when(nameSearch.search()).thenReturn(new HashSet<String>());
    when(packageNameSearchProvider.newTopLevelPackageNamesSearch(any(POM.class))).thenReturn(nameSearch);
    super.startWeld();
    setUpGuvnorM2Repo();

    ioService = getReference(IOService.class);
    moduleService = getReference(KieModuleService.class);
    importsService = getReference(ProjectImportsService.class);
    dependenciesClassLoaderCache = getReference(LRUModuleDependenciesClassLoaderCache.class);
    pomModelCache = getReference(LRUPomModelCache.class);
    buildService = getReference(BuildService.class);
    validator = getReference(DefaultGenericKieValidator.class);
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:17,代碼來源:BuilderTest.java

示例3: FormEditorServiceImpl

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Inject
public FormEditorServiceImpl(@Named("ioStrategy") IOService ioService,
                             SessionInfo sessionInfo,
                             Event<ResourceOpenedEvent> resourceOpenedEvent,
                             FieldManager fieldManager,
                             FormModelHandlerManager modelHandlerManager,
                             KieModuleService moduleService,
                             FormDefinitionSerializer formDefinitionSerializer,
                             VFSFormFinderService vfsFormFinderService,
                             DeleteService deleteService,
                             CommentedOptionFactory commentedOptionFactory,
                             RenameService renameService) {
    this.ioService = ioService;
    this.sessionInfo = sessionInfo;
    this.resourceOpenedEvent = resourceOpenedEvent;
    this.fieldManager = fieldManager;
    this.modelHandlerManager = modelHandlerManager;
    this.moduleService = moduleService;
    this.formDefinitionSerializer = formDefinitionSerializer;
    this.vfsFormFinderService = vfsFormFinderService;
    this.commentedOptionFactory = commentedOptionFactory;
    this.deleteService = deleteService;
    this.renameService = renameService;
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:25,代碼來源:FormEditorServiceImpl.java

示例4: 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 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("",
                 result.getPackageName());
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:19,代碼來源:ModuleServiceImplResolvePackageNameValidTest.java

示例5: testResolveModuleWithResourcesFile

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Test
public void testResolveModuleWithResourcesFile() 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);

    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 child folder resolves to the Module's root
    final Module result = moduleService.resolveModule(testPath);
    assertEquals(rootPath.toURI(),
                 result.getRootPath().toURI());
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:23,代碼來源:ModuleImplResolveModuleValidTest.java

示例6: AppSetup

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Inject
public AppSetup(@Named("ioStrategy") final IOService ioService,
                final RepositoryService repositoryService,
                final OrganizationalUnitService organizationalUnitService,
                final KieModuleService moduleService,
                final ConfigurationService configurationService,
                final ConfigurationFactory configurationFactory,
                final WorkbenchConfigurationHelper workbenchConfigurationHelper,
                final Event<ApplicationStarted> applicationStartedEvent) {
    super(ioService,
          repositoryService,
          organizationalUnitService,
          moduleService,
          configurationService,
          configurationFactory);
    this.workbenchConfigurationHelper = workbenchConfigurationHelper;
    this.applicationStartedEvent = applicationStartedEvent;
}
 
開發者ID:kiegroup,項目名稱:drools-wb,代碼行數:19,代碼來源:AppSetup.java

示例7: testResolveModuleWithJavaFile

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Test
public void testResolveModuleWithJavaFile() 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");
    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/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-Module Path resolves to null
    final Module result = moduleService.resolveModule(testPath);
    assertNull(result);
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:22,代碼來源:ModuleServiceImplResolveModuleInvalidNoKModuleTest.java

示例8: getModuleService

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Override
protected KieModuleService getModuleService() {
    final org.uberfire.backend.vfs.Path mockRoot = mock(org.uberfire.backend.vfs.Path.class);
    when(mockRoot.toURI()).thenReturn(TEST_MODULE_ROOT);

    final KieModule mockModule = mock(KieModule.class);
    when(mockModule.getRootPath()).thenReturn(mockRoot);
    when(mockModule.getModuleName()).thenReturn(TEST_MODULE_NAME);

    POM mockPom = mock(POM.class);
    when(mockModule.getPom()).thenReturn(mockPom);
    GAV mockGAV = mock(GAV.class);
    when(mockPom.getGav()).thenReturn(mockGAV);
    when(mockGAV.toString()).thenReturn(DEPLOYMENT_ID);

    final Package mockPackage = mock(Package.class);
    when(mockPackage.getPackageName()).thenReturn(TEST_PACKAGE_NAME);

    final KieModuleService mockModuleService = mock(KieModuleService.class);
    when(mockModuleService.resolveModule(any(org.uberfire.backend.vfs.Path.class))).thenReturn(mockModule);
    when(mockModuleService.resolvePackage(any(org.uberfire.backend.vfs.Path.class))).thenReturn(mockPackage);

    return mockModuleService;
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:25,代碼來源:BpmnFileIndexerTest.java

示例9: ProjectScreenServiceImpl

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Inject
public ProjectScreenServiceImpl(final WorkspaceProjectService projectService,
                                final RepositoryService repositoryService,
                                final KieModuleService moduleService,
                                final ProjectScreenModelLoader loader,
                                final ProjectScreenModelSaver saver,
                                final RepositoryCopier repositoryCopier,
                                final POMService pomService,
                                final MetadataService metadataService) {
    this.projectService = projectService;
    this.repositoryService = repositoryService;
    this.moduleService = moduleService;
    this.loader = loader;
    this.saver = saver;
    this.repositoryCopier = repositoryCopier;
    this.pomService = pomService;
    this.metadataService = metadataService;
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:19,代碼來源:ProjectScreenServiceImpl.java

示例10: testResolveModuleWithJavaFile

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Test
public void testResolveModuleWithJavaFile() 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);

    final URL testUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureValid/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 child folder resolves to the Module's root
    final Module result = moduleService.resolveModule(testPath);
    assertEquals(rootPath.toURI(),
                 result.getRootPath().toURI());
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:23,代碼來源:ModuleImplResolveModuleValidTest.java

示例11: testIsPOMFileWithPOMFile

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Test
public void testIsPOMFileWithPOMFile() 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/pom.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 boolean result = moduleService.isPom(testPath);
    assertTrue(result);
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:18,代碼來源:ModuleServiceImplResolvePackageValidTest.java

示例12: 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 rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureValid/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("/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(rootPath.toURI(),
                 result.getPackageMainResourcesPath().toURI());
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:23,代碼來源:ModuleServiceImplResolvePackageValidTest.java

示例13: 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 rootUrl = this.getClass().getResource("/ModuleBackendTestModuleStructureInvalidNoKModule/src/main/resources/org/kie/test");
    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/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);
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:22,代碼來源:ModuleServiceImplResolvePackageInvalidNoKModuleTest.java

示例14: ExplorerServiceHelper

import org.kie.workbench.common.services.shared.project.KieModuleService; //導入依賴的package包/類
@Inject
public ExplorerServiceHelper(final KieModuleService moduleService,
                             final FolderListingResolver folderListingResolver,
                             @Named("ioStrategy") final IOService ioService,
                             @Named("configIO") final IOService ioServiceConfig,
                             final VFSLockServiceImpl lockService,
                             final MetadataService metadataService,
                             final UserServicesImpl userServices,
                             final DeleteService deleteService,
                             final RenameService renameService,
                             final CopyService copyService,
                             @Managed final ExecutorService executorService) {
    this();
    this.moduleService = moduleService;
    this.folderListingResolver = folderListingResolver;
    this.ioService = ioService;
    this.ioServiceConfig = ioServiceConfig;
    this.lockService = lockService;
    this.metadataService = metadataService;
    this.userServices = userServices;
    this.deleteService = deleteService;
    this.renameService = renameService;
    this.copyService = copyService;
    this.executorService = executorService;
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:26,代碼來源:ExplorerServiceHelper.java

示例15: 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("/ModuleBackendTestModuleStructureValid/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("/ModuleBackendTestModuleStructureValid/src/main/resources");
    final org.uberfire.java.nio.file.Path nioTestPath = fs.getPath(testUrl.toURI());
    final Path testPath = paths.convert(nioTestPath);

    //Test /src/main/resources resolves as the default package
    final Package result = moduleService.resolvePackage(testPath);
    assertEquals(rootPath.toURI(),
                 result.getPackageMainResourcesPath().toURI());
}
 
開發者ID:kiegroup,項目名稱:kie-wb-common,代碼行數:23,代碼來源:ModuleServiceImplResolvePackageValidTest.java


注:本文中的org.kie.workbench.common.services.shared.project.KieModuleService類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。