本文整理了Java中org.guvnor.common.services.project.model.Package.getPackageTestSrcPath()
方法的一些代码示例,展示了Package.getPackageTestSrcPath()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Package.getPackageTestSrcPath()
方法的具体详情如下:
包路径:org.guvnor.common.services.project.model.Package
类名称:Package
方法名:getPackageTestSrcPath
暂无
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-services-backend
@Override
public boolean accept(final Path path) {
final Package pkg = moduleService.resolvePackage(path);
if (pkg == null) {
return false;
}
return pkg.getPackageMainSrcPath().equals(path) ||
pkg.getPackageMainResourcesPath().equals(path) ||
pkg.getPackageTestSrcPath().equals(path) ||
pkg.getPackageTestResourcesPath().equals(path);
}
代码示例来源:origin: kiegroup/drools-wb
org.uberfire.java.nio.file.Path getActivatorPath(Package rootModulePackage) {
org.uberfire.java.nio.file.Path packagePath = Paths.convert(rootModulePackage.getPackageTestSrcPath());
return packagePath.resolve(ScenarioJunitActivator.ACTIVATOR_CLASS_NAME + ".java");
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-backend
public List<FolderItem> getItems(final Package pkg,
final ActiveOptions options) {
final List<FolderItem> folderItems = new ArrayList<FolderItem>();
if (pkg == null) {
return emptyList();
}
final Set<Package> childPackages = moduleService.resolvePackages(pkg);
for (final Package childPackage : childPackages) {
folderItems.add(toFolderItem(childPackage));
}
folderItems.addAll(getItems(pkg.getPackageMainSrcPath(),
options));
folderItems.addAll(getItems(pkg.getPackageTestSrcPath(),
options));
folderItems.addAll(getItems(pkg.getPackageMainResourcesPath(),
options));
folderItems.addAll(getItems(pkg.getPackageTestResourcesPath(),
options));
Collections.sort(folderItems,
Sorters.ITEM_SORTER);
return folderItems;
}
代码示例来源:origin: org.kie.workbench.widgets/kie-wb-common-ui
@Override
public Path getTargetPath() {
if (thereIsAnActiveProject()) {
final String path = presenter.getPath().toURI();
final Package selectedPackage = packageListBox.getSelectedPackage();
if (path.contains(ModuleResourcePaths.MAIN_RESOURCES_PATH)) {
return selectedPackage.getPackageMainResourcesPath();
} else if (path.contains(ModuleResourcePaths.MAIN_SRC_PATH)) {
return selectedPackage.getPackageMainSrcPath();
} else if (path.contains(ModuleResourcePaths.TEST_RESOURCES_PATH)) {
return selectedPackage.getPackageTestResourcesPath();
} else if (path.contains(ModuleResourcePaths.TEST_SRC_PATH)) {
return selectedPackage.getPackageTestSrcPath();
}
}
return null;
}
代码示例来源:origin: org.kie.workbench.services/kie-wb-common-datamodel-backend
public void invalidateProjectPackagesCache(@Observes final InvalidateDMOModuleCacheEvent event) {
PortablePreconditions.checkNotNull("event",
event);
final Path resourcePath = event.getResourcePath();
final KieModule module = moduleService.resolveModule(resourcePath);
//If resource was not within a Module there's nothing to invalidate
if (module == null) {
return;
}
final String moduleUri = module.getRootPath().toURI();
final List<Package> cacheEntriesToInvalidate = new ArrayList<Package>();
for (final Package pkg : getKeys()) {
final Path packageMainSrcPath = pkg.getPackageMainSrcPath();
final Path packageTestSrcPath = pkg.getPackageTestSrcPath();
final Path packageMainResourcesPath = pkg.getPackageMainResourcesPath();
final Path packageTestResourcesPath = pkg.getPackageTestResourcesPath();
if (packageMainSrcPath != null && packageMainSrcPath.toURI().startsWith(moduleUri)) {
cacheEntriesToInvalidate.add(pkg);
} else if (packageTestSrcPath != null && packageTestSrcPath.toURI().startsWith(moduleUri)) {
cacheEntriesToInvalidate.add(pkg);
} else if (packageMainResourcesPath != null && packageMainResourcesPath.toURI().startsWith(moduleUri)) {
cacheEntriesToInvalidate.add(pkg);
} else if (packageTestResourcesPath != null && packageTestResourcesPath.toURI().startsWith(moduleUri)) {
cacheEntriesToInvalidate.add(pkg);
}
}
for (final Package pkg : cacheEntriesToInvalidate) {
invalidateCache(pkg);
}
}
代码示例来源:origin: kiegroup/drools-wb
@Before
public void setup() throws Exception {
Set<Package> packages = new HashSet<>();
packages.add(new Package(path, path, path, path, path, "Test", "", ""));
when(kieModuleService.resolveModule(any())).thenReturn(module);
when(kieModuleService.resolvePackages(any(KieModule.class))).thenReturn(packages);
when(ioService.exists(activatorPath)).thenReturn(false);
when(kieModuleService.resolveModule(any())).thenReturn(module);
when(module.getPom()).thenReturn(projectPom);
when(projectPom.getGav()).thenReturn(gav);
when(gav.getGroupId()).thenReturn("Test");
when(projectPom.getDependencies()).thenReturn(dependencies);
when(ioService.exists(any(org.uberfire.java.nio.file.Path.class))).thenReturn(false);
when(mockedPackage.getPackageTestSrcPath()).thenReturn(path);
when(scenarioSimulationBuilderMock.createSimulation(any(), any(), any())).thenReturn(new Simulation());
service.scenarioSimulationBuilder = scenarioSimulationBuilderMock;
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-data-modeller-backend
/**
* Given a path within a module calculates the expected class name for the given class.
*/
public String calculateClassName(final Module module,
final org.uberfire.backend.vfs.Path path) {
PortablePreconditions.checkNotNull("module", module);
if (path == null) {
return null;
}
final Package defaultPackage = moduleService.resolveDefaultPackage(module);
if (defaultPackage == null) {
return null;
}
final Path mainSrcNioPath = Paths.convert(defaultPackage.getPackageMainSrcPath());
final Path testSrcNioPath = Paths.convert(defaultPackage.getPackageTestSrcPath());
final Path nioPath = Paths.convert(path);
Path relativePath = null;
if (mainSrcNioPath != null && nioPath.startsWith(mainSrcNioPath)) {
relativePath = mainSrcNioPath.relativize(nioPath);
} else if (testSrcNioPath != null && nioPath.startsWith(testSrcNioPath)) {
relativePath = testSrcNioPath.relativize(nioPath);
}
if (relativePath != null) {
String className = relativePath.toString().replace("/", ".");
return className.substring(0, className.lastIndexOf(".java"));
}
return null;
}
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-backend
when(pkg.getPackageTestSrcPath()).thenReturn(srcTestPath);
when(pkg.getPackageMainResourcesPath()).thenReturn(srcResourcesPath);
when(pkg.getPackageTestResourcesPath()).thenReturn(testResourcesPath);
代码示例来源:origin: org.uberfire/uberfire-project-backend
false));
packageNames.addAll(getPackageNames(nioModuleRootPath,
Paths.convert(pkg.getPackageTestSrcPath()).getParent(),
true,
false,
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-client
final Path pkgTestSrcPath = pkg.getPackageTestSrcPath();
final Path pkgMainResourcesPath = pkg.getPackageMainResourcesPath();
final Path pkgTestResourcesPath = pkg.getPackageTestResourcesPath();
代码示例来源:origin: kiegroup/appformer
false));
packageNames.addAll(getPackageNames(nioModuleRootPath,
Paths.convert(pkg.getPackageTestSrcPath()).getParent(),
true,
false,
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-backend
public boolean hasAssets(final Package pkg) {
if (pkg == null) {
return false;
}
if (hasAssets(pkg.getPackageMainSrcPath())
|| hasAssets(pkg.getPackageTestSrcPath())
|| hasAssets(pkg.getPackageMainResourcesPath())
|| hasAssets(pkg.getPackageTestResourcesPath())) {
return true;
}
final Set<Package> childPackages = moduleService.resolvePackages(pkg);
for (final Package childPackage : childPackages) {
if (!childPackage.equals(pkg) && hasAssets(childPackage)) {
return true;
}
}
return false;
}
代码示例来源:origin: org.guvnor/guvnor-project-backend
false));
packageNames.addAll(getPackageNames(nioProjectRootPath,
Paths.convert(pkg.getPackageTestSrcPath()).getParent(),
true,
false,
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-client
final Path pkgTestSrcPath = pkg.getPackageTestSrcPath();
final Path pkgMainResourcesPath = pkg.getPackageMainResourcesPath();
final Path pkgTestResourcesPath = pkg.getPackageTestResourcesPath();
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-project-explorer-backend
add(pkg.getPackageMainSrcPath());
add(pkg.getPackageTestResourcesPath());
add(pkg.getPackageTestSrcPath());
}};
add(pkg.getPackageMainSrcPath());
add(pkg.getPackageTestResourcesPath());
add(pkg.getPackageTestSrcPath());
}};
代码示例来源:origin: org.guvnor/guvnor-project-backend
final Path testSrcPath = parentPackage.getPackageTestSrcPath();
final Path mainResourcesPath = parentPackage.getPackageMainResourcesPath();
final Path testResourcesPath = parentPackage.getPackageTestResourcesPath();
代码示例来源:origin: kiegroup/appformer
final Path testSrcPath = parentPackage.getPackageTestSrcPath();
final Path mainResourcesPath = parentPackage.getPackageMainResourcesPath();
final Path testResourcesPath = parentPackage.getPackageTestResourcesPath();
代码示例来源:origin: org.uberfire/uberfire-project-backend
final Path testSrcPath = parentPackage.getPackageTestSrcPath();
final Path mainResourcesPath = parentPackage.getPackageMainResourcesPath();
final Path testResourcesPath = parentPackage.getPackageTestResourcesPath();
代码示例来源:origin: org.kie.workbench.screens/kie-wb-common-data-modeller-backend
when(defaultPackage.getPackageTestSrcPath()).thenReturn(testSrcPath);
内容来源于网络,如有侵权,请联系作者删除!