@Test(expected = RuntimeException.class) public void requireThatExceptionIsThrowIfFileNotFound() throws IOException { File file = new File("mydir1"); file.delete(); assertTrue(file.mkdir()); new FileLogTarget(file).open(); }
public synchronized OutputStream open() { try { close(); fileOutputStream = new FileOutputStream(file, true); } catch (FileNotFoundException e) { throw new RuntimeException("Unable to open output stream", e); } return fileOutputStream; }
FileLogTarget implements LogTarget { public synchronized OutputStream open() { try { close(); fileOutputStream = new FileOutputStream(file, true); } catch (FileNotFoundException e) { throw new RuntimeException("Unable to open output stream", e); } return fileOutputStream; } }
FileLogTarget implements LogTarget { public synchronized OutputStream open() { try { close(); fileOutputStream = new FileOutputStream(file, true); } catch (FileNotFoundException e) { throw new RuntimeException("Unable to open output stream", e); } return fileOutputStream; } FileLogTarget(File target); }
FileLogTarget implements LogTarget { public synchronized OutputStream open() { try { close(); fileOutputStream = new FileOutputStream(file, true); } catch (FileNotFoundException e) { throw new RuntimeException("Unable to open output stream", e); } return fileOutputStream; } FileLogTarget(File target); synchronized OutputStream open(); synchronized void close(); @Override String toString(); }
FileLogTarget implements LogTarget { public synchronized OutputStream open() { try { close(); fileOutputStream = new FileOutputStream(file, true); } catch (FileNotFoundException e) { throw new RuntimeException("Unable to open output stream", e); } return fileOutputStream; } FileLogTarget(File target); synchronized OutputStream open(); synchronized void close(); @Override String toString();  }