@Test public void testWaitFor50millisNonStartedMuxer() throws Exception { exception.expect(IllegalStateException.class); muxer.waitFor(50, MILLISECONDS); }
public int waitFor() throws InterruptedException { switch (state()) { case NOT_STARTED: throw new IllegalStateException("Not started"); case FAILED: return process != null ? process.exitValue() : -127; case RUNNING: case SUCCESSFUL: return process.waitFor(); default: throw new IllegalStateException("BUG: Unkown state"); } }
Muxer { public int waitFor() throws InterruptedException { switch (state()) { case NOT_STARTED: throw new IllegalStateException("Not started"); case FAILED: return process != null ? process.exitValue() : -127; case RUNNING: case SUCCESSFUL: return process.waitFor(); default: throw new IllegalStateException("BUG: Unkown state"); } } }
Muxer { public int waitFor() throws InterruptedException { switch (state()) { case NOT_STARTED: throw new IllegalStateException("Not started"); case FAILED: return process != null ? process.exitValue() : -127; case RUNNING: case SUCCESSFUL: return process.waitFor(); default: throw new IllegalStateException("BUG: Unkown state"); } } private  Muxer(Path mkv, Path srt, Path tempDir, ProcessBuilderFactory factory, Sleeper sleeper); }
Muxer { public int waitFor() throws InterruptedException { switch (state()) { case NOT_STARTED: throw new IllegalStateException("Not started"); case FAILED: return process != null ? process.exitValue() : -127; case RUNNING: case SUCCESSFUL: return process.waitFor(); default: throw new IllegalStateException("BUG: Unkown state"); } } private  Muxer(Path mkv, Path srt, Path tempDir, ProcessBuilderFactory factory, Sleeper sleeper); static Muxer of(Path mkv, Path srt, Path tempDir); void start(); State state(); int waitFor(); boolean waitFor(long timeout, TimeUnit unit); Optional<Path> getOutput(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); Path getMkv(); boolean waitForOutput(); }
Muxer { public int waitFor() throws InterruptedException { switch (state()) { case NOT_STARTED: throw new IllegalStateException("Not started"); case FAILED: return process != null ? process.exitValue() : -127; case RUNNING: case SUCCESSFUL: return process.waitFor(); default: throw new IllegalStateException("BUG: Unkown state"); } } private  Muxer(Path mkv, Path srt, Path tempDir, ProcessBuilderFactory factory, Sleeper sleeper); static Muxer of(Path mkv, Path srt, Path tempDir); void start(); State state(); int waitFor(); boolean waitFor(long timeout, TimeUnit unit); Optional<Path> getOutput(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); Path getMkv(); boolean waitForOutput();  }