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/877b724d
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/877b724d
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/877b724d

Branch: refs/heads/master
Commit: 877b724d6496957aacb70464e930a7e1cfed51e7
Parents: 98f7a69
Author: Ankit Singhal <ankitsingha...@gmail.com>
Authored: Fri Jun 1 14:27:22 2018 -0700
Committer: Ankit Singhal <ankitsingha...@gmail.com>
Committed: Fri Jun 1 14:27:22 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/877b724d/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 7b6a543..6f49518 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
@@ -18,7 +18,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;
@@ -26,14 +25,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
@@ -57,13 +60,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