From ef2a643d22a51be652a856f177ba6a1e049a8b51 Mon Sep 17 00:00:00 2001 From: nkeywal Date: Mon, 14 Jan 2013 18:03:57 +0000 Subject: [PATCH] HBASE-7553 TestServerCustomProtocol depends on the test methods execution order git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1433014 13f79535-47bb-0310-9956-ffa450edef68 --- .../hbase/regionserver/TestServerCustomProtocol.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java index f34723cc3ad..bfebaa20402 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestServerCustomProtocol.java @@ -56,7 +56,9 @@ import org.apache.hadoop.hbase.coprocessor.protobuf.generated.PingProtos.PingReq 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 e: intResults.entrySet()) { - assertTrue(e.getValue() == count + diff); + assertEquals(e.getValue().intValue(), count + diff); } table.close(); }