@Test public void concurrently_created_daemons_will_always_get_their_own_daemon_directories() { List<Path> daemonDirs = new ArrayList<>(); for (int i = 0; i < 100; i++) { daemonDirs.add(steward.createDaemonDir(jumiHome)); } Set<Path> uniqueDaemonDirs = new HashSet<>(daemonDirs); assertThat("unique daemon dirs", uniqueDaemonDirs.size(), is(daemonDirs.size())); }
@Override public Path createDaemonDir(Path jumiHome) { try { return UniqueDirectories.createUniqueDir(jumiHome.resolve(DAEMONS_DIR), System.currentTimeMillis()); } catch (IOException e) { throw new RuntimeException("Unable to create daemon directory", e); } }
DirBasedSteward implements Steward { @Override public Path createDaemonDir(Path jumiHome) { try { return UniqueDirectories.createUniqueDir(jumiHome.resolve(DAEMONS_DIR), System.currentTimeMillis()); } catch (IOException e) { throw new RuntimeException("Unable to create daemon directory", e); } } }
DirBasedSteward implements Steward { @Override public Path createDaemonDir(Path jumiHome) { try { return UniqueDirectories.createUniqueDir(jumiHome.resolve(DAEMONS_DIR), System.currentTimeMillis()); } catch (IOException e) { throw new RuntimeException("Unable to create daemon directory", e); } } DirBasedSteward(DaemonJar daemonJar); }
DirBasedSteward implements Steward { @Override public Path createDaemonDir(Path jumiHome) { try { return UniqueDirectories.createUniqueDir(jumiHome.resolve(DAEMONS_DIR), System.currentTimeMillis()); } catch (IOException e) { throw new RuntimeException("Unable to create daemon directory", e); } } DirBasedSteward(DaemonJar daemonJar); @Override Path createDaemonDir(Path jumiHome); @Override Path getDaemonJar(Path jumiHome); }
DirBasedSteward implements Steward { @Override public Path createDaemonDir(Path jumiHome) { try { return UniqueDirectories.createUniqueDir(jumiHome.resolve(DAEMONS_DIR), System.currentTimeMillis()); } catch (IOException e) { throw new RuntimeException("Unable to create daemon directory", e); } } DirBasedSteward(DaemonJar daemonJar); @Override Path createDaemonDir(Path jumiHome); @Override Path getDaemonJar(Path jumiHome);  }