Deactivate logging for the test.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 17 Mar 2014 20:05:38 +0000 (21:05 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Mon, 17 Mar 2014 20:05:38 +0000 (21:05 +0100)
src/test/java/net/pterodactylus/rhynodge/states/StateManagerTest.java

index a7361f9..5837846 100644 (file)
@@ -2,6 +2,8 @@ package net.pterodactylus.rhynodge.states;
 
 import static com.google.common.base.Charsets.UTF_8;
 import static com.google.common.base.Objects.equal;
+import static org.apache.log4j.Level.OFF;
+import static org.apache.log4j.Logger.getLogger;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.Matchers.is;
 
@@ -14,6 +16,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 import com.google.common.base.Optional;
 import com.google.common.io.Files;
 import org.hamcrest.Matchers;
+import org.junit.BeforeClass;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
@@ -30,6 +33,11 @@ public class StateManagerTest {
        private final File statePath;
        private final StateManager stateManager;
 
+       @BeforeClass
+       public static void deactivateLogging() {
+               getLogger(StateManager.class).setLevel(OFF);
+       }
+
        public StateManagerTest() throws IOException {
                tempFolder.create();
                statePath = tempFolder.newFolder();