ModuleUtils { public static boolean isExcluded(Module module, String[] excludedModules) { if (excludedModules == null) { return false; } List<String> stringList = Arrays.asList(excludedModules); return stringList.contains(module.getSymbolicName()); }  static Module[] removeDoubles(Module[] modules); static boolean isExcluded(Module module, String[] excludedModules); static String retrieveYear(Module module); static String retrieveSize(Module module); static Module[] cleanModules(Module[] modules, Reader exclusionListReader); static boolean isExcluded(String module, Reader exclusionListReader); static String symbolicToReadableName(String symbolicName, Module[] modules);  }
@Test public void testIsIncluded() throws Exception { final List<URL> pomList = new LinkedList<>(); pomList.add(getClass().getResource("beam_pom.xml")); pomList.add(getCurrentCeresPom()); final File exclusionList = new File(ExclusionListBuilder.EXCLUSION_LIST_FILENAME); ExclusionListBuilder.generateExclusionList(exclusionList, pomList); try (CsvReader csvReader = new CsvReader(new FileReader(exclusionList), CSV_SEPARATOR_ARRAY)) { final String[] excludedModules = csvReader.readRecord(); assertEquals(false, ModuleUtils.isExcluded(modules.get(0), excludedModules)); assertEquals(true, ModuleUtils.isExcluded(modules.get(1), excludedModules)); assertEquals(true, ModuleUtils.isExcluded(modules.get(2), excludedModules)); } }
@Test public void testFileBasedIsIncluded() throws Exception { String moduleString = "some-beam-module,ceres-glayer, ceres-jai,ceres-main-module"; try (CsvReader csvReader = new CsvReader(new StringReader(moduleString), CSV_SEPARATOR_ARRAY)) { final String[] excludedModules = csvReader.readRecord(); assertEquals(false, ModuleUtils.isExcluded(modules.get(0), excludedModules)); assertEquals(true, ModuleUtils.isExcluded(modules.get(1), excludedModules)); assertEquals(true, ModuleUtils.isExcluded(modules.get(2), excludedModules)); } }