Browse Source

HADOOP-7942. Enabling clover coverage reports fails hadoop unit test compilation.


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1@1225411 13f79535-47bb-0310-9956-ffa450edef68
Jitendra Nath Pandey 13 years ago
parent
commit
a7668869a8

+ 3 - 0
CHANGES.txt

@@ -73,6 +73,9 @@ Release 1.1.0 - unreleased
 
 
     HDFS-2702. A single failed name dir can cause the NN to exit. (eli)
     HDFS-2702. A single failed name dir can cause the NN to exit. (eli)
 
 
+    HADOOP-7942. enabling clover coverage reports fails hadoop unit test 
+    compilation. (jitendra)
+
   IMPROVEMENTS
   IMPROVEMENTS
 
 
     MAPREDUCE-2517. Add system tests to Gridmix. (Vinay Thota via amarrk)
     MAPREDUCE-2517. Add system tests to Gridmix. (Vinay Thota via amarrk)

+ 2 - 2
src/test/org/apache/hadoop/fs/TestFileSystem.java

@@ -623,7 +623,7 @@ public class TestFileSystem extends TestCase {
   }
   }
 
 
   @SuppressWarnings("unchecked")
   @SuppressWarnings("unchecked")
-  public <T extends TokenIdentifier> void testCacheForUgi() throws Exception {
+  public void testCacheForUgi() throws Exception {
     final Configuration conf = new Configuration();
     final Configuration conf = new Configuration();
     conf.set("fs.cachedfile.impl", conf.get("fs.file.impl"));
     conf.set("fs.cachedfile.impl", conf.get("fs.file.impl"));
     UserGroupInformation ugiA = UserGroupInformation.createRemoteUser("foo");
     UserGroupInformation ugiA = UserGroupInformation.createRemoteUser("foo");
@@ -650,7 +650,7 @@ public class TestFileSystem extends TestCase {
     //corresponding to the two UGIs
     //corresponding to the two UGIs
     assertNotSame(fsA, fsB);
     assertNotSame(fsA, fsB);
     
     
-    Token<T> t1 = mock(Token.class);
+    Token<? extends TokenIdentifier> t1 = mock(Token.class);
     UserGroupInformation ugiA2 = UserGroupInformation.createRemoteUser("foo");
     UserGroupInformation ugiA2 = UserGroupInformation.createRemoteUser("foo");
     
     
     fsA = ugiA2.doAs(new PrivilegedExceptionAction<FileSystem>() {
     fsA = ugiA2.doAs(new PrivilegedExceptionAction<FileSystem>() {

+ 3 - 3
src/test/org/apache/hadoop/security/TestJobCredentials.java

@@ -59,13 +59,13 @@ public class TestJobCredentials {
   
   
   @SuppressWarnings("unchecked")
   @SuppressWarnings("unchecked")
   @Test 
   @Test 
-  public <T extends TokenIdentifier> void testReadWriteStorage() 
+  public void testReadWriteStorage() 
   throws IOException, NoSuchAlgorithmException{
   throws IOException, NoSuchAlgorithmException{
     // create tokenStorage Object
     // create tokenStorage Object
     Credentials ts = new Credentials();
     Credentials ts = new Credentials();
     
     
-    Token<T> token1 = new Token();
-    Token<T> token2 = new Token();
+    Token<? extends TokenIdentifier> token1 = new Token();
+    Token<? extends TokenIdentifier> token2 = new Token();
     Text service1 = new Text("service1");
     Text service1 = new Text("service1");
     Text service2 = new Text("service2");
     Text service2 = new Text("service2");
     Collection<Text> services = new ArrayList<Text>();
     Collection<Text> services = new ArrayList<Text>();

+ 3 - 3
src/test/org/apache/hadoop/security/TestUserGroupInformation.java

@@ -217,12 +217,12 @@ public class TestUserGroupInformation {
   
   
   @SuppressWarnings("unchecked") // from Mockito mocks
   @SuppressWarnings("unchecked") // from Mockito mocks
   @Test
   @Test
-  public <T extends TokenIdentifier> void testUGITokens() throws Exception {
+  public void testUGITokens() throws Exception {
     UserGroupInformation ugi = 
     UserGroupInformation ugi = 
       UserGroupInformation.createUserForTesting("TheDoctor", 
       UserGroupInformation.createUserForTesting("TheDoctor", 
                                                 new String [] { "TheTARDIS"});
                                                 new String [] { "TheTARDIS"});
-    Token<T> t1 = mock(Token.class);
-    Token<T> t2 = mock(Token.class);
+    Token<? extends TokenIdentifier> t1 = mock(Token.class);
+    Token<? extends TokenIdentifier> t2 = mock(Token.class);
     
     
     ugi.addToken(t1);
     ugi.addToken(t1);
     ugi.addToken(t2);
     ugi.addToken(t2);