From ceacadc51e58bb94ad3f3669488515a61e886d88 Mon Sep 17 00:00:00 2001 From: Akira Ajisaka Date: Tue, 1 Aug 2017 14:56:42 +0900 Subject: [PATCH] MAPREDUCE-6921. TestUmbilicalProtocolWithJobToken#testJobTokenRpc fails. --- .../TestUmbilicalProtocolWithJobToken.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java index d1004b64dd..5d536639fe 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/mapreduce/security/TestUmbilicalProtocolWithJobToken.java @@ -29,12 +29,10 @@ import java.net.InetSocketAddress; import java.security.PrivilegedExceptionAction; -import org.apache.commons.logging.*; -import org.apache.commons.logging.impl.Log4JLogger; - import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.io.Text; +import org.apache.hadoop.test.GenericTestUtils; import org.apache.hadoop.ipc.Client; import org.apache.hadoop.ipc.RPC; import org.apache.hadoop.ipc.Server; @@ -49,9 +47,10 @@ import org.apache.hadoop.security.SaslRpcServer; import org.apache.hadoop.security.SecurityUtil; import org.apache.hadoop.security.UserGroupInformation; - -import org.apache.log4j.Level; +import org.slf4j.Logger; +import org.slf4j.event.Level; import org.junit.Test; +import static org.slf4j.LoggerFactory.getLogger; /** Unit tests for using Job Token over RPC. * @@ -62,8 +61,7 @@ public class TestUmbilicalProtocolWithJobToken { private static final String ADDRESS = "0.0.0.0"; - public static final Log LOG = LogFactory - .getLog(TestUmbilicalProtocolWithJobToken.class); + public static final Logger LOG = getLogger(TestUmbilicalProtocolWithJobToken.class); private static Configuration conf; static { @@ -73,11 +71,11 @@ public class TestUmbilicalProtocolWithJobToken { } static { - ((Log4JLogger) Client.LOG).getLogger().setLevel(Level.ALL); - ((Log4JLogger) Server.LOG).getLogger().setLevel(Level.ALL); - ((Log4JLogger) SaslRpcClient.LOG).getLogger().setLevel(Level.ALL); - ((Log4JLogger) SaslRpcServer.LOG).getLogger().setLevel(Level.ALL); - ((Log4JLogger) SaslInputStream.LOG).getLogger().setLevel(Level.ALL); + GenericTestUtils.setLogLevel(Client.LOG, Level.TRACE); + GenericTestUtils.setLogLevel(Server.LOG, Level.TRACE); + GenericTestUtils.setLogLevel(SaslRpcClient.LOG, Level.TRACE); + GenericTestUtils.setLogLevel(SaslRpcServer.LOG, Level.TRACE); + GenericTestUtils.setLogLevel(SaslInputStream.LOG, Level.TRACE); } @Test