本文整理了Java中org.guvnor.common.services.project.model.Package.getModuleRootPath()
方法的一些代码示例,展示了Package.getModuleRootPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Package.getModuleRootPath()
方法的具体详情如下:
包路径:org.guvnor.common.services.project.model.Package
类名称:Package
方法名:getModuleRootPath
暂无
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-project-api
public ProjectMetadataImpl build() {
final ProjectMetadataImpl result = new ProjectMetadataImpl(defSetId,
pPkg,
overview,
pName,
projectType);
result.setPath(path);
result.setRoot(pPkg.getModuleRootPath());
result.setTitle(title);
return result;
}
}
代码示例来源:origin: org.jbpm/jbpm-wb-integration-backend
public void configurePackage(@Observes NewPackageEvent pkg) {
if (isCaseProject(Paths.convert(pkg.getPackage().getModuleRootPath()))) {
String resourcesPathStr = Paths.convert(pkg.getPackage().getPackageMainResourcesPath()).toUri().toString();
String separator = Paths.convert(pkg.getPackage().getModuleRootPath()).getFileSystem().getSeparator();
Path resourcesPath = ioService.get(URI.create(resourcesPathStr + separator + WORK_DEFINITION_FILE));
addWorkDefinitions(resourcesPath);
}
}
代码示例来源:origin: kiegroup/jbpm-wb
public void configurePackage(@Observes NewPackageEvent pkg) {
if (isCaseProject(Paths.convert(pkg.getPackage().getModuleRootPath()))) {
String resourcesPathStr = Paths.convert(pkg.getPackage().getPackageMainResourcesPath()).toUri().toString();
String separator = Paths.convert(pkg.getPackage().getModuleRootPath()).getFileSystem().getSeparator();
Path resourcesPath = ioService.get(URI.create(resourcesPathStr + separator + WORK_DEFINITION_FILE));
addWorkDefinitions(resourcesPath);
}
}
代码示例来源:origin: org.jbpm/jbpm-wb-integration-backend
@Test
public void testConfigureNewPackage() {
Path packagePath = Mockito.mock(Path.class);
when(packagePath.toUri()).thenReturn(URI.create("default://p0/Evaluation/src/main/resources/org"));
DirectoryStream directoryStream = Mockito.mock(DirectoryStream.class);
when(ioService.newDirectoryStream(any(),
any())).thenReturn((DirectoryStream<Path>) directoryStream);
when(directoryStream.iterator()).thenReturn(Arrays.asList(packagePath).iterator());
org.guvnor.common.services.project.model.Package pkg = Mockito.mock(org.guvnor.common.services.project.model.Package.class);
when(pkg.getModuleRootPath()).thenReturn(projectPath);
when(pkg.getPackageMainResourcesPath()).thenReturn(projectPath);
NewPackageEvent event = new NewPackageEvent(pkg);
caseProjectService.configurePackage(event);
verify(ioService,
times(1)).write(any(),
any(byte[].class));
}
代码示例来源:origin: kiegroup/jbpm-wb
@Test
public void testConfigureNewPackage() {
Path packagePath = Mockito.mock(Path.class);
when(packagePath.toUri()).thenReturn(URI.create("default://p0/Evaluation/src/main/resources/org"));
DirectoryStream directoryStream = Mockito.mock(DirectoryStream.class);
when(ioService.newDirectoryStream(any(),
any())).thenReturn((DirectoryStream<Path>) directoryStream);
when(directoryStream.iterator()).thenReturn(Arrays.asList(packagePath).iterator());
org.guvnor.common.services.project.model.Package pkg = Mockito.mock(org.guvnor.common.services.project.model.Package.class);
when(pkg.getModuleRootPath()).thenReturn(projectPath);
when(pkg.getPackageMainResourcesPath()).thenReturn(projectPath);
NewPackageEvent event = new NewPackageEvent(pkg);
caseProjectService.configurePackage(event);
verify(ioService,
times(1)).write(any(),
any(byte[].class));
}
代码示例来源:origin: kiegroup/appformer
final Path moduleRoot = pkg.getModuleRootPath();
final org.uberfire.java.nio.file.Path nioModuleRootPath = Paths.convert(moduleRoot);
代码示例来源:origin: org.uberfire/uberfire-project-backend
final Path moduleRoot = pkg.getModuleRootPath();
final org.uberfire.java.nio.file.Path nioModuleRootPath = Paths.convert(moduleRoot);
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-backend
private void setSelectedPackage(final Content content) {
if (content.getSelectedModule() == null) {
content.setSelectedPackage(null);
} else {
final Module selectedModule = content.getSelectedModule();
if (content.getSelectedPackage() != null) {
if (!content.getSelectedPackage().getModuleRootPath().equals(selectedModule.getRootPath())) {
content.setSelectedPackage(null);
content.setSelectedItem(null);
}
}
}
}
代码示例来源:origin: org.kie.workbench.stunner/kie-wb-common-stunner-project-client
@Before
@SuppressWarnings("unchecked")
public void setup() {
when(definitionManager.adapters()).thenReturn(adapterManager);
when(adapterManager.forDefinitionSet()).thenReturn(definitionSetAdapter);
when(definitionManager.definitionSets()).thenReturn(definitionSetRegistry);
when(definitionSetRegistry.getDefinitionSetByType(any(Class.class))).thenReturn(definitionSet);
when(definitionSetRegistry.getDefinitionSetByType(any(Class.class))).thenReturn(definitionSet);
when(definitionSetAdapter.getId(eq(definitionSet))).thenReturn(DEFSET_ID);
when(aPackage.getPackageMainResourcesPath()).thenReturn(path);
when(aPackage.getPackageName()).thenReturn("packageName");
when(aPackage.getModuleRootPath()).thenReturn(moduleRootPath);
when(moduleRootPath.getFileName()).thenReturn(PROJ_ROOT_FILENAME);
when(context.getActiveModule()).thenReturn(Optional.of(module));
when(module.getModuleName()).thenReturn(MODULE_NAME);
when(projectDiagramResourceType.getSuffix()).thenReturn("bpmn2");
when(projectDiagramResourceType.getPrefix()).thenReturn("");
this.tested = new ProjectDiagramNewResourceHandlerStub(definitionManager,
projectDiagramServices,
indicatorView,
projectDiagramResourceType);
}
代码示例来源:origin: org.uberfire/uberfire-project-backend
final org.uberfire.java.nio.file.Path nioModuleRootPath = Paths.convert(pkg.getModuleRootPath());
packageNames.addAll(getPackageNames(nioModuleRootPath,
Paths.convert(pkg.getPackageMainSrcPath()).getParent(),
代码示例来源:origin: kiegroup/appformer
final org.uberfire.java.nio.file.Path nioModuleRootPath = Paths.convert(pkg.getModuleRootPath());
packageNames.addAll(getPackageNames(nioModuleRootPath,
Paths.convert(pkg.getPackageMainSrcPath()).getParent(),
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-backend
private void setSelectedItem(final Content content) {
if (content.getSelectedModule() == null) {
content.setSelectedItem(null);
} else {
final Module selectedModule = content.getSelectedModule();
if (content.getSelectedItem() != null) {
if (content.getSelectedItem().getItem() instanceof Package) {
final Package pkg = (Package) content.getSelectedItem().getItem();
if (!pkg.getModuleRootPath().equals(selectedModule.getRootPath())) {
content.setSelectedPackage(null);
content.setSelectedItem(null);
}
} else if (content.getSelectedItem().getItem() instanceof Path) {
final Path itemPath = (Path) content.getSelectedItem().getItem();
final Module owningModule = moduleService.resolveModule(itemPath);
if (!owningModule.getRootPath().equals(selectedModule.getRootPath())) {
content.setSelectedPackage(null);
content.setSelectedItem(null);
}
}
}
}
}
内容来源于网络,如有侵权,请联系作者删除!