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
This commit is contained in:
parent
2933150500
commit
ef2a643d22
|
@ -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.coprocessor.protobuf.generated.PingProtos.PingResponse;
|
||||||
import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
|
import org.apache.hadoop.hbase.ipc.BlockingRpcCallback;
|
||||||
import org.apache.hadoop.hbase.util.Bytes;
|
import org.apache.hadoop.hbase.util.Bytes;
|
||||||
|
import org.junit.After;
|
||||||
import org.junit.AfterClass;
|
import org.junit.AfterClass;
|
||||||
|
import org.junit.Before;
|
||||||
import org.junit.BeforeClass;
|
import org.junit.BeforeClass;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.experimental.categories.Category;
|
import org.junit.experimental.categories.Category;
|
||||||
|
@ -146,7 +148,10 @@ public class TestServerCustomProtocol {
|
||||||
util.getConfiguration().set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
|
util.getConfiguration().set(CoprocessorHost.REGION_COPROCESSOR_CONF_KEY,
|
||||||
PingHandler.class.getName());
|
PingHandler.class.getName());
|
||||||
util.startMiniCluster();
|
util.startMiniCluster();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void before() throws Exception {
|
||||||
HTable table = util.createTable(TEST_TABLE, TEST_FAMILY);
|
HTable table = util.createTable(TEST_TABLE, TEST_FAMILY);
|
||||||
util.createMultiRegions(util.getConfiguration(), table, TEST_FAMILY,
|
util.createMultiRegions(util.getConfiguration(), table, TEST_FAMILY,
|
||||||
new byte[][]{ HConstants.EMPTY_BYTE_ARRAY, ROW_B, ROW_C});
|
new byte[][]{ HConstants.EMPTY_BYTE_ARRAY, ROW_B, ROW_C});
|
||||||
|
@ -164,6 +169,11 @@ public class TestServerCustomProtocol {
|
||||||
table.put(putc);
|
table.put(putc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@After
|
||||||
|
public void after() throws Exception {
|
||||||
|
util.deleteTable(TEST_TABLE);
|
||||||
|
}
|
||||||
|
|
||||||
@AfterClass
|
@AfterClass
|
||||||
public static void tearDownAfterClass() throws Exception {
|
public static void tearDownAfterClass() throws Exception {
|
||||||
util.shutdownMiniCluster();
|
util.shutdownMiniCluster();
|
||||||
|
@ -216,7 +226,7 @@ public class TestServerCustomProtocol {
|
||||||
// There are three regions so should get back three results.
|
// There are three regions so should get back three results.
|
||||||
assertEquals(3, results.size());
|
assertEquals(3, results.size());
|
||||||
for (Map.Entry<byte [], Integer> e: intResults.entrySet()) {
|
for (Map.Entry<byte [], Integer> e: intResults.entrySet()) {
|
||||||
assertTrue(e.getValue() == count + diff);
|
assertEquals(e.getValue().intValue(), count + diff);
|
||||||
}
|
}
|
||||||
table.close();
|
table.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue