Set ConsoleLogger not to use log file after running ConsoleLoggerTest

This commit is contained in:
ljacqu 2016-07-22 22:49:11 +02:00
parent cf3d84e3c1
commit 2d10b46df2

View File

@ -6,6 +6,7 @@ import fr.xephi.authme.settings.properties.PluginSettings;
import fr.xephi.authme.settings.properties.SecuritySettings;
import fr.xephi.authme.util.StringUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@ -68,6 +69,16 @@ public class ConsoleLoggerTest {
ConsoleLogger.close();
}
/**
* Resets the ConsoleLogger back to its defaults after running all tests. Especially important
* is that we no longer enable logging to a file as the log file we've supplied will no longer
* be around after this test class has finished.
*/
@AfterClass
public static void resetConsoleToDefault() {
ConsoleLogger.setLoggingOptions(newSettings(false, LogLevel.FINE));
}
@Test
public void shouldLogToFile() throws IOException {
// given