[2/9] PHOENIX-1122 Ensure TEST_PROPERTIES is not updated to prevent test flapping

2014-07-26 Thread jamestaylor
http://git-wip-us.apache.org/repos/asf/phoenix/blob/48614937/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 698ade0..b522931 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
@@ -39,6 +39,7 @@ import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.schema.PTableKey;
+import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -47,7 +48,7 @@ import org.junit.experimental.categories.Category;
 public class ImmutableIndexIT extends BaseHBaseManagedTimeIT {
 // Populate the test table with data.
 private static void populateTestTable() throws SQLException {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 try {
 String upsert = "UPSERT INTO " + INDEX_DATA_SCHEMA + 
QueryConstants.NAME_SEPARATOR + INDEX_DATA_TABLE
@@ -112,7 +113,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testIndexWithNullableFixedWithCols() throws Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
@@ -168,7 +169,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 ResultSet rs;
 String fullTableName = "T";
 
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 
@@ -190,7 +191,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testDeleteFromAllPKColumnIndex() throws Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
@@ -244,7 +245,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testDropIfImmutableKeyValueColumn() throws Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
@@ -278,7 +279,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testGroupByCount() throws Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
@@ -297,7 +298,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test   
 public void testSelectDistinctOnTableWithSecondaryImmutableIndex() throws 
Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
 populateTestTable();
 String ddl = "CREATE INDEX IDX ON " + INDEX_DATA_SCHEMA + 
QueryConstants.NAME_SEPARATOR + INDEX_DATA_TABLE
@@ -333,7 +334,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testInClauseWithIndexOnColumnOfUsignedIntType() throws 
Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = null;
 PreparedStatement stmt = null;
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/48614937/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
--
diff

[2/9] PHOENIX-1122 Ensure TEST_PROPERTIES is not updated to prevent test flapping

2014-07-26 Thread jamestaylor
http://git-wip-us.apache.org/repos/asf/phoenix/blob/6b1d3c78/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 698ade0..b522931 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
@@ -39,6 +39,7 @@ import org.apache.phoenix.exception.SQLExceptionCode;
 import org.apache.phoenix.jdbc.PhoenixConnection;
 import org.apache.phoenix.query.QueryConstants;
 import org.apache.phoenix.schema.PTableKey;
+import org.apache.phoenix.util.PropertiesUtil;
 import org.apache.phoenix.util.QueryUtil;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -47,7 +48,7 @@ import org.junit.experimental.categories.Category;
 public class ImmutableIndexIT extends BaseHBaseManagedTimeIT {
 // Populate the test table with data.
 private static void populateTestTable() throws SQLException {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 try {
 String upsert = "UPSERT INTO " + INDEX_DATA_SCHEMA + 
QueryConstants.NAME_SEPARATOR + INDEX_DATA_TABLE
@@ -112,7 +113,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testIndexWithNullableFixedWithCols() throws Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
@@ -168,7 +169,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 ResultSet rs;
 String fullTableName = "T";
 
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 
@@ -190,7 +191,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testDeleteFromAllPKColumnIndex() throws Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
@@ -244,7 +245,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testDropIfImmutableKeyValueColumn() throws Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
@@ -278,7 +279,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testGroupByCount() throws Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = DriverManager.getConnection(getUrl(), props);
 conn.setAutoCommit(false);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
@@ -297,7 +298,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test   
 public void testSelectDistinctOnTableWithSecondaryImmutableIndex() throws 
Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);
 populateTestTable();
 String ddl = "CREATE INDEX IDX ON " + INDEX_DATA_SCHEMA + 
QueryConstants.NAME_SEPARATOR + INDEX_DATA_TABLE
@@ -333,7 +334,7 @@ public class ImmutableIndexIT extends 
BaseHBaseManagedTimeIT {
 
 @Test
 public void testInClauseWithIndexOnColumnOfUsignedIntType() throws 
Exception {
-Properties props = new Properties(TEST_PROPERTIES);
+Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
 Connection conn = null;
 PreparedStatement stmt = null;
 ensureTableCreated(getUrl(), INDEX_DATA_TABLE);

http://git-wip-us.apache.org/repos/asf/phoenix/blob/6b1d3c78/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/IndexMetadataIT.java
--
diff