You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by jx...@apache.org on 2013/07/04 00:51:12 UTC

svn commit: r1499592 - /hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java

Author: jxiang
Date: Wed Jul  3 22:51:11 2013
New Revision: 1499592

URL: http://svn.apache.org/r1499592
Log:
HBASE-8857 TestGet#testDynamicFilter fails sometimes

Modified:
    hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java

Modified: hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java?rev=1499592&r1=1499591&r2=1499592&view=diff
==============================================================================
--- hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java (original)
+++ hbase/branches/0.95/hbase-client/src/test/java/org/apache/hadoop/hbase/client/TestGet.java Wed Jul  3 22:51:11 2013
@@ -19,6 +19,7 @@
 
 package org.apache.hadoop.hbase.client;
 
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.fail;
 
 import java.io.File;
@@ -138,6 +139,13 @@ public class TestGet {
 
   @Test
   public void testDynamicFilter() throws Exception {
+    Configuration conf = HBaseConfiguration.create();
+    String localPath = conf.get("hbase.local.dir")
+      + File.separator + "jars" + File.separator;
+    File jarFile = new File(localPath, "MockFilter.jar");
+    jarFile.delete();
+    assertFalse("Should be deleted: " + jarFile.getPath(), jarFile.exists());
+
     ClientProtos.Get getProto = ClientProtos.Get.parseFrom(Base64.decode(PB_GET));
     try {
       ProtobufUtil.toGet(getProto);
@@ -145,13 +153,6 @@ public class TestGet {
     } catch (IOException ioe) {
       Assert.assertTrue(ioe.getCause() instanceof ClassNotFoundException);
     }
-
-    Configuration conf = HBaseConfiguration.create();
-    String localPath = conf.get("hbase.local.dir")
-      + File.separator + "jars" + File.separator;
-    File jarFile = new File(localPath, "MockFilter.jar");
-    jarFile.deleteOnExit();
-
     FileOutputStream fos = new FileOutputStream(jarFile);
     fos.write(Base64.decode(MOCK_FILTER_JAR));
     fos.close();