HBASE-10573 Use Netty 4 - addendum

This commit is contained in:
Nicolas Liochon 2014-05-23 19:34:49 +02:00
parent ca2a11cd3b
commit 220037c465
1 changed files with 16 additions and 1 deletions

View File

@ -75,6 +75,7 @@ import org.apache.hadoop.hbase.util.JVMClusterUtil;
import org.apache.hadoop.hbase.util.ManualEnvironmentEdge; import org.apache.hadoop.hbase.util.ManualEnvironmentEdge;
import org.apache.hadoop.hbase.util.Threads; import org.apache.hadoop.hbase.util.Threads;
import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher; import org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher;
import org.jboss.netty.util.internal.DetectionUtil;
import org.junit.AfterClass; import org.junit.AfterClass;
import org.junit.Assert; import org.junit.Assert;
import org.junit.BeforeClass; import org.junit.BeforeClass;
@ -106,6 +107,8 @@ public class TestHCM {
private static final byte[] ROW_X = Bytes.toBytes("xxx"); private static final byte[] ROW_X = Bytes.toBytes("xxx");
private static Random _randy = new Random(); private static Random _randy = new Random();
private static boolean isJavaOk = DetectionUtil.javaVersion() > 6;
/** /**
* This copro sleeps 20 second. The first call it fails. The second time, it works. * This copro sleeps 20 second. The first call it fails. The second time, it works.
*/ */
@ -127,7 +130,9 @@ public class TestHCM {
@BeforeClass @BeforeClass
public static void setUpBeforeClass() throws Exception { public static void setUpBeforeClass() throws Exception {
TEST_UTIL.getConfiguration().setBoolean(HConstants.STATUS_PUBLISHED, true); if (isJavaOk) {
TEST_UTIL.getConfiguration().setBoolean(HConstants.STATUS_PUBLISHED, true);
}
TEST_UTIL.startMiniCluster(2); TEST_UTIL.startMiniCluster(2);
} }
@ -214,6 +219,11 @@ public class TestHCM {
@Test(expected = RegionServerStoppedException.class) @Test(expected = RegionServerStoppedException.class)
public void testClusterStatus() throws Exception { public void testClusterStatus() throws Exception {
if (!isJavaOk){
// This test requires jdk 1.7+
throw new RegionServerStoppedException("as expected by the test...");
}
TableName tn = TableName tn =
TableName.valueOf("testClusterStatus"); TableName.valueOf("testClusterStatus");
byte[] cf = "cf".getBytes(); byte[] cf = "cf".getBytes();
@ -460,6 +470,11 @@ public class TestHCM {
*/ */
@Test @Test
public void testConnectionCut() throws Exception { public void testConnectionCut() throws Exception {
if (!isJavaOk){
// This test requires jdk 1.7+
return;
}
String tableName = "HCM-testConnectionCut"; String tableName = "HCM-testConnectionCut";
TEST_UTIL.createTable(tableName.getBytes(), FAM_NAM).close(); TEST_UTIL.createTable(tableName.getBytes(), FAM_NAM).close();