phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravimag...@apache.org
Subject [1/3] phoenix git commit: PHOENIX-1454 - Map Reduce over Phoenix tables
Date Tue, 09 Dec 2014 02:09:11 GMT
Repository: phoenix
Updated Branches:
  refs/heads/master ceded2266 -> f84e5da33


http://git-wip-us.apache.org/repos/asf/phoenix/blob/f84e5da3/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/QuerySchemaParserFunctionTest.java
----------------------------------------------------------------------
diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/QuerySchemaParserFunctionTest.java
b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/QuerySchemaParserFunctionTest.java
index 3daf4e1..27fd879 100644
--- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/QuerySchemaParserFunctionTest.java
+++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/QuerySchemaParserFunctionTest.java
@@ -22,15 +22,12 @@ package org.apache.phoenix.pig.util;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.fail;
 
-import java.sql.Connection;
-import java.sql.DriverManager;
 import java.sql.SQLException;
 
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.hadoop.hbase.util.Pair;
-import org.apache.phoenix.pig.PhoenixPigConfiguration;
-import org.apache.phoenix.pig.util.QuerySchemaParserFunction;
 import org.apache.phoenix.query.BaseConnectionlessQueryTest;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
@@ -44,16 +41,14 @@ import com.google.common.base.Joiner;
  */
 public class QuerySchemaParserFunctionTest extends BaseConnectionlessQueryTest {
 
-    private PhoenixPigConfiguration phoenixConfiguration;
-    private Connection conn;
+    private Configuration configuration;
     private QuerySchemaParserFunction function;
     
     @Before
     public void setUp() throws SQLException {
-        phoenixConfiguration = Mockito.mock(PhoenixPigConfiguration.class);
-        conn = DriverManager.getConnection(getUrl());
-        Mockito.when(phoenixConfiguration.getConnection()).thenReturn(conn);
-        function = new QuerySchemaParserFunction(phoenixConfiguration);
+        configuration = Mockito.mock(Configuration.class);
+        Mockito.when(configuration.get(HConstants.ZOOKEEPER_QUORUM)).thenReturn(getUrl());
+        function = new QuerySchemaParserFunction(configuration);
     }
     
     @Test(expected=RuntimeException.class)
@@ -101,9 +96,4 @@ public class QuerySchemaParserFunctionTest extends BaseConnectionlessQueryTest
{
         function.apply(selectQuery);
         fail(" Function call successful despite passing an aggreagate query");
     }
-
-    @After
-    public void tearDown() throws SQLException {
-        conn.close();
-    }
 }

http://git-wip-us.apache.org/repos/asf/phoenix/blob/f84e5da3/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/SqlQueryToColumnInfoFunctionTest.java
----------------------------------------------------------------------
diff --git a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/SqlQueryToColumnInfoFunctionTest.java
b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/SqlQueryToColumnInfoFunctionTest.java
index 1bd16e3..667d814 100644
--- a/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/SqlQueryToColumnInfoFunctionTest.java
+++ b/phoenix-pig/src/test/java/org/apache/phoenix/pig/util/SqlQueryToColumnInfoFunctionTest.java
@@ -19,16 +19,14 @@
  */
 package org.apache.phoenix.pig.util;
 
-import java.sql.Connection;
-import java.sql.DriverManager;
 import java.sql.SQLException;
 import java.sql.Types;
 import java.util.List;
 
-import org.apache.phoenix.pig.PhoenixPigConfiguration;
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.HConstants;
 import org.apache.phoenix.query.BaseConnectionlessQueryTest;
 import org.apache.phoenix.util.ColumnInfo;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -38,16 +36,14 @@ import com.google.common.collect.ImmutableList;
 
 public class SqlQueryToColumnInfoFunctionTest  extends BaseConnectionlessQueryTest {
 
-    private PhoenixPigConfiguration phoenixConfiguration;
-    private Connection conn;
+    private Configuration configuration;
     private SqlQueryToColumnInfoFunction function;
     
     @Before
     public void setUp() throws SQLException {
-        phoenixConfiguration = Mockito.mock(PhoenixPigConfiguration.class);
-        conn = DriverManager.getConnection(getUrl());
-        Mockito.when(phoenixConfiguration.getConnection()).thenReturn(conn);
-        function = new SqlQueryToColumnInfoFunction(phoenixConfiguration);
+        configuration = Mockito.mock(Configuration.class);
+        Mockito.when(configuration.get(HConstants.ZOOKEEPER_QUORUM)).thenReturn(getUrl());
+        function = new SqlQueryToColumnInfoFunction(configuration);
     }
     
     @Test
@@ -66,10 +62,4 @@ public class SqlQueryToColumnInfoFunctionTest  extends BaseConnectionlessQueryTe
         Assert.assertEquals(expectedColumnInfos, actualColumnInfos);
         
     }
-    
-    @After
-    public void tearDown() throws SQLException {
-        conn.close();
-    }
-
 }


Mime
View raw message