phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ramkris...@apache.org
Subject phoenix git commit: PHOENIX-2063 Addendum patch to fix connection usage
Date Fri, 10 Jul 2015 07:51:21 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-0.98 45c9c8aff -> 2e1e8781f


PHOENIX-2063 Addendum patch to fix connection usage


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

Branch: refs/heads/4.x-HBase-0.98
Commit: 2e1e8781f6a85576071e6a20e18bc0fedc86d69b
Parents: 45c9c8a
Author: James Taylor <jtaylor@salesforce.com>
Authored: Thu Jul 9 22:55:25 2015 -0700
Committer: ramkrishna <ramkrishna.s.vasudevan@gmail.com>
Committed: Fri Jul 10 13:20:44 2015 +0530

----------------------------------------------------------------------
 .../phoenix/end2end/RowValueConstructorIT.java  | 28 +++++++++++++++-----
 1 file changed, 21 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/2e1e8781/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
index 0cf5455..b9e50a4 100644
--- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
+++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/RowValueConstructorIT.java
@@ -1426,10 +1426,11 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT
{
 
     @Test
     public void testCountDistinct1() throws Exception {
-        Connection conn = DriverManager.getConnection(getUrl());
+        Connection conn = nextConnection(getUrl());
         String ddl = "CREATE TABLE regions1 (region_name VARCHAR PRIMARY KEY, a INTEGER,
b INTEGER)";
         conn.createStatement().execute(ddl);
-        conn.commit();
+        
+        conn = nextConnection(getUrl());
         PreparedStatement stmt = conn.prepareStatement("UPSERT INTO regions1(region_name,
a, b) VALUES('a', 6,3)");
         stmt.execute();
         stmt = conn.prepareStatement("UPSERT INTO regions1(region_name, a, b) VALUES('b',
2,4)");
@@ -1437,18 +1438,23 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT
{
         stmt = conn.prepareStatement("UPSERT INTO regions1(region_name, a, b) VALUES('c',
6,3)");
         stmt.execute();
         conn.commit();
+
+        conn = nextConnection(getUrl());
         ResultSet rs;
         rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from regions1");
         assertTrue(rs.next());
         assertEquals(2, rs.getInt(1));
+        conn.close();
     }
 
     @Test
     public void testCountDistinct2() throws Exception {
-        Connection conn = DriverManager.getConnection(getUrl());
+        Connection conn = nextConnection(getUrl());
         String ddl = "CREATE TABLE regions2 (region_name VARCHAR PRIMARY KEY, a VARCHAR,
b VARCHAR)";
         conn.createStatement().execute(ddl);
         conn.commit();
+        
+        conn = nextConnection(getUrl());
         PreparedStatement stmt = conn.prepareStatement("UPSERT INTO regions2(region_name,
a, b) VALUES('a', 'fooo','abc')");
         stmt.execute();
         stmt = conn.prepareStatement("UPSERT INTO regions2(region_name, a, b) VALUES('b',
'off','bac')");
@@ -1456,6 +1462,8 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT {
         stmt = conn.prepareStatement("UPSERT INTO regions2(region_name, a, b) VALUES('c',
'fooo', 'abc')");
         stmt.execute();
         conn.commit();
+
+        conn = nextConnection(getUrl());
         ResultSet rs;
         rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from regions2");
         assertTrue(rs.next());
@@ -1464,10 +1472,11 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT
{
 
     @Test
     public void testCountDistinct3() throws Exception {
-        Connection conn = DriverManager.getConnection(getUrl());
+        Connection conn = nextConnection(getUrl());
         String ddl = "CREATE TABLE regions3 (region_name VARCHAR PRIMARY KEY, a Boolean,
b Boolean)";
         conn.createStatement().execute(ddl);
-        conn.commit();
+        
+        conn = nextConnection(getUrl());
         PreparedStatement stmt = conn.prepareStatement("UPSERT INTO regions3(region_name,
a, b) VALUES('a', true, true)");
         stmt.execute();
         stmt = conn.prepareStatement("UPSERT INTO regions3(region_name, a, b) VALUES('b',
true, False)");
@@ -1477,6 +1486,8 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT {
         stmt = conn.prepareStatement("UPSERT INTO regions3(region_name, a, b) VALUES('d',
true, false)");
         stmt.execute();
         conn.commit();
+
+        conn = nextConnection(getUrl());
         ResultSet rs;
         rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from regions3");
         assertTrue(rs.next());
@@ -1485,10 +1496,11 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT
{
 
     @Test
     public void testCountDistinct4() throws Exception {
-        Connection conn = DriverManager.getConnection(getUrl());
+        Connection conn = nextConnection(getUrl());
         String ddl = "CREATE TABLE regions4 (region_name VARCHAR PRIMARY KEY, a VARCHAR,
b VARCHAR)";
         conn.createStatement().execute(ddl);
-        conn.commit();
+        
+        conn = nextConnection(getUrl());
         PreparedStatement stmt = conn.prepareStatement("UPSERT INTO regions4(region_name,
a, b) VALUES('a', 'fooo','abc')");
         stmt.execute();
         stmt = conn.prepareStatement("UPSERT INTO regions4(region_name, a, b) VALUES('b',
'off','bac')");
@@ -1496,6 +1508,8 @@ public class RowValueConstructorIT extends BaseClientManagedTimeIT {
         stmt = conn.prepareStatement("UPSERT INTO regions4(region_name, a, b) VALUES('c',
'foo', 'abc')");
         stmt.execute();
         conn.commit();
+        
+        conn = nextConnection(getUrl());
         ResultSet rs;
         rs = conn.createStatement().executeQuery("SELECT COUNT(DISTINCT (a,b)) from regions4");
         assertTrue(rs.next());


Mime
View raw message