@Test public void getExportedResourcesTest() throws IOException { File jar1 = new File(resourcesFolder, JAR_1); File jar2 = new File(resourcesFolder, JAR_2); File jar3Folder = new File(resourcesFolder, JAR_3_LOCATION); File jar3 = new File(jar3Folder, JAR_3); String configFileName = "config.xml"; File config = new File(muleFolder, configFileName); File hiddenFile = new File(munitFolder, HIDDEN_FILE); if (System.getProperty("os.name").toLowerCase().equals("win")) { Files.setAttribute(hiddenFile.toPath(), "dos:hidden", true); } jar1.createNewFile(); jar2.createNewFile(); jar3Folder.mkdirs(); jar3.createNewFile(); config.createNewFile(); hiddenFile.createNewFile(); List<String> actualExportedResources = resolver.getExportedResources(); assertThat("Exported resources does not contain all expected elements", actualExportedResources, containsInAnyOrder(JAR_1, JAR_2, JAR_3_LOCATION + separator + JAR_3, configFileName)); assertThat("Configs contain an unexpected elements", actualExportedResources.contains(hiddenFile), is(false)); assertThat("Exported resources contains more elements than expected", actualExportedResources.size(), equalTo(4)); }
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; }