1
0
Quellcode durchsuchen

HDFS-5357. TestFileSystemAccessService failures in JDK7 (Robert Parker via jeagles)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.23@1532112 13f79535-47bb-0310-9956-ffa450edef68
Jonathan Turner Eagles vor 11 Jahren
Ursprung
Commit
c09c316c93

+ 10 - 0
hadoop-hdfs-project/hadoop-hdfs-httpfs/src/test/java/org/apache/hadoop/lib/service/hadoop/TestFileSystemAccessService.java

@@ -27,6 +27,7 @@ import org.apache.hadoop.lib.server.ServiceException;
 import org.apache.hadoop.lib.service.FileSystemAccess;
 import org.apache.hadoop.lib.service.FileSystemAccessException;
 import org.apache.hadoop.lib.service.instrumentation.InstrumentationService;
+import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.test.HFSTestCase;
 import org.apache.hadoop.test.TestDir;
 import org.apache.hadoop.test.TestDirHelper;
@@ -35,12 +36,21 @@ import org.apache.hadoop.test.TestHdfs;
 import org.apache.hadoop.test.TestHdfsHelper;
 import org.apache.hadoop.util.StringUtils;
 import org.junit.Test;
+import org.junit.BeforeClass;
 
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.util.Arrays;
 
 public class TestFileSystemAccessService extends HFSTestCase {
 
+  @BeforeClass
+  public static void classSetup() throws IOException {
+    // This ensures static initializers are called before any tests run
+    Configuration conf = new Configuration(false);
+    UserGroupInformation.setConfiguration(conf);
+  }
+
   @Test
   @TestDir
   public void simpleSecurity() throws Exception {

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -44,6 +44,9 @@ Release 0.23.10 - UNRELEASED
     HDFS-4482. ReplicationMonitor thread can exit with NPE due to the race
     between delete and replication of same file. (umamahesh)
 
+    HDFS-5357. TestFileSystemAccessService failures in JDK7 (Robert Parker via
+    jeagles)
+
 Release 0.23.9 - 2013-07-08
 
   INCOMPATIBLE CHANGES