@Test public void packageHasAssetsInsideResourcesPathTest() { doReturn(false).when(helper).hasAssets(srcPath); doReturn(true).when(helper).hasAssets(srcResourcesPath); doReturn(false).when(helper).hasAssets(srcTestPath); doReturn(false).when(helper).hasAssets(testResourcesPath); doReturn(new HashSet<Package>() {{ add(childPkg); }}).when(moduleService).resolvePackages(pkg); doReturn(false).when(helper).hasAssets(childPkg); assertTrue(helper.hasAssets(pkg)); }
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; }
ExplorerServiceHelper { 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; } }
ExplorerServiceHelper { 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; } ExplorerServiceHelper(); @Inject  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); }
ExplorerServiceHelper { 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; } ExplorerServiceHelper(); @Inject  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); FolderItem toFolderItem(final org.guvnor.common.services.project.model.Package pkg); FolderItem toFolderItem(final org.uberfire.java.nio.file.Path path); List<FolderItem> getPackageSegments(final Package _pkg); FolderListing getFolderListing(final FolderItem selectedItem,
                                          final Module selectedModule,
                                          final Package selectedPackage,
                                          final ActiveOptions options); FolderListing getFolderListing(final Package pkg,
                                          final ActiveOptions options); FolderListing getFolderListing(final FolderItem item,
                                          final ActiveOptions options); FolderListing getFolderListing(final Path path,
                                          final ActiveOptions options
    ); boolean hasAssets(final Package pkg); List<FolderItem> getItems(final Package pkg,
                                     final ActiveOptions options); void store(final WorkspaceProject project,
                      final Module selectedModule,
                      final FolderListing folderListing,
                      final Package selectedPackage,
                      final ActiveOptions options); void store(final org.uberfire.java.nio.file.Path userNav,
                      final org.uberfire.java.nio.file.Path lastUserNav,
                      final WorkspaceProject project,
                      final Module module,
                      final Package pkg,
                      final FolderItem item,
                      final ActiveOptions options); UserExplorerData loadUserContent(final org.uberfire.java.nio.file.Path path); UserExplorerData loadUserContent(); UserExplorerLastData getLastContent(); UserExplorerLastData getLastContent(final org.uberfire.java.nio.file.Path path); List<FolderItemOperation> getRestrictedOperations(final Path path); }
ExplorerServiceHelper { 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; } ExplorerServiceHelper(); @Inject  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); FolderItem toFolderItem(final org.guvnor.common.services.project.model.Package pkg); FolderItem toFolderItem(final org.uberfire.java.nio.file.Path path); List<FolderItem> getPackageSegments(final Package _pkg); FolderListing getFolderListing(final FolderItem selectedItem,
                                          final Module selectedModule,
                                          final Package selectedPackage,
                                          final ActiveOptions options); FolderListing getFolderListing(final Package pkg,
                                          final ActiveOptions options); FolderListing getFolderListing(final FolderItem item,
                                          final ActiveOptions options); FolderListing getFolderListing(final Path path,
                                          final ActiveOptions options
    ); boolean hasAssets(final Package pkg); List<FolderItem> getItems(final Package pkg,
                                     final ActiveOptions options); void store(final WorkspaceProject project,
                      final Module selectedModule,
                      final FolderListing folderListing,
                      final Package selectedPackage,
                      final ActiveOptions options); void store(final org.uberfire.java.nio.file.Path userNav,
                      final org.uberfire.java.nio.file.Path lastUserNav,
                      final WorkspaceProject project,
                      final Module module,
                      final Package pkg,
                      final FolderItem item,
                      final ActiveOptions options); UserExplorerData loadUserContent(final org.uberfire.java.nio.file.Path path); UserExplorerData loadUserContent(); UserExplorerLastData getLastContent(); UserExplorerLastData getLastContent(final org.uberfire.java.nio.file.Path path); List<FolderItemOperation> getRestrictedOperations(final Path path);  }