hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1138258 - /hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java
Date Wed, 22 Jun 2011 00:09:30 GMT
Author: stack
Date: Wed Jun 22 00:09:30 2011
New Revision: 1138258

URL: http://svn.apache.org/viewvc?rev=1138258&view=rev
Log:
Fixup of new test TestFSTableDescriptors to pass up on jenkins

Modified:
    hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java?rev=1138258&r1=1138257&r2=1138258&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/util/TestFSTableDescriptors.java Wed
Jun 22 00:09:30 2011
@@ -19,6 +19,7 @@ package org.apache.hadoop.hbase.util;
 
 import static org.junit.Assert.*;
 
+import java.io.FileNotFoundException;
 import java.io.IOException;
 
 import org.apache.hadoop.fs.FileSystem;
@@ -82,7 +83,14 @@ public class TestFSTableDescriptors {
       HTableDescriptor htd = new HTableDescriptor(name + i);
       createHTDInFS(fs, rootdir, htd);
     }
-    FSTableDescriptors htds = new FSTableDescriptors(fs, rootdir);
+    FSTableDescriptors htds = new FSTableDescriptors(fs, rootdir) {
+      @Override
+      public HTableDescriptor get(byte[] tablename)
+          throws TableExistsException, FileNotFoundException, IOException {
+        System.out.println(Bytes.toString(tablename));
+        return super.get(tablename);
+      }
+    };
     for (int i = 0; i < count; i++) {
       assertTrue(htds.get(Bytes.toBytes(name + i)) !=  null);
     }
@@ -95,14 +103,15 @@ public class TestFSTableDescriptors {
       htd.addFamily(new HColumnDescriptor("" + i));
       FSUtils.updateHTableDescriptor(fs, rootdir, htd);
     }
+    Thread.sleep(1000);
     for (int i = 0; i < count; i++) {
       assertTrue(htds.get(Bytes.toBytes(name + i)) !=  null);
     }
     for (int i = 0; i < count; i++) {
       assertTrue(htds.get(Bytes.toBytes(name + i)) !=  null);
     }
-    assertEquals(htds.invocations, count * 4);
-    assertEquals(htds.cachehits, count * 2);
+    assertEquals(count * 4, htds.invocations);
+    assertEquals(count * 2, htds.cachehits);
     assertTrue(htds.get(HConstants.ROOT_TABLE_NAME) != null);
     assertEquals(htds.invocations, count * 4 + 1);
     assertEquals(htds.cachehits, count * 2 + 1);
@@ -130,4 +139,4 @@ public class TestFSTableDescriptors {
     htds.add(htd);
     htds.add(htd);
   }
-}
\ No newline at end of file
+}



Mime
View raw message