@Test
public void testRecoverTempFiles()
        throws IOException
{

    LoggingConfiguration configuration = new LoggingConfiguration();
    configuration.setLogPath(new File(tempDir, "launcher.log").getPath());
    File logFile1 = new File(tempDir, "test1.log");
    Files.touch(logFile1);
    File logFile2 = new File(tempDir, "test2.log");
    Files.touch(logFile2);
    File tempLogFile1 = new File(tempDir, "temp1.tmp");
    Files.touch(tempLogFile1);
    File tempLogFile2 = new File(tempDir, "temp2.tmp");
    Files.touch(tempLogFile2);
    Logging logging = Logging.initialize();
    logging.configure(configuration);
    assertTrue(logFile1.exists());
    assertTrue(logFile2.exists());
    assertFalse(tempLogFile1.exists());
    assertFalse(tempLogFile2.exists());
    assertTrue(new File(tempDir, "temp1.log").exists());
    assertTrue(new File(tempDir, "temp2.log").exists());
}