@Test public void checkThatNewlyCreatedFileCanBeWrittenTo() throws Exception { String thisFilename = randomFilename(); FileHandler myFile = new FileHandler(thisFilename, true); myFile.write("This file can be written to."); myFile.close(); }
@Test(expected = IOException.class) public void ifFileDoesNotExistItIsNotCreatedByDefault() throws Exception { FileHandler myFile = new FileHandler(randomFilename()); myFile.getFile(); }