Repository: phoenix
Updated Branches:
  refs/heads/master 0ebe0769c -> 828326488


PHOENIX-1174 Rename and move properties using existing convention


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

Branch: refs/heads/master
Commit: 828326488eb7c9ec4b52e674a1eccd854bfa373c
Parents: 0ebe076
Author: James Taylor <jtay...@salesforce.com>
Authored: Sun Aug 17 11:01:26 2014 -0700
Committer: James Taylor <jtay...@salesforce.com>
Committed: Sun Aug 17 11:22:21 2014 -0700

----------------------------------------------------------------------
 .../apache/phoenix/trace/BaseTracingTestIT.java   | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/82832648/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java
----------------------------------------------------------------------
diff --git 
a/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java 
b/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java
index 59cd871..1f4990b 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/trace/BaseTracingTestIT.java
@@ -32,8 +32,12 @@ import org.apache.phoenix.metrics.Metrics;
 import org.apache.phoenix.metrics.PhoenixAbstractMetric;
 import org.apache.phoenix.metrics.PhoenixMetricTag;
 import org.apache.phoenix.metrics.PhoenixMetricsRecord;
+import org.apache.phoenix.query.QueryServicesOptions;
+import org.apache.phoenix.schema.TableNotFoundException;
 import org.apache.phoenix.trace.util.Tracing;
 import org.apache.phoenix.trace.util.Tracing.Frequency;
+import org.apache.phoenix.util.PropertiesUtil;
+import org.junit.Before;
 
 /**
  * Base test for tracing tests - helps manage getting tracing/non-tracing
@@ -62,8 +66,18 @@ public class BaseTracingTestIT extends 
BaseHBaseManagedTimeIT {
         return true;
     }
 
+    @Before
+    public void resetTracingTableIfExists() throws Exception {
+        Connection conn = getConnectionWithoutTracing();
+        conn.setAutoCommit(true);
+        try {
+            conn.createStatement().executeUpdate("DELETE FROM " + 
QueryServicesOptions.DEFAULT_TRACING_STATS_TABLE_NAME);
+        } catch (TableNotFoundException ignore) {
+        }
+    }
+    
     public static Connection getConnectionWithoutTracing() throws SQLException 
{
-        Properties props = new Properties(TEST_PROPERTIES);
+        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         return getConnectionWithoutTracing(props);
     }
 
@@ -74,7 +88,7 @@ public class BaseTracingTestIT extends BaseHBaseManagedTimeIT 
{
     }
 
     public static Connection getTracingConnection() throws Exception {
-        Properties props = new Properties(TEST_PROPERTIES);
+        Properties props = PropertiesUtil.deepCopy(TEST_PROPERTIES);
         return getConnectionWithTracingFrequency(props, 
Tracing.Frequency.ALWAYS);
     }
 

Reply via email to