return tmpDir + "/" + SolutionDeleterTopFolderName; //$NON-NLS-1$
}
}
public void testTempFileDeleter() throws Exception {
StandaloneSession session = new StandaloneSession( "tempfiledeleter", UUIDUtil.getUUIDAsString() ); // get one with an id. //$NON-NLS-1$
StandaloneTempFileDeleter deleter = new StandaloneTempFileDeleter();
StandaloneApplicationContext appContext = new StandaloneApplicationContext( getSolutionRoot(), "" ); //$NON-NLS-1$ //$NON-NLS-2$
File file1 = appContext.createTempFile( session, "testTempFileDeleter", "txt", true ); //$NON-NLS-1$ //$NON-NLS-2$
assertNotNull( file1 ); // File object was returned
assertTrue( file1.exists() ); // File exists
assertFalse( deleter.hasTempFile( file1.getName() ) ); // Deleter wasn't bound to session, so no delete
// Bind deleter to the session
session.setAttribute( ITempFileDeleter.DELETER_SESSION_VARIABLE, deleter );
File file2 = appContext.createTempFile( session, "testTempFileDeleter", "txt", true ); //$NON-NLS-1$ //$NON-NLS-2$
assertNotNull( file2 ); // File object was returned
assertTrue( file2.exists() ); // File exists
assertTrue( deleter.hasTempFile( file2.getName() ) ); // Deleter is bound to session
// File names should be unique