EurostagDDB { Path findGenerator(String idDdb) { return generators.get(idDdb); } EurostagDDB(List<Path> ddbDirs);   }
@Test public void testLinkFiles() throws IOException { try (FileSystem fs = Jimfs.newFileSystem(Configuration.unix())) { Path folder = Files.createDirectory(fs.getPath("/tmp")); Path dataFile = Files.createFile(folder.resolve("generator.data")); Files.createSymbolicLink(folder.resolve("generator1.tg"), dataFile); Files.createSymbolicLink(folder.resolve("generator2.tg"), dataFile); Files.createSymbolicLink(folder.resolve("generator3.tg"), dataFile); Path generator4 = Files.createFile(folder.resolve("generator4.tg")); EurostagDDB eurostagDDB = new EurostagDDB(Collections.singletonList(folder)); assertEquals(dataFile, eurostagDDB.findGenerator("generator1")); assertEquals(dataFile, eurostagDDB.findGenerator("generator2")); assertEquals(dataFile, eurostagDDB.findGenerator("generator3")); assertEquals(generator4, eurostagDDB.findGenerator("generator4")); } }
@Test public void testLinkDirectory() throws IOException { try (FileSystem fs = Jimfs.newFileSystem(Configuration.unix())) { Path folder = Files.createDirectory(fs.getPath("/folder")); Path file = Files.createFile(folder.resolve("generator.tg")); Path linkFolder = Files.createSymbolicLink(fs.getPath("/work/folder.link"), folder); EurostagDDB eurostagDDB = new EurostagDDB(Collections.singletonList(linkFolder)); assertEquals(file, eurostagDDB.findGenerator("generator")); } }