File tempFile = TempFile.createTempFile("test", ".txt");
FileWriter w = new FileWriter(tempFile);
w.write("testing");
w.close();
assertTrue(tempFile.exists());
assertEquals("poifiles", tempFile.getParentFile().getName());
// Can't think of a good way to check whether a file is actually deleted since it would require the VM to stop.