phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamestay...@apache.org
Subject [2/6] phoenix git commit: PHOENIX-3253 Make changes to tests to support method level parallelization
Date Fri, 23 Sep 2016 00:17:20 GMT
http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java
index ec84282..c43fb0e 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/UseSchemaIT.java
@@ -45,13 +45,13 @@ public class UseSchemaIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testUseSchemaCaseInsensitive() throws Exception {
-        String schemaName = generateRandomString();
+        String schemaName = generateUniqueName();
         testUseSchema(schemaName);
     }
 
     @Test
     public void testUseSchemaCaseSensitive() throws Exception {
-        String schemaName = generateRandomString();
+        String schemaName = generateUniqueName();
         testUseSchema("\"" + schemaName + "\"");
     }
 
@@ -61,7 +61,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT {
         Connection conn = DriverManager.getConnection(getUrl(), props);
         String ddl = "CREATE SCHEMA IF NOT EXISTS "+schema;
         conn.createStatement().execute(ddl);
-        String testTable = generateRandomString();
+        String testTable = generateUniqueName();
         ddl = "create table "+schema+"." + testTable + "(id varchar primary key)";
         conn.createStatement().execute(ddl);
         conn.createStatement().execute("use "+schema);
@@ -89,14 +89,14 @@ public class UseSchemaIT extends ParallelStatsDisabledIT {
     @Test
     public void testSchemaInJdbcUrl() throws Exception {
         Properties props = new Properties();
-        String schema = generateRandomString();
+        String schema = generateUniqueName();
         props.setProperty(QueryServices.SCHEMA_ATTRIB, schema);
         props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(true));
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(true);
         String ddl = "CREATE SCHEMA IF NOT EXISTS " + schema;
         conn.createStatement().execute(ddl);
-        String testTable = generateRandomString();
+        String testTable = generateUniqueName();
         ddl = "create table IF NOT EXISTS " + schema + "." + testTable + " (schema_name varchar primary key)";
         conn.createStatement().execute(ddl);
         conn.createStatement().executeUpdate("upsert into " + schema + "." + testTable + " values('" + schema + "')");
@@ -105,7 +105,7 @@ public class UseSchemaIT extends ParallelStatsDisabledIT {
         assertTrue(rs.next());
         assertEquals(schema, rs.getString(1));
 
-        schema = generateRandomString();
+        schema = generateUniqueName();
         ddl = "CREATE SCHEMA " + schema;
         conn.createStatement().execute(ddl);
         conn.createStatement().execute("use " + schema);
@@ -121,8 +121,8 @@ public class UseSchemaIT extends ParallelStatsDisabledIT {
     @Test
     public void testMappedView() throws Exception {
         Properties props = new Properties();
-        String schema = generateRandomString();
-        String tableName = generateRandomString();
+        String schema = generateUniqueName();
+        String tableName = generateUniqueName();
         String fullTablename = schema + QueryConstants.NAME_SEPARATOR + tableName;
         props.setProperty(QueryServices.SCHEMA_ATTRIB, schema);
         Connection conn = DriverManager.getConnection(getUrl(), props);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
index 425e84c..512841a 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/ViewIT.java
@@ -64,7 +64,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL PRIMARY KEY, v1 DATE) "+ tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String fullParentViewName = "V_" + generateRandomString();
+        String fullParentViewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullParentViewName + " (v2 VARCHAR) AS SELECT * FROM " + tableName + " WHERE k > 5";
         conn.createStatement().execute(ddl);
         try {
@@ -104,7 +104,7 @@ public class ViewIT extends BaseViewIT {
             assertEquals(count + 5, rs.getInt(1));
         }
         assertEquals(4, count);
-        String fullViewName = "V_" + generateRandomString();
+        String fullViewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName + " AS SELECT * FROM " + fullParentViewName + " WHERE k < 9";
         conn.createStatement().execute(ddl);
         try {
@@ -140,7 +140,7 @@ public class ViewIT extends BaseViewIT {
     public void testUpdatableOnUpdatableView() throws Exception {
         String viewName = testUpdatableView(null);
         Connection conn = DriverManager.getConnection(getUrl());
-        String fullViewName = "V_" + generateRandomString();
+        String fullViewName = "V_" + generateUniqueName();
         String ddl = "CREATE VIEW " + fullViewName + " AS SELECT * FROM " + viewName + " WHERE k3 = 2";
         conn.createStatement().execute(ddl);
         ResultSet rs = conn.createStatement().executeQuery("SELECT k1, k2, k3 FROM " + fullViewName);
@@ -178,7 +178,7 @@ public class ViewIT extends BaseViewIT {
     public void testReadOnlyOnUpdatableView() throws Exception {
         String viewName = testUpdatableView(null);
         Connection conn = DriverManager.getConnection(getUrl());
-        String fullViewName = "V_" + generateRandomString();
+        String fullViewName = "V_" + generateUniqueName();
         String ddl = "CREATE VIEW " + fullViewName + " AS SELECT * FROM " + viewName + " WHERE k3 > 1 and k3 < 50";
         conn.createStatement().execute(ddl);
         ResultSet rs = conn.createStatement().executeQuery("SELECT k1, k2, k3 FROM " + fullViewName);
@@ -210,7 +210,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, v1 DECIMAL, CONSTRAINT pk PRIMARY KEY (k1, k2))" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String fullViewName1 = "V_" + generateRandomString();
+        String fullViewName1 = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName1 + "(v2 VARCHAR, v3 VARCHAR) AS SELECT * FROM " + fullTableName + " WHERE v1 = 1.0";
         conn.createStatement().execute(ddl);
         
@@ -221,7 +221,7 @@ public class ViewIT extends BaseViewIT {
             assertEquals(SQLExceptionCode.CANNOT_MUTATE_TABLE.getErrorCode(), e.getErrorCode());
         }
         
-        String fullViewName2 = "V_" + generateRandomString();
+        String fullViewName2 = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName2 + " AS SELECT * FROM " + fullViewName1 + " WHERE v2 != 'foo'";
         conn.createStatement().execute(ddl);
 
@@ -245,10 +245,10 @@ public class ViewIT extends BaseViewIT {
     public void testReadOnlyViewWithCaseSensitiveTableNames() throws Exception {
         Connection earlierCon = DriverManager.getConnection(getUrl());
         Connection conn = DriverManager.getConnection(getUrl());
-        String caseSensitiveTableName = "\"t_" + generateRandomString() + "\"" ;
+        String caseSensitiveTableName = "\"t_" + generateUniqueName() + "\"" ;
         String ddl = "CREATE TABLE " + caseSensitiveTableName + " (k INTEGER NOT NULL PRIMARY KEY, v1 DATE)" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String caseSensitiveViewName = "\"v_" + generateRandomString() + "\"" ;
+        String caseSensitiveViewName = "\"v_" + generateUniqueName() + "\"" ;
         ddl = "CREATE VIEW " + caseSensitiveViewName + " (v2 VARCHAR) AS SELECT * FROM " + caseSensitiveTableName + " WHERE k > 5";
         conn.createStatement().execute(ddl);
         try {
@@ -283,7 +283,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (\"k\" INTEGER NOT NULL PRIMARY KEY, \"v1\" INTEGER, \"a\".v2 VARCHAR)" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String viewName = "V_" + generateRandomString();
+        String viewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + viewName + " (v VARCHAR) AS SELECT * FROM " + fullTableName + " WHERE \"k\" > 5 and \"v1\" > 1";
         conn.createStatement().execute(ddl);
         try {
@@ -311,7 +311,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL PRIMARY KEY, v1 INTEGER, v2 DATE)" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String viewName = "V_" + generateRandomString();
+        String viewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + viewName + " (v VARCHAR) AS SELECT * FROM " + fullTableName + " WHERE v2 > CURRENT_DATE()-5 AND v2 > DATE '2010-01-01'";
         conn.createStatement().execute(ddl);
         try {
@@ -350,7 +350,7 @@ public class ViewIT extends BaseViewIT {
         Properties props = new Properties();
         props.setProperty(QueryServices.IS_NAMESPACE_MAPPING_ENABLED, Boolean.toString(isNamespaceMapped));
         Connection conn = DriverManager.getConnection(getUrl(),props);
-        String schemaName1 = "S_" + generateRandomString();
+        String schemaName1 = "S_" + generateUniqueName();
         String fullTableName1 = SchemaUtil.getTableName(schemaName1, tableName);
         if (isNamespaceMapped) {
             conn.createStatement().execute("CREATE SCHEMA IF NOT EXISTS " + schemaName1);
@@ -360,12 +360,12 @@ public class ViewIT extends BaseViewIT {
         conn.createStatement().execute(ddl);
         assertTrue(admin.tableExists(SchemaUtil.getPhysicalTableName(SchemaUtil.normalizeIdentifier(fullTableName1),
                 conn.unwrap(PhoenixConnection.class).getQueryServices().getProps())));
-        String viewName = "V_" + generateRandomString();
-        String viewSchemaName = "S_" + generateRandomString();
+        String viewName = "V_" + generateUniqueName();
+        String viewSchemaName = "S_" + generateUniqueName();
         String fullViewName1 = SchemaUtil.getTableName(viewSchemaName, viewName);
         ddl = "CREATE VIEW " + fullViewName1 + " (v2 VARCHAR) AS SELECT * FROM " + fullTableName1 + " WHERE k > 5";
         conn.createStatement().execute(ddl);
-        String fullViewName2 = "V_" + generateRandomString();
+        String fullViewName2 = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName2 + " (v2 VARCHAR) AS SELECT * FROM " + fullTableName1 + " WHERE k > 5";
         conn.createStatement().execute(ddl);
         conn.createStatement().executeQuery("SELECT * FROM " + fullViewName1);
@@ -378,7 +378,7 @@ public class ViewIT extends BaseViewIT {
         }
         ddl = "DROP VIEW " + fullViewName1;
         conn.createStatement().execute(ddl);
-        ddl = "DROP VIEW " + SchemaUtil.getTableName(viewSchemaName, generateRandomString());
+        ddl = "DROP VIEW " + SchemaUtil.getTableName(viewSchemaName, generateUniqueName());
         try {
             conn.createStatement().execute(ddl);
             fail();
@@ -398,7 +398,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, v1 DECIMAL, CONSTRAINT pk PRIMARY KEY (k1, k2))" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String viewName = "V_" + generateRandomString();
+        String viewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + viewName + "(v2 VARCHAR, v3 VARCHAR) AS SELECT * FROM " + fullTableName + " WHERE v1 = 1.0";
         conn.createStatement().execute(ddl);
         
@@ -416,14 +416,14 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + "  (k INTEGER NOT NULL PRIMARY KEY, v1 DATE)" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String viewName = "V_" + generateRandomString();
-        String viewSchemaName = "S_" + generateRandomString();
+        String viewName = "V_" + generateUniqueName();
+        String viewSchemaName = "S_" + generateUniqueName();
         String fullViewName1 = SchemaUtil.getTableName(viewSchemaName, viewName);
         ddl = "CREATE VIEW " + fullViewName1 + " (v2 VARCHAR) AS SELECT * FROM " + fullTableName + " WHERE k > 5";
         conn.createStatement().execute(ddl);
         ddl = "CREATE LOCAL INDEX idx on " + fullViewName1 + "(v2)";
         conn.createStatement().execute(ddl);
-        String fullViewName2 = SchemaUtil.getTableName(viewSchemaName, "V_" + generateRandomString());
+        String fullViewName2 = SchemaUtil.getTableName(viewSchemaName, "V_" + generateUniqueName());
         ddl = "CREATE VIEW " + fullViewName2 + "(v2 VARCHAR) AS SELECT * FROM " + fullTableName + " WHERE k > 10";
         conn.createStatement().execute(ddl);
 
@@ -446,12 +446,12 @@ public class ViewIT extends BaseViewIT {
 		tableDDLOptions+="IMMUTABLE_ROWS=true";
         String ddl = "CREATE TABLE " + fullTableName + " (k INTEGER NOT NULL PRIMARY KEY, v1 DATE)" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String viewSchemaName = "S_" + generateRandomString();
-        String fullViewName1 = SchemaUtil.getTableName(viewSchemaName, "V_" + generateRandomString());
-        String fullViewName2 = SchemaUtil.getTableName(viewSchemaName, "V_" + generateRandomString());
-        String indexName1 = "I_" + generateRandomString();
-        String indexName2 = "I_" + generateRandomString();
-        String indexName3 = "I_" + generateRandomString();
+        String viewSchemaName = "S_" + generateUniqueName();
+        String fullViewName1 = SchemaUtil.getTableName(viewSchemaName, "V_" + generateUniqueName());
+        String fullViewName2 = SchemaUtil.getTableName(viewSchemaName, "V_" + generateUniqueName());
+        String indexName1 = "I_" + generateUniqueName();
+        String indexName2 = "I_" + generateUniqueName();
+        String indexName3 = "I_" + generateUniqueName();
         ddl = "CREATE INDEX " + indexName1 + " ON " + fullTableName + " (v1)";
         conn.createStatement().execute(ddl);
         ddl = "CREATE VIEW " + fullViewName1 + " (v2 VARCHAR) AS SELECT * FROM " + fullTableName + " WHERE k > 5";
@@ -515,13 +515,13 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + "  (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, k3 DECIMAL, s1 VARCHAR, s2 VARCHAR CONSTRAINT pk PRIMARY KEY (k1, k2, k3))" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String indexName1 = "I_" + generateRandomString();
+        String indexName1 = "I_" + generateUniqueName();
         String fullIndexName1 = SchemaUtil.getTableName(schemaName, indexName1);
         conn.createStatement().execute("CREATE " + (localIndex ? "LOCAL " : "") + " INDEX " + indexName1 + " ON " + fullTableName + "(k3, k2) INCLUDE(s1, s2)");
-        String indexName2 = "I_" + generateRandomString();
+        String indexName2 = "I_" + generateUniqueName();
         conn.createStatement().execute("CREATE INDEX " + indexName2 + " ON " + fullTableName + "(k3, k2, s2)");
         
-        String fullViewName = "V_" + generateRandomString();
+        String fullViewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName + " AS SELECT * FROM " + fullTableName + " WHERE s1 = 'foo'";
         conn.createStatement().execute(ddl);
         String[] s1Values = {"foo","bar"};
@@ -535,7 +535,7 @@ public class ViewIT extends BaseViewIT {
         assertEquals(5, rs.getLong(1));
         assertFalse(rs.next());
 
-        String viewIndexName = "I_" + generateRandomString();
+        String viewIndexName = "I_" + generateUniqueName();
         conn.createStatement().execute("CREATE INDEX " + viewIndexName + " on " + fullViewName + "(k2)");
         
         String query = "SELECT k2 FROM " + fullViewName + " WHERE k2 IN (100,109) AND k3 IN (1,2) AND s2='bas'";
@@ -562,7 +562,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, v1 DECIMAL, CONSTRAINT pk PRIMARY KEY (k1, k2))" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String fullViewName = "V_" + generateRandomString();
+        String fullViewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName + "(v2 VARCHAR, k3 VARCHAR PRIMARY KEY) AS SELECT * FROM " + fullTableName + " WHERE K1 = 1";
         conn.createStatement().execute(ddl);
 
@@ -591,7 +591,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, v1 DECIMAL, CONSTRAINT pk PRIMARY KEY (k1, k2))" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String fullViewName = "V_" + generateRandomString();
+        String fullViewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName + "(v2 VARCHAR, k3 VARCHAR, k4 INTEGER NOT NULL, CONSTRAINT PKVEW PRIMARY KEY (k3, k4)) AS SELECT * FROM " + fullTableName + " WHERE K1 = 1";
         conn.createStatement().execute(ddl);
 
@@ -606,7 +606,7 @@ public class ViewIT extends BaseViewIT {
         String fullTableName2 = fullTableName;
 		String ddl = "CREATE TABLE " + fullTableName2 + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, v1 DECIMAL, CONSTRAINT pk PRIMARY KEY (k1, k2))" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String fullViewName = "V_" + generateRandomString();
+        String fullViewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName + "  AS SELECT * FROM " + fullTableName + " WHERE v1 = 1.0";
         conn.createStatement().execute(ddl);
         ddl = "ALTER VIEW " + fullViewName + " ADD k3 VARCHAR PRIMARY KEY, k4 VARCHAR PRIMARY KEY, v2 INTEGER";
@@ -622,7 +622,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (k1 INTEGER NOT NULL, k2 VARCHAR NOT NULL, v1 DECIMAL, CONSTRAINT pk PRIMARY KEY (k1, k2))" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String fullViewName1 = "V_" + generateRandomString();
+        String fullViewName1 = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName1 + "  AS SELECT * FROM " + fullTableName + " WHERE v1 = 1.0";
         conn.createStatement().execute(ddl);
         ddl = "ALTER VIEW " + fullViewName1 + " ADD k3 VARCHAR PRIMARY KEY, k4 VARCHAR PRIMARY KEY, v2 INTEGER";
@@ -632,7 +632,7 @@ public class ViewIT extends BaseViewIT {
         } catch (SQLException e) {
             assertEquals(CANNOT_MODIFY_VIEW_PK.getErrorCode(), e.getErrorCode());
         }
-        String fullViewName2 = "V_" + generateRandomString();
+        String fullViewName2 = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName2 + " (k3 VARCHAR PRIMARY KEY)  AS SELECT * FROM " + fullTableName + " WHERE v1 = 1.0";
         try {
         	conn.createStatement().execute(ddl);
@@ -646,7 +646,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, v1 DECIMAL, CONSTRAINT pk PRIMARY KEY (k1, k2))" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String fullViewName = "V_" + generateRandomString();
+        String fullViewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName + "  AS SELECT * FROM " + fullTableName + " WHERE v1 = 1.0";
         conn.createStatement().execute(ddl);
         ddl = "ALTER VIEW " + fullViewName + " ADD k3 VARCHAR PRIMARY KEY, k2 VARCHAR PRIMARY KEY, v2 INTEGER";
@@ -658,7 +658,7 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String ddl = "CREATE TABLE " + fullTableName + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, v1 DECIMAL, CONSTRAINT pk PRIMARY KEY (k1, k2))" + tableDDLOptions;
         conn.createStatement().execute(ddl);
-        String fullViewName = "V_" + generateRandomString();
+        String fullViewName = "V_" + generateUniqueName();
         ddl = "CREATE VIEW " + fullViewName + "  AS SELECT * FROM " + fullTableName + " WHERE v1 = 1.0";
         conn.createStatement().execute(ddl);
         try {
@@ -675,10 +675,10 @@ public class ViewIT extends BaseViewIT {
         Connection conn = DriverManager.getConnection(getUrl());
         String sql = "CREATE TABLE " + fullTableName + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, v1 DECIMAL, CONSTRAINT pk PRIMARY KEY (k1, k2))" + tableDDLOptions;
         conn.createStatement().execute(sql);
-        String fullViewName1 = "V_" + generateRandomString();
+        String fullViewName1 = "V_" + generateUniqueName();
         sql = "CREATE VIEW " + fullViewName1 + "  AS SELECT * FROM " + fullTableName;
         conn.createStatement().execute(sql);
-        String fullViewName2 = "V_" + generateRandomString();
+        String fullViewName2 = "V_" + generateUniqueName();
         sql = "CREATE VIEW " + fullViewName2 + "  AS SELECT * FROM " + fullTableName + " WHERE k1 = 1.0";
         conn.createStatement().execute(sql);
         

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/AsyncIndexDisabledIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/AsyncIndexDisabledIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/AsyncIndexDisabledIT.java
index a6228e7..5f02790 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/AsyncIndexDisabledIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/AsyncIndexDisabledIT.java
@@ -52,8 +52,8 @@ public class AsyncIndexDisabledIT extends ParallelStatsDisabledIT {
         try (Connection conn = DriverManager.getConnection(getUrl())) {
             conn.setAutoCommit(true);
             Statement stmt = conn.createStatement();
-            String tableName = "TBL_" + generateRandomString();
-            String indexName = "IND_" + generateRandomString();
+            String tableName = "TBL_" + generateUniqueName();
+            String indexName = "IND_" + generateUniqueName();
             
             String ddl = "CREATE TABLE " + tableName + " (pk INTEGER NOT NULL PRIMARY KEY, val VARCHAR)";
             stmt.execute(ddl);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ChildViewsUseParentViewIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ChildViewsUseParentViewIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ChildViewsUseParentViewIndexIT.java
index a0efd52..29ff183 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ChildViewsUseParentViewIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ChildViewsUseParentViewIndexIT.java
@@ -20,11 +20,11 @@ public class ChildViewsUseParentViewIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testIndexOnParentViewWithTenantSpecificConnection() throws Exception {
-        final String baseTableName = generateRandomString();
-        final String globalViewName = generateRandomString();
-        final String globalViewIdxName = generateRandomString();
-        final String tenantViewName1 = generateRandomString();
-        final String tenantViewName2 = generateRandomString();
+        final String baseTableName = generateUniqueName();
+        final String globalViewName = generateUniqueName();
+        final String globalViewIdxName = generateUniqueName();
+        final String tenantViewName1 = generateUniqueName();
+        final String tenantViewName2 = generateUniqueName();
 
         // Set up props with TenantId
         Properties props  = new Properties();
@@ -68,11 +68,11 @@ public class ChildViewsUseParentViewIndexIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testParentViewIndexWithSpecializedChildViews() throws Exception {
-        final String baseTableName = generateRandomString();
-        final String parentViewName = generateRandomString();
-        final String parentViewIdxName = generateRandomString();
-        final String childViewName1 = generateRandomString();
-        final String childViewName2 = generateRandomString();
+        final String baseTableName = generateUniqueName();
+        final String parentViewName = generateUniqueName();
+        final String parentViewIdxName = generateUniqueName();
+        final String childViewName1 = generateUniqueName();
+        final String childViewName2 = generateUniqueName();
 
         try (Connection conn = DriverManager.getConnection(getUrl())) {
             // create base table

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/DropMetadataIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/DropMetadataIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/DropMetadataIT.java
index 9ee00d2..8b3c111 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/DropMetadataIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/DropMetadataIT.java
@@ -77,7 +77,7 @@ public class DropMetadataIT extends ParallelStatsDisabledIT {
     @Test
     public void testDropViewKeepsHTable() throws Exception {
         HBaseAdmin admin = driver.getConnectionQueryServices(getUrl(), TEST_PROPERTIES).getAdmin();
-        String hbaseNativeViewName = generateRandomString();
+        String hbaseNativeViewName = generateUniqueName();
 
         byte[] hbaseNativeBytes = SchemaUtil.getTableNameAsBytes(HBASE_NATIVE_SCHEMA_NAME, hbaseNativeViewName);
         try {
@@ -108,8 +108,8 @@ public class DropMetadataIT extends ParallelStatsDisabledIT {
     @Test
     public void testDroppingIndexedColDropsIndex() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String indexTableName = generateRandomString();
-        String dataTableFullName = SchemaUtil.getTableName(SCHEMA_NAME, generateRandomString());
+        String indexTableName = generateUniqueName();
+        String dataTableFullName = SchemaUtil.getTableName(SCHEMA_NAME, generateUniqueName());
         String localIndexTableName1 = "LOCAL_" + indexTableName + "_1";
         String localIndexTableName2 = "LOCAL_" + indexTableName + "_2";
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
@@ -202,10 +202,10 @@ public class DropMetadataIT extends ParallelStatsDisabledIT {
     public void helpTestDroppingIndexedColDropsViewIndex(boolean isMultiTenant) throws Exception {
         try (Connection conn = DriverManager.getConnection(getUrl());
                 Connection viewConn = isMultiTenant ? DriverManager.getConnection(TENANT_SPECIFIC_URL) : conn ) {
-            String tableWithView = generateRandomString();
-            String viewOfTable = generateRandomString();
-            String viewIndex1 = generateRandomString();
-            String viewIndex2 = generateRandomString();
+            String tableWithView = generateUniqueName();
+            String viewOfTable = generateUniqueName();
+            String viewIndex1 = generateUniqueName();
+            String viewIndex2 = generateUniqueName();
             
             conn.setAutoCommit(false);
             viewConn.setAutoCommit(false);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexOptimizationIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexOptimizationIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexOptimizationIT.java
index af2ddaa..d3c3085 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexOptimizationIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexOptimizationIT.java
@@ -73,16 +73,16 @@ public class GlobalIndexOptimizationIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testGlobalIndexOptimization() throws Exception {
-        String dataTableName = generateRandomString();
-        String indexTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
+        String indexTableName = generateUniqueName();
         String dataTableFullName = SchemaUtil.getTableName("", dataTableName);
         testOptimization(dataTableName, dataTableFullName, indexTableName, 4);
     }
     
     @Test
     public void testGlobalIndexOptimizationWithSalting() throws Exception {
-        String dataTableName = generateRandomString();
-        String indexTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
+        String indexTableName = generateUniqueName();
         String dataTableFullName = SchemaUtil.getTableName("", dataTableName);
         testOptimization(dataTableName, dataTableFullName, indexTableName, 4);
 
@@ -90,15 +90,15 @@ public class GlobalIndexOptimizationIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testGlobalIndexOptimizationTenantSpecific() throws Exception {
-        String dataTableName = generateRandomString();
-        String indexTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
+        String indexTableName = generateUniqueName();
         testOptimizationTenantSpecific(dataTableName, indexTableName, null);
     }
     
     @Test
     public void testGlobalIndexOptimizationWithSaltingTenantSpecific() throws Exception {
-        String dataTableName = generateRandomString();
-        String indexTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
+        String indexTableName = generateUniqueName();
         testOptimizationTenantSpecific(dataTableName, indexTableName, 4);
     }
 
@@ -330,11 +330,11 @@ public class GlobalIndexOptimizationIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testGlobalIndexOptimizationOnSharedIndex() throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         createBaseTable(dataTableName, null, "('e','i','o')", false);
         Connection conn1 = DriverManager.getConnection(getUrl());
-        String viewName = generateRandomString();
-        String indexOnDataTable = generateRandomString();
+        String viewName = generateUniqueName();
+        String indexOnDataTable = generateUniqueName();
         try{
             conn1.createStatement().execute("CREATE INDEX " + indexOnDataTable + " ON " + dataTableName + "(k2,k1) INCLUDE (v1)");
             conn1.createStatement().execute("CREATE VIEW " + viewName  + " AS SELECT * FROM " + dataTableName + " WHERE v1 = 'a'");
@@ -347,7 +347,7 @@ public class GlobalIndexOptimizationIT extends ParallelStatsDisabledIT {
             assertTrue(rs.next());
             assertEquals(2, rs.getInt(1));
             assertFalse(rs.next());
-            String viewIndex = generateRandomString();
+            String viewIndex = generateUniqueName();
             conn1.createStatement().execute("CREATE INDEX " + viewIndex + " ON " + viewName + " (k1)");
             
             String query = "SELECT /*+ INDEX(" + viewName + " " + viewIndex + ")*/ t_id,k1,k2,k3,v1 FROM " + viewName + " where k1 IN (1,2) and k2 IN (3,4)";
@@ -378,8 +378,8 @@ public class GlobalIndexOptimizationIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testNoGlobalIndexOptimization() throws Exception {
-        String dataTableName = generateRandomString();
-        String indexTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
+        String indexTableName = generateUniqueName();
         String dataTableFullName = SchemaUtil.getTableName("", dataTableName);
         createBaseTable(dataTableName, null, "('e','i','o')", false);
         Connection conn1 = DriverManager.getConnection(getUrl());

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
index ba342eb..e677878 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexIT.java
@@ -108,14 +108,14 @@ public class ImmutableIndexIT extends BaseOwnClusterIT {
     @Test
     public void testDropIfImmutableKeyValueColumn() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             conn.setAutoCommit(false);
             String ddl =
-                    "CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+                    "CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
             Statement stmt = conn.createStatement();
             stmt.execute(ddl);
             populateTestTable(fullTableName);
@@ -155,11 +155,11 @@ public class ImmutableIndexIT extends BaseOwnClusterIT {
         }
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         props.setProperty(QueryServices.MUTATE_BATCH_SIZE_ATTRIB, Integer.toString(100));
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         TABLE_NAME = fullTableName;
-        String ddl ="CREATE TABLE " + TABLE_NAME + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+        String ddl ="CREATE TABLE " + TABLE_NAME + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
         INDEX_DDL = "CREATE " + (localIndex ? "LOCAL" : "") + " INDEX IF NOT EXISTS " + indexName + " ON " + TABLE_NAME
                 + " (long_pk, varchar_pk)"
                 + " INCLUDE (long_col1, long_col2)";
@@ -242,11 +242,11 @@ public class ImmutableIndexIT extends BaseOwnClusterIT {
     @Test
     public void testCreateIndexWhileUpsertingData() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
-        String ddl ="CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+        String ddl ="CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
         String indexDDL = "CREATE " + (localIndex ? "LOCAL" : "") + " INDEX " + indexName + " ON " + fullTableName
                 + " (long_pk, varchar_pk)"
                 + " INCLUDE (long_col1, long_col2)";

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java
index d03b6fa..2ff823a 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/ImmutableIndexWithStatsIT.java
@@ -40,7 +40,7 @@ public class ImmutableIndexWithStatsIT extends ParallelStatsEnabledIT {
         String query;
         ResultSet rs;
         
-        String tableName = generateRandomString();
+        String tableName = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
@@ -62,7 +62,7 @@ public class ImmutableIndexWithStatsIT extends ParallelStatsEnabledIT {
         rs = conn.createStatement().executeQuery("EXPLAIN " + query);
         assertTrue(QueryUtil.getExplainPlan(rs).startsWith("CLIENT PARALLEL 1-WAY FULL SCAN"));
 
-        String indexName = "I_" + generateRandomString();
+        String indexName = "I_" + generateUniqueName();
         conn.createStatement().execute("CREATE INDEX " + indexName + " ON " + tableName + " (v)");
         
         query = "SELECT * FROM " + indexName;

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java
index 3235c52..50548bd 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexExpressionIT.java
@@ -36,6 +36,7 @@ import org.apache.phoenix.util.DateUtil;
 import org.apache.phoenix.util.IndexUtil;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
+import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
 
 public class IndexExpressionIT extends ParallelStatsDisabledIT {
@@ -110,14 +111,14 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     }
 
     private void createDataTable(Connection conn, String dataTableName, String tableProps) throws SQLException {
-        String tableDDL = "create table " + dataTableName + TEST_TABLE_SCHEMA + tableProps;
+        String tableDDL = "create table " + dataTableName + TestUtil.TEST_TABLE_SCHEMA + tableProps;
         conn.createStatement().execute(tableDDL);
     }
     
     protected void helpTestCreateAndUpdate(boolean mutable, boolean localIndex) throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         try {
@@ -208,17 +209,17 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testMutableIndexUpdate() throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
     	helpTestUpdate(fullDataTableName, indexName, false);
     }
 
     @Test
     public void testMutableLocalIndexUpdate() throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
         helpTestUpdate(fullDataTableName, indexName, true);
     }
     
@@ -316,9 +317,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     }
 
     protected void helpTestDeleteIndexedExpression(boolean mutable, boolean localIndex) throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
         String fullIndexTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + indexName;
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
@@ -390,9 +391,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     }
 
     protected void helpTestDeleteCoveredCol(boolean mutable, boolean localIndex) throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
         String fullIndexTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + indexName;
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
@@ -472,9 +473,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     }
 
     protected void helpTestGroupByCount(boolean mutable, boolean localIndex) throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         try {
@@ -528,9 +529,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     }
 
     protected void helpTestSelectDistinct(boolean mutable, boolean localIndex) throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         try {
@@ -582,9 +583,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     }
 
     protected void helpTestInClauseWithIndex(boolean mutable, boolean localIndex) throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
 
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
@@ -633,9 +634,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     }
 
     protected void helpTestSelectAliasAndOrderByWithIndex(boolean mutable, boolean localIndex) throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
 
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
@@ -688,8 +689,8 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     }
     
     protected void helpTestIndexWithCaseSensitiveCols(boolean mutable, boolean localIndex) throws Exception {
-        String dataTableName = generateRandomString();
-        String indexName = generateRandomString();
+        String dataTableName = generateUniqueName();
+        String indexName = generateUniqueName();
 
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
@@ -798,9 +799,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     }
 
     protected void helpTestSelectColOnlyInDataTable(boolean mutable, boolean localIndex) throws Exception {
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
 
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
@@ -861,9 +862,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
 
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
 
         try {
 	        conn.setAutoCommit(false);
@@ -946,9 +947,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
     public void helpTestDropCoveredColumn(boolean mutable, boolean local) throws Exception {
         ResultSet rs;
         PreparedStatement stmt;
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
 
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
@@ -1058,9 +1059,9 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
         ResultSet rs;
         PreparedStatement stmt;
 
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
 
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
@@ -1181,11 +1182,11 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
        
     private void helpTestUpdatableViewIndex(boolean local) throws Exception {
     	Connection conn = DriverManager.getConnection(getUrl());
-        String dataTableName = generateRandomString();
+        String dataTableName = generateUniqueName();
         String fullDataTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + dataTableName;
-        String indexName1 = generateRandomString();
-        String viewName = generateRandomString();
-        String indexName2 = generateRandomString();
+        String indexName1 = generateUniqueName();
+        String viewName = generateUniqueName();
+        String indexName2 = generateUniqueName();
     	try {
 	        String ddl = "CREATE TABLE " + dataTableName + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, k3 DECIMAL, s1 VARCHAR, s2 VARCHAR CONSTRAINT pk PRIMARY KEY (k1, k2, k3))";
 	        conn.createStatement().execute(ddl);
@@ -1247,10 +1248,10 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
         Connection conn = DriverManager.getConnection(getUrl());
         try 
         {
-            String dataTableName = generateRandomString();
-            String indexName1 = generateRandomString();
-            String viewName = generateRandomString();
-            String indexName2 = generateRandomString();
+            String dataTableName = generateUniqueName();
+            String indexName1 = generateUniqueName();
+            String viewName = generateUniqueName();
+            String indexName2 = generateUniqueName();
         	ResultSet rs;
 	        String ddl = "CREATE TABLE " + dataTableName + " (k1 INTEGER NOT NULL, k2 INTEGER NOT NULL, s1 VARCHAR, s2 VARCHAR, s3 VARCHAR, s4 VARCHAR CONSTRAINT pk PRIMARY KEY (k1, k2))";
 	        conn.createStatement().execute(ddl);
@@ -1300,8 +1301,8 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
 	@Test
 	public void testExpressionThrowsException() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        String dataTableName = generateRandomString();
-        String indexName = generateRandomString();
+        String dataTableName = generateUniqueName();
+        String indexName = generateUniqueName();
 		try {
 			String ddl = "CREATE TABLE " + dataTableName + " (k1 INTEGER PRIMARY KEY, k2 INTEGER)";
 			conn.createStatement().execute(ddl);
@@ -1344,8 +1345,8 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
 			boolean localIndex) throws Exception {
 		Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 		Connection conn = DriverManager.getConnection(getUrl(), props);
-        String dataTableName = generateRandomString();
-        String indexName = generateRandomString();
+        String dataTableName = generateUniqueName();
+        String indexName = generateUniqueName();
 		try {
 			conn.createStatement().execute(
 					"CREATE TABLE " + dataTableName + " (k VARCHAR NOT NULL PRIMARY KEY, v VARCHAR) "
@@ -1417,8 +1418,8 @@ public class IndexExpressionIT extends ParallelStatsDisabledIT {
 			boolean localIndex) throws Exception {
 		Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 		Connection conn = DriverManager.getConnection(getUrl(), props);
-        String dataTableName = generateRandomString();
-        String indexName = generateRandomString();
+        String dataTableName = generateUniqueName();
+        String indexName = generateUniqueName();
         try {
 			conn.createStatement().execute(
 				"CREATE TABLE " + dataTableName + " ("

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java
index 2e07aef..e2bc873 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexIT.java
@@ -124,13 +124,13 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testIndexWithNullableFixedWithCols() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
 
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             conn.setAutoCommit(false);
-            String ddl ="CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+            String ddl ="CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
             Statement stmt = conn.createStatement();
             stmt.execute(ddl);
             BaseTest.populateTestTable(fullTableName);
@@ -184,13 +184,13 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testDeleteFromAllPKColumnIndex() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             conn.setAutoCommit(false);
-            String ddl ="CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+            String ddl ="CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
             Statement stmt = conn.createStatement();
             stmt.execute(ddl);
             BaseTest.populateTestTable(fullTableName);
@@ -242,8 +242,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testCreateIndexAfterUpsertStarted() throws Exception {
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         testCreateIndexAfterUpsertStarted(false, fullTableName + "1", fullIndexName + "1");
@@ -256,7 +256,7 @@ public class IndexIT extends ParallelStatsDisabledIT {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         try (Connection conn1 = DriverManager.getConnection(getUrl(), props)) {
             conn1.setAutoCommit(true);
-            String ddl ="CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+            String ddl ="CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
             Statement stmt1 = conn1.createStatement();
             stmt1.execute(ddl);
             BaseTest.populateTestTable(fullTableName);
@@ -343,12 +343,12 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testDeleteFromNonPKColumnIndex() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
 
-        String ddl ="CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+        String ddl ="CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             conn.setAutoCommit(false);
             Statement stmt = conn.createStatement();
@@ -398,12 +398,12 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testGroupByCount() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             conn.setAutoCommit(false);
-            String ddl ="CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+            String ddl ="CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
             Statement stmt = conn.createStatement();
             stmt.execute(ddl);
             BaseTest.populateTestTable(fullTableName);
@@ -419,12 +419,12 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testSelectDistinctOnTableWithSecondaryImmutableIndex() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             conn.setAutoCommit(false);
-            String ddl ="CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+            String ddl ="CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
             Statement stmt = conn.createStatement();
             stmt.execute(ddl);
             BaseTest.populateTestTable(fullTableName);
@@ -445,12 +445,12 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testInClauseWithIndexOnColumnOfUsignedIntType() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             conn.setAutoCommit(false);
-            String ddl ="CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+            String ddl ="CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
             Statement stmt = conn.createStatement();
             stmt.execute(ddl);
             BaseTest.populateTestTable(fullTableName);
@@ -470,8 +470,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void createIndexOnTableWithSpecifiedDefaultCF() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
@@ -512,8 +512,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testIndexWithNullableDateCol() throws Exception {
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
@@ -572,8 +572,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testSelectAllAndAliasWithIndex() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
@@ -651,8 +651,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testSelectCF() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
@@ -712,8 +712,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testUpsertAfterIndexDrop() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
@@ -776,8 +776,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testMultipleUpdatesAcrossRegions() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
 
@@ -869,8 +869,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testIndexWithCaseSensitiveCols() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
@@ -984,8 +984,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testInFilterOnIndexedTable() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
             conn.setAutoCommit(false);
@@ -1005,8 +1005,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
     @Test
     public void testIndexWithDecimalCol() throws Exception {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         String fullIndexName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, indexName);
         try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
@@ -1052,8 +1052,8 @@ public class IndexIT extends ParallelStatsDisabledIT {
      */
     @Test
     public void testTableDescriptorPriority() throws SQLException, IOException {
-        String tableName = "TBL_" + generateRandomString();
-        String indexName = "IND_" + generateRandomString();
+        String tableName = "TBL_" + generateUniqueName();
+        String indexName = "IND_" + generateUniqueName();
         String fullTableName = SchemaUtil.getTableName(TestUtil.DEFAULT_SCHEMA_NAME, tableName);
         // Check system tables priorities.
         try (HBaseAdmin admin = driver.getConnectionQueryServices(null, null).getAdmin()) {
@@ -1067,7 +1067,7 @@ public class IndexIT extends ParallelStatsDisabledIT {
             }
 
             Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
-            String ddl ="CREATE TABLE " + fullTableName + BaseTest.TEST_TABLE_SCHEMA + tableDDLOptions;
+            String ddl ="CREATE TABLE " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + tableDDLOptions;
             try (Connection conn = DriverManager.getConnection(getUrl(), props)) {
                 conn.setAutoCommit(false);
                 Statement stmt = conn.createStatement();

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
index 3372b6a..f0c670b 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
@@ -50,6 +50,7 @@ import org.apache.phoenix.schema.types.PDate;
 import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.SchemaUtil;
 import org.apache.phoenix.util.StringUtil;
+import org.apache.phoenix.util.TestUtil;
 import org.junit.Test;
 
 
@@ -119,11 +120,11 @@ public class IndexMetadataIT extends ParallelStatsDisabledIT {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
-        String indexDataTable = generateRandomString();
+        String indexDataTable = generateUniqueName();
         String fullIndexDataTable = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + indexDataTable;
-        String indexName = generateRandomString();
+        String indexName = generateUniqueName();
         try {
-            String tableDDL = "create table " + fullIndexDataTable + TEST_TABLE_SCHEMA;
+            String tableDDL = "create table " + fullIndexDataTable + TestUtil.TEST_TABLE_SCHEMA;
             conn.createStatement().execute(tableDDL);
             String ddl = "CREATE INDEX " + indexName + " ON " + fullIndexDataTable
                     + " (varchar_col1 ASC, varchar_col2 ASC, int_pk DESC)"
@@ -296,12 +297,12 @@ public class IndexMetadataIT extends ParallelStatsDisabledIT {
     	// column. The definition is defined in IndexUtil.getIndexColumnDataType.
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
-        String indexDataTable = generateRandomString();
-        String indexName = generateRandomString();
+        String indexDataTable = generateUniqueName();
+        String indexName = generateUniqueName();
         conn.setAutoCommit(false);
         try {
             String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + indexDataTable;
-            conn.createStatement().execute("create table " + fullTableName + TEST_TABLE_SCHEMA + "IMMUTABLE_ROWS=true");
+            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + "IMMUTABLE_ROWS=true");
             String ddl = "CREATE INDEX " + indexName + " ON " + fullTableName
                     + " (char_col1 ASC, int_col2 ASC, long_col2 DESC)"
                     + " INCLUDE (int_col1)";
@@ -359,10 +360,10 @@ public class IndexMetadataIT extends ParallelStatsDisabledIT {
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
         String indexName = "\"lowerCaseIndex\"";
-        String indexDataTable = generateRandomString();
+        String indexDataTable = generateUniqueName();
         try {
             String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + indexDataTable;
-            conn.createStatement().execute("create table " + fullTableName + TEST_TABLE_SCHEMA + "IMMUTABLE_ROWS=true");
+            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + "IMMUTABLE_ROWS=true");
             String ddl = "CREATE INDEX " + indexName + " ON " + fullTableName
                     + " (char_col1 ASC, int_col2 ASC, long_col2 DESC)"
                     + " INCLUDE (int_col1)";
@@ -394,11 +395,11 @@ public class IndexMetadataIT extends ParallelStatsDisabledIT {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
-        String indexDataTable = generateRandomString();
-        String indexName = generateRandomString();
+        String indexDataTable = generateUniqueName();
+        String indexName = generateUniqueName();
         try {
             String fullTableName = INDEX_DATA_SCHEMA + QueryConstants.NAME_SEPARATOR + indexDataTable;
-            conn.createStatement().execute("create table " + fullTableName + TEST_TABLE_SCHEMA + "IMMUTABLE_ROWS=true");
+            conn.createStatement().execute("create table " + fullTableName + TestUtil.TEST_TABLE_SCHEMA + "IMMUTABLE_ROWS=true");
             String ddl = "CREATE INDEX " + indexName + " ON " + fullTableName
             		+ " (a.int_col1, a.long_col1, b.int_col2, b.long_col2)"
             		+ " INCLUDE(int_col1, int_col2)";
@@ -456,8 +457,8 @@ public class IndexMetadataIT extends ParallelStatsDisabledIT {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
-        String testTable = generateRandomString();
-        String indexName = generateRandomString();
+        String testTable = generateUniqueName();
+        String indexName = generateUniqueName();
         String ddl = "create table " + testTable  + " (char_pk varchar not null,"
         		+ " a.int_col integer, a.long_col integer,"
         		+ " b.int_col integer, b.long_col integer"
@@ -483,8 +484,8 @@ public class IndexMetadataIT extends ParallelStatsDisabledIT {
     @Test
     public void testBinaryNonnullableIndex() throws Exception {
         Connection conn = DriverManager.getConnection(getUrl());
-        String testTable = generateRandomString();
-        String indexName = generateRandomString();
+        String testTable = generateUniqueName();
+        String indexName = generateUniqueName();
         try {
             String ddl =
                     "CREATE TABLE " + testTable  + " ( "
@@ -533,13 +534,13 @@ public class IndexMetadataIT extends ParallelStatsDisabledIT {
         Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         Connection conn = DriverManager.getConnection(getUrl(), props);
         conn.setAutoCommit(false);
-        String testTable = generateRandomString();
+        String testTable = generateUniqueName();
 
 
         String ddl = "create table " + testTable  + " (k varchar primary key, v1 varchar, v2 varchar, v3 varchar)";
         PreparedStatement stmt = conn.prepareStatement(ddl);
         stmt.execute();
-        String indexName = "ASYNCIND_" + generateRandomString();
+        String indexName = "ASYNCIND_" + generateUniqueName();
         
         ddl = "CREATE INDEX " + indexName + "1 ON " + testTable  + " (v1) ASYNC";
         stmt = conn.prepareStatement(ddl);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/bebb5ced/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
index 9a279bb..214b7ba 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/LocalIndexIT.java
@@ -80,7 +80,7 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
     
     @Before
     public void setup() {
-        schemaName = BaseTest.generateRandomString();
+        schemaName = BaseTest.generateUniqueName();
     }
     
     private void createBaseTable(String tableName, Integer saltBuckets, String splits) throws SQLException {
@@ -107,8 +107,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexRoundTrip() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         String indexTableName = schemaName + "." + indexName;
 
         createBaseTable(tableName, null, null);
@@ -131,8 +131,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexCreationWithSplitsShouldFail() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
 
         createBaseTable(tableName, null, null);
         Connection conn1 = getConnection();
@@ -150,8 +150,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexCreationWithSaltingShouldFail() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
 
         createBaseTable(tableName, null, null);
         Connection conn1 = getConnection();
@@ -169,8 +169,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexTableRegionSplitPolicyAndSplitKeys() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         TableName physicalTableName = SchemaUtil.getPhysicalTableName(tableName.getBytes(), isNamespaceMapped);
         String indexPhysicalTableName = physicalTableName.getNameAsString();
 
@@ -200,8 +200,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testDropLocalIndexTable() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         createBaseTable(tableName, null, null);
 
         String sequenceName = getViewIndexSequenceName(PNameFactory.newName(tableName), null, isNamespaceMapped);
@@ -219,8 +219,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testPutsToLocalIndexTable() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         String indexTableName = schemaName + "." + indexName;
         TableName physicalTableName = SchemaUtil.getPhysicalTableName(tableName.getBytes(), isNamespaceMapped);
         String indexPhysicalTableName = physicalTableName.getNameAsString();
@@ -259,8 +259,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testBuildIndexWhenUserTableAlreadyHasData() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         String indexTableName = schemaName + "." + indexName;
         TableName physicalTableName = SchemaUtil.getPhysicalTableName(tableName.getBytes(), isNamespaceMapped);
         String indexPhysicalTableName = physicalTableName.getNameAsString();
@@ -299,8 +299,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexScan() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         String indexTableName = schemaName + "." + indexName;
         TableName physicalTableName = SchemaUtil.getPhysicalTableName(tableName.getBytes(), isNamespaceMapped);
         String indexPhysicalTableName = physicalTableName.getNameAsString();
@@ -437,8 +437,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexScanJoinColumnsFromDataTable() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         String indexTableName = schemaName + "." + indexName;
         TableName physicalTableName = SchemaUtil.getPhysicalTableName(tableName.getBytes(), isNamespaceMapped);
         String indexPhysicalTableName = physicalTableName.getNameAsString();
@@ -577,8 +577,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testIndexPlanSelectionIfBothGlobalAndLocalIndexesHasSameColumnsAndOrder() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         String indexTableName = schemaName + "." + indexName;
 
         createBaseTable(tableName, null, "('e','i','o')");
@@ -601,8 +601,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testDropLocalIndexShouldDeleteDataFromLocalIndexTable() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
 
         createBaseTable(tableName, null, "('e','i','o')");
         Connection conn1 = DriverManager.getConnection(getUrl());
@@ -646,8 +646,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexRowsShouldBeDeletedWhenUserTableRowsDeleted() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         String indexTableName = schemaName + "." + indexName;
 
         createBaseTable(tableName, null, "('e','i','o')");
@@ -672,8 +672,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
     
     @Test
     public void testScanWhenATableHasMultipleLocalIndexes() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
 
         createBaseTable(tableName, null, "('e','i','o')");
         Connection conn1 = DriverManager.getConnection(getUrl());
@@ -697,8 +697,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexesOnTableWithImmutableRows() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
 
         createBaseTable(tableName, null, "('e','i','o')");
         Connection conn1 = getConnection();
@@ -743,8 +743,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexScanWithInList() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
         String indexTableName = schemaName + "." + indexName;
 
         createBaseTable(tableName, null, "('e','i','o')");
@@ -777,8 +777,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
         Connection conn1 = DriverManager.getConnection(getUrl());
         try{
             Statement statement = conn1.createStatement();
-            String tableName = generateRandomString();
-            String indexName = generateRandomString();
+            String tableName = generateUniqueName();
+            String indexName = generateUniqueName();
             statement.execute("create table " + tableName + " (id integer not null,fn varchar,"
                     + "ln varchar constraint pk primary key(id)) DEFAULT_COLUMN_FAMILY='F'");
             statement.execute("upsert into " + tableName + "  values(1,'fn','ln')");
@@ -794,8 +794,8 @@ public class LocalIndexIT extends ParallelStatsDisabledIT {
 
     @Test
     public void testLocalIndexScanWithSmallChunks() throws Exception {
-        String tableName = schemaName + "." + generateRandomString();
-        String indexName = "IDX_" + generateRandomString();
+        String tableName = schemaName + "." + generateUniqueName();
+        String indexName = "IDX_" + generateUniqueName();
 
         createBaseTable(tableName, 3, null);
         Properties props = new Properties();


Mime
View raw message