Sources implements Verifiable { public List<CfgFile> getFiles() { return getFiles(orderBy, sort); } Sources(String orderBy, String sort);  Sources(String orderBy);  Sources(); List<CfgFile> getFiles(); void addFile(CfgFile file); void addFiles(Collection<CfgFile> files); int getFileUsage(File f); @Override void verify(); boolean hasFileOverLimit(long limit); List<CfgFile> getFilesOverLimit(long limit); List<CfgFile> getFilesUnderLimit(long limit); Listener getListener(); void setListener(Listener listener);  }
@Test public void testGetFiles() throws InvalidSyntaxException { Sources sources = new Sources("size", "desc"); sources.addFiles(Arrays.asList( new CfgFile(new File("./src/test/resources/sources-getfiles/toto.txt")), new CfgFile(new File("./src/test/resources/sources-getfiles/tata.txt")), new CfgFile(new File("./src/test/resources/sources-getfiles/titi.txt")) )); List<CfgFile> files = sources.getFiles(); List<String> filesInString = new ArrayList<>(files.size()); for (CfgFile file : files) { filesInString.add(file.getSource().getAbsolutePath()); } Assert.assertArrayEquals( "files mismatch", Arrays.asList( new File("./src/test/resources/sources-getfiles/titi.txt").getAbsolutePath(), new File("./src/test/resources/sources-getfiles/toto.txt").getAbsolutePath(), new File("./src/test/resources/sources-getfiles/tata.txt").getAbsolutePath() ).toArray(), filesInString.toArray() ); }
@Test() public void testFolderPattern() throws Exception { GauloisPipe piper = new GauloisPipe(configFactory); ConfigUtil cu = new ConfigUtil(configFactory.getConfiguration(), piper.getUriResolver(), "./src/test/resources/sources-folder.xml"); Config cfg = cu.buildConfig(emptyInputParams); assertEquals(0, cfg.getSources().getFiles().size()); }