@Test public void throws_exception_if_cannot_create_daemon_directory() throws IOException { Path parentDir = steward.createDaemonDir(jumiHome).getParent(); FileUtils.deleteDirectory(parentDir.toFile()); Files.createFile(parentDir); thrown.expect(RuntimeException.class); thrown.expectMessage("Unable to create daemon directory"); thrown.expectCause(instanceOf(FileAlreadyExistsException.class)); steward.createDaemonDir(jumiHome); }
@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);  }