@Test public void getTestExportedResourcesTest() throws IOException { File jar1 = new File(testResourcesFolder, JAR_1); File jar2 = new File(testResourcesFolder, JAR_2); File jar3Folder = new File(testResourcesFolder, JAR_3_LOCATION); File jar3 = new File(jar3Folder, JAR_3); jar1.createNewFile(); jar2.createNewFile(); jar3Folder.mkdirs(); jar3.createNewFile(); resolver = newResolver(new ProjectStructure(temporaryFolder.getRoot().toPath(), true), mock(Pom.class), new ArrayList<>()); List<String> actualExportedResources = resolver.getTestExportedResources(); assertThat("Exported resources does not contain all expected elements", actualExportedResources, containsInAnyOrder(JAR_1, JAR_2, JAR_3_LOCATION + separator + JAR_3)); assertThat("Exported resources contains more elements than expected", actualExportedResources.size(), equalTo(3)); }
public List<String> getExportedResources() throws IOException { if (exportedResources == null) { exportedResources = new ArrayList<>(); for (Path resourcePath : pom.getResourcesLocation()) { exportedResources.addAll(getResources(resourcePath)); } if (!pom.getResourcesLocation() .stream() .anyMatch(path -> path.endsWith(get("src", "main", "mule")))) { exportedResources.addAll(getResources(projectStructure.getConfigsPath())); } } return exportedResources; }
MuleArtifactContentResolver { public List<String> getExportedResources() throws IOException { if (exportedResources == null) { exportedResources = new ArrayList<>(); for (Path resourcePath : pom.getResourcesLocation()) { exportedResources.addAll(getResources(resourcePath)); } if (!pom.getResourcesLocation() .stream() .anyMatch(path -> path.endsWith(get("src", "main", "mule")))) { exportedResources.addAll(getResources(projectStructure.getConfigsPath())); } } return exportedResources; } }
MuleArtifactContentResolver { public List<String> getExportedResources() throws IOException { if (exportedResources == null) { exportedResources = new ArrayList<>(); for (Path resourcePath : pom.getResourcesLocation()) { exportedResources.addAll(getResources(resourcePath)); } if (!pom.getResourcesLocation() .stream() .anyMatch(path -> path.endsWith(get("src", "main", "mule")))) { exportedResources.addAll(getResources(projectStructure.getConfigsPath())); } } return exportedResources; } MuleArtifactContentResolver(ProjectStructure projectStructure, Pom pom, List<BundleDependency> bundleDependencies); }
MuleArtifactContentResolver { public List<String> getExportedResources() throws IOException { if (exportedResources == null) { exportedResources = new ArrayList<>(); for (Path resourcePath : pom.getResourcesLocation()) { exportedResources.addAll(getResources(resourcePath)); } if (!pom.getResourcesLocation() .stream() .anyMatch(path -> path.endsWith(get("src", "main", "mule")))) { exportedResources.addAll(getResources(projectStructure.getConfigsPath())); } } return exportedResources; } MuleArtifactContentResolver(ProjectStructure projectStructure, Pom pom, List<BundleDependency> bundleDependencies); ProjectStructure getProjectStructure(); List<String> getExportedPackages(); List<String> getExportedResources(); List<String> getTestExportedResources(); List<String> getConfigs(); List<String> getTestConfigs(); static String escapeSlashes(String p); List<BundleDependency> getBundleDependencies(); Pom getPom(); }
MuleArtifactContentResolver { public List<String> getExportedResources() throws IOException { if (exportedResources == null) { exportedResources = new ArrayList<>(); for (Path resourcePath : pom.getResourcesLocation()) { exportedResources.addAll(getResources(resourcePath)); } if (!pom.getResourcesLocation() .stream() .anyMatch(path -> path.endsWith(get("src", "main", "mule")))) { exportedResources.addAll(getResources(projectStructure.getConfigsPath())); } } return exportedResources; } MuleArtifactContentResolver(ProjectStructure projectStructure, Pom pom, List<BundleDependency> bundleDependencies); ProjectStructure getProjectStructure(); List<String> getExportedPackages(); List<String> getExportedResources(); List<String> getTestExportedResources(); List<String> getConfigs(); List<String> getTestConfigs(); static String escapeSlashes(String p); List<BundleDependency> getBundleDependencies(); Pom getPom(); static final String CLASS_PATH_SEPARATOR; }