PHOENIX-4769 Annotate SystemCatalogIT so that it will run with the test suite


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/27a66607
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/27a66607
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/27a66607

Branch: refs/heads/4.x-HBase-1.1
Commit: 27a66607f3f67273367c7c5d2b1d20b721ec227b
Parents: 8657ce2
Author: Ankit Singhal <ankitsingha...@gmail.com>
Authored: Fri Jun 1 14:43:30 2018 -0700
Committer: Ankit Singhal <ankitsingha...@gmail.com>
Committed: Fri Jun 1 14:43:30 2018 -0700

----------------------------------------------------------------------
 .../apache/phoenix/end2end/SystemCatalogIT.java | 23 +++++++++++++-------
 1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/27a66607/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
index 15af2af..2626ad6 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/SystemCatalogIT.java
@@ -19,7 +19,6 @@
 package org.apache.phoenix.end2end;
 
 import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
 
 import java.sql.Connection;
 import java.sql.DriverManager;
@@ -27,14 +26,18 @@ import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.Properties;
 
+import org.apache.hadoop.hbase.DoNotRetryIOException;
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 import org.apache.hadoop.hbase.TableName;
 import org.apache.hadoop.hbase.client.RegionLocator;
+import org.apache.phoenix.query.BaseTest;
 import org.apache.phoenix.util.PhoenixRuntime;
 import org.junit.After;
 import org.junit.Test;
+import org.junit.experimental.categories.Category;
 
-public class SystemCatalogIT {
+@Category(NeedsOwnMiniClusterTest.class)
+public class SystemCatalogIT extends BaseTest {
     private HBaseTestingUtility testUtil = null;
 
     @After
@@ -58,13 +61,17 @@ public class SystemCatalogIT {
         TableName systemCatalog = TableName.valueOf("SYSTEM.CATALOG");
         RegionLocator rl = 
testUtil.getConnection().getRegionLocator(systemCatalog);
         assertEquals(rl.getAllRegionLocations().size(), 1);
+        try {
+            // now attempt to split SYSTEM.CATALOG
+            testUtil.getHBaseAdmin().split(systemCatalog);
 
-        // now attempt to split SYSTEM.CATALOG
-        testUtil.getHBaseAdmin().split(systemCatalog);
-
-        // make sure the split finishes (there's no synchronous splitting 
before HBase 2.x)
-        testUtil.getHBaseAdmin().disableTable(systemCatalog);
-        testUtil.getHBaseAdmin().enableTable(systemCatalog);
+            // make sure the split finishes (there's no synchronous splitting 
before HBase 2.x)
+            testUtil.getHBaseAdmin().disableTable(systemCatalog);
+            testUtil.getHBaseAdmin().enableTable(systemCatalog);
+        } catch (DoNotRetryIOException e) {
+            // table is not splittable
+            assert (e.getMessage().contains("NOT splittable"));
+        }
 
         // test again... Must still be exactly one region.
         rl = testUtil.getConnection().getRegionLocator(systemCatalog);

Reply via email to