hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nkey...@apache.org
Subject svn commit: r1433014 - /hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java
Date Mon, 14 Jan 2013 18:03:57 GMT
Author: nkeywal
Date: Mon Jan 14 18:03:57 2013
New Revision: 1433014

URL: http://svn.apache.org/viewvc?rev=1433014&view=rev
Log:
HBASE-7553 TestServerCustomProtocol depends on the test methods execution order

Modified:
    hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java

Modified: hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java?rev=1433014&r1=1433013&r2=1433014&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java
(original)
+++ hbase/trunk/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java
Mon Jan 14 18:03:57 2013
@@ -56,7 +56,9 @@ import org.apache.hadoop.hbase.coprocess
 import org.apache.hadoop.hbase.coprocessor.protobuf.generated.PingProtos.PingResponse;
 import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.junit.After;
 import org.junit.AfterClass;
+import org.junit.Before;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -146,7 +148,10 @@ public class TestServerCustomProtocol {
     util.getConfiguration().set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
       PingHandler.class.getName());
     util.startMiniCluster();
+  }
 
+  @Before
+  public void before()  throws Exception {
     HTable table = util.createTable(TEST_TABLE, TEST_FAMILY);
     util.createMultiRegions(util.getConfiguration(), table, TEST_FAMILY,
       new byte[][]{ HConstants.EMPTY_BYTE_ARRAY, ROW_B, ROW_C});
@@ -164,6 +169,11 @@ public class TestServerCustomProtocol {
     table.put(putc);
   }
 
+  @After
+  public void after() throws Exception {
+    util.deleteTable(TEST_TABLE);
+  }
+
   @AfterClass
   public static void tearDownAfterClass() throws Exception {
     util.shutdownMiniCluster();
@@ -216,7 +226,7 @@ public class TestServerCustomProtocol {
     // There are three regions so should get back three results.
     assertEquals(3, results.size());
     for (Map.Entry<byte [], Integer> e: intResults.entrySet()) {
-      assertTrue(e.getValue() == count + diff);
+      assertEquals(e.getValue().intValue(), count + diff);
     }
     table.close();
   }



Mime
View raw message