J2EETempFileFactory implements TemporaryFileFactory { public File prepareRandomNamedTempFile() { return prepareRandomNamedTempFile(""); } J2EETempFileFactory(String tempFileDirID); File getTempFileDir(); File prepareRandomNamedTempFile(); File prepareRandomNamedTempFile(String humanReadableID); File prepareTempFile(String desiredName);  }
@Test public void testPrepareRandomNamedTempFile() { final File tempFile = this.tempFileFactory.prepareRandomNamedTempFile(); assertNotNull("The generated temporary file path should not be null", tempFile.getPath()); }
@Test public void testPrepareRandomNamedTempFileString() { final String humanReadableID = "humanReadable"; final File tempFile = this.tempFileFactory .prepareRandomNamedTempFile(humanReadableID); assertNotNull("The generated temporary file path should not be null", tempFile.getPath()); assertTrue("Did not find the ID in the file name.", tempFile.getPath() .indexOf(humanReadableID) >= 0); }