tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkupp...@apache.org
Subject [06/41] tinkerpop git commit: TINKERPOP-2005 Set/restore log level in ResponseHandlerContextTest
Date Thu, 09 Aug 2018 17:27:26 GMT
TINKERPOP-2005 Set/restore log level in ResponseHandlerContextTest

This is to allow these tests to capture intended log messages in the
CI environment.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fe9c26f6
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fe9c26f6
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fe9c26f6

Branch: refs/heads/TINKERPOP-1990
Commit: fe9c26f656cf79f513af5b1230f498934a796063
Parents: 0e0d26c
Author: Dmitri Bourlatchkov <dmitri.bourlatchkov@datastax.com>
Authored: Tue Jul 31 12:11:34 2018 -0400
Committer: Dmitri Bourlatchkov <dmitri.bourlatchkov@datastax.com>
Committed: Tue Jul 31 12:11:34 2018 -0400

----------------------------------------------------------------------
 .../tinkerpop/gremlin/server/ResponseHandlerContextTest.java   | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fe9c26f6/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/ResponseHandlerContextTest.java
----------------------------------------------------------------------
diff --git a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/ResponseHandlerContextTest.java
b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/ResponseHandlerContextTest.java
index 13c9992..2babee9 100644
--- a/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/ResponseHandlerContextTest.java
+++ b/gremlin-server/src/test/java/org/apache/tinkerpop/gremlin/server/ResponseHandlerContextTest.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.server;
 
 import io.netty.channel.ChannelHandlerContext;
+import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 import org.apache.tinkerpop.gremlin.driver.message.RequestMessage;
 import org.apache.tinkerpop.gremlin.driver.message.ResponseMessage;
@@ -49,6 +50,8 @@ public class ResponseHandlerContextTest {
     private final ResponseHandlerContext rhc = new ResponseHandlerContext(context);
     private final Log4jRecordingAppender recordingAppender = new Log4jRecordingAppender();
 
+    private Level originalLogLevel;
+
     @Parameterized.Parameters(name = "{0}")
     public static Iterable<Object[]> data() {
         return Arrays.asList(new Object[][] {
@@ -86,11 +89,14 @@ public class ResponseHandlerContextTest {
     public void addRecordingAppender() {
         final Logger rootLogger = Logger.getRootLogger();
         rootLogger.addAppender(recordingAppender);
+        originalLogLevel = rootLogger.getLevel();
+        rootLogger.setLevel(Level.ALL);
     }
 
     @After
     public void removeRecordingAppender() {
         final Logger rootLogger = Logger.getRootLogger();
+        rootLogger.setLevel(originalLogLevel);
         rootLogger.removeAppender(recordingAppender);
     }
 


Mime
View raw message