GEODE-37 change package name from io.pivotal.geode (for 
./geode-spark-connector/src/test/java/io/pivotal)to org.apache.geode for(to 
./geode-spark-connector/src/test/java/org/apache)


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

Branch: refs/heads/develop
Commit: f530d3af7e412f8097d408a1001e37e57a70b4c0
Parents: 106cc60
Author: Hitesh Khamesra <hkhame...@pivotal.io>
Authored: Tue Sep 20 15:44:10 2016 -0700
Committer: Hitesh Khamesra <hkhame...@pivotal.io>
Committed: Tue Sep 20 16:01:02 2016 -0700

----------------------------------------------------------------------
 .../geode/spark/connector/JavaAPITest.java      | 163 -------------------
 .../geode/spark/connector/JavaAPITest.java      | 163 +++++++++++++++++++
 2 files changed, 163 insertions(+), 163 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f530d3af/geode-spark-connector/geode-spark-connector/src/test/java/io/pivotal/geode/spark/connector/JavaAPITest.java
----------------------------------------------------------------------
diff --git 
a/geode-spark-connector/geode-spark-connector/src/test/java/io/pivotal/geode/spark/connector/JavaAPITest.java
 
b/geode-spark-connector/geode-spark-connector/src/test/java/io/pivotal/geode/spark/connector/JavaAPITest.java
deleted file mode 100644
index 142907e..0000000
--- 
a/geode-spark-connector/geode-spark-connector/src/test/java/io/pivotal/geode/spark/connector/JavaAPITest.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package io.pivotal.geode.spark.connector;
-
-import io.pivotal.geode.spark.connector.javaapi.*;
-import org.apache.spark.SparkContext;
-import org.apache.spark.api.java.JavaPairRDD;
-import org.apache.spark.api.java.JavaRDD;
-import org.apache.spark.api.java.JavaSparkContext;
-import org.apache.spark.api.java.function.PairFunction;
-import org.apache.spark.rdd.RDD;
-import org.apache.spark.sql.SQLContext;
-//import org.apache.spark.sql.api.java.JavaSQLContext;
-import org.apache.spark.streaming.api.java.JavaDStream;
-import org.apache.spark.streaming.api.java.JavaPairDStream;
-import org.apache.spark.streaming.dstream.DStream;
-import org.junit.Test;
-import org.scalatest.junit.JUnitSuite;
-import scala.Function1;
-import scala.Function2;
-import scala.Tuple2;
-import scala.Tuple3;
-import scala.collection.mutable.LinkedList;
-import scala.reflect.ClassTag;
-
-import static org.junit.Assert.*;
-import static io.pivotal.geode.spark.connector.javaapi.GeodeJavaUtil.*;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.*;
-
-public class JavaAPITest extends JUnitSuite {
-
-  @SuppressWarnings( "unchecked" )
-  public Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> 
createCommonMocks() {
-    SparkContext mockSparkContext = mock(SparkContext.class);
-    GeodeConnectionConf mockConnConf = mock(GeodeConnectionConf.class);
-    GeodeConnection mockConnection = mock(GeodeConnection.class);
-    when(mockConnConf.getConnection()).thenReturn(mockConnection);
-    when(mockConnConf.locators()).thenReturn(new LinkedList());
-    return new Tuple3<>(mockSparkContext, mockConnConf, mockConnection);
-  }
-  
-  @Test
-  public void testSparkContextFunction() throws Exception {
-    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
-    GeodeJavaSparkContextFunctions wrapper = javaFunctions(tuple3._1());
-    assertTrue(tuple3._1() == wrapper.sc);
-    String regionPath = "testregion";
-    JavaPairRDD<String, String> rdd = wrapper.geodeRegion(regionPath, 
tuple3._2());
-    verify(tuple3._3()).validateRegion(regionPath);
-  }
-
-  @Test
-  public void testJavaSparkContextFunctions() throws Exception {
-    SparkContext mockSparkContext = mock(SparkContext.class);
-    JavaSparkContext mockJavaSparkContext = mock(JavaSparkContext.class);
-    when(mockJavaSparkContext.sc()).thenReturn(mockSparkContext);
-    GeodeJavaSparkContextFunctions wrapper = 
javaFunctions(mockJavaSparkContext);
-    assertTrue(mockSparkContext == wrapper.sc);
-  }
-  
-  @Test
-  @SuppressWarnings( "unchecked" )
-  public void testJavaPairRDDFunctions() throws Exception {
-    JavaPairRDD<String, Integer> mockPairRDD = mock(JavaPairRDD.class);
-    RDD<Tuple2<String, Integer>> mockTuple2RDD = mock(RDD.class);
-    when(mockPairRDD.rdd()).thenReturn(mockTuple2RDD);
-    GeodeJavaPairRDDFunctions wrapper = javaFunctions(mockPairRDD);
-    assertTrue(mockTuple2RDD == wrapper.rddf.rdd());
-
-    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
-    when(mockTuple2RDD.sparkContext()).thenReturn(tuple3._1());
-    String regionPath = "testregion";
-    wrapper.saveToGeode(regionPath, tuple3._2());
-    verify(mockTuple2RDD, times(1)).sparkContext();
-    verify(tuple3._1(), times(1)).runJob(eq(mockTuple2RDD), 
any(Function2.class), any(ClassTag.class));
-  }
-
-  @Test
-  @SuppressWarnings( "unchecked" )
-  public void testJavaRDDFunctions() throws Exception {
-    JavaRDD<String> mockJavaRDD = mock(JavaRDD.class);
-    RDD<String> mockRDD = mock(RDD.class);
-    when(mockJavaRDD.rdd()).thenReturn(mockRDD);
-    GeodeJavaRDDFunctions wrapper = javaFunctions(mockJavaRDD);
-    assertTrue(mockRDD == wrapper.rddf.rdd());
-
-    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
-    when(mockRDD.sparkContext()).thenReturn(tuple3._1());
-    PairFunction<String, String, Integer> mockPairFunc = 
mock(PairFunction.class);
-    String regionPath = "testregion";
-    wrapper.saveToGeode(regionPath, mockPairFunc, tuple3._2());
-    verify(mockRDD, times(1)).sparkContext();
-    verify(tuple3._1(), times(1)).runJob(eq(mockRDD), any(Function2.class), 
any(ClassTag.class));
-  }
-
-  @Test
-  @SuppressWarnings( "unchecked" )
-  public void testJavaPairDStreamFunctions() throws Exception {
-    JavaPairDStream<String, String> mockJavaDStream = 
mock(JavaPairDStream.class);
-    DStream<Tuple2<String, String>> mockDStream = mock(DStream.class);
-    when(mockJavaDStream.dstream()).thenReturn(mockDStream);
-    GeodeJavaPairDStreamFunctions wrapper = javaFunctions(mockJavaDStream);
-    assertTrue(mockDStream == wrapper.dsf.dstream());
-
-    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
-    String regionPath = "testregion";
-    wrapper.saveToGeode(regionPath, tuple3._2());
-    verify(tuple3._2()).getConnection();
-    verify(tuple3._3()).validateRegion(regionPath);
-    verify(mockDStream).foreachRDD(any(Function1.class));
-  }
-
-  @Test
-  @SuppressWarnings( "unchecked" )
-  public void testJavaPairDStreamFunctionsWithTuple2DStream() throws Exception 
{
-    JavaDStream<Tuple2<String, String>> mockJavaDStream = 
mock(JavaDStream.class);
-    DStream<Tuple2<String, String>> mockDStream = mock(DStream.class);
-    when(mockJavaDStream.dstream()).thenReturn(mockDStream);
-    GeodeJavaPairDStreamFunctions wrapper = 
javaFunctions(toJavaPairDStream(mockJavaDStream));
-    assertTrue(mockDStream == wrapper.dsf.dstream());
-  }
-
-  @Test
-  @SuppressWarnings( "unchecked" )
-  public void testJavaDStreamFunctions() throws Exception {
-    JavaDStream<String> mockJavaDStream = mock(JavaDStream.class);
-    DStream<String> mockDStream = mock(DStream.class);
-    when(mockJavaDStream.dstream()).thenReturn(mockDStream);
-    GeodeJavaDStreamFunctions wrapper = javaFunctions(mockJavaDStream);
-    assertTrue(mockDStream == wrapper.dsf.dstream());
-
-    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
-    PairFunction<String, String, Integer> mockPairFunc = 
mock(PairFunction.class);
-    String regionPath = "testregion";
-    wrapper.saveToGeode(regionPath, mockPairFunc, tuple3._2());
-    verify(tuple3._2()).getConnection();
-    verify(tuple3._3()).validateRegion(regionPath);
-    verify(mockDStream).foreachRDD(any(Function1.class));
-  }
-
-  @Test
-  public void testSQLContextFunction() throws Exception {
-    SQLContext mockSQLContext = mock(SQLContext.class);
-    GeodeJavaSQLContextFunctions wrapper = javaFunctions(mockSQLContext);
-    assertTrue(wrapper.scf.getClass() == GeodeSQLContextFunctions.class);
-  }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/f530d3af/geode-spark-connector/geode-spark-connector/src/test/java/org/apache/geode/spark/connector/JavaAPITest.java
----------------------------------------------------------------------
diff --git 
a/geode-spark-connector/geode-spark-connector/src/test/java/org/apache/geode/spark/connector/JavaAPITest.java
 
b/geode-spark-connector/geode-spark-connector/src/test/java/org/apache/geode/spark/connector/JavaAPITest.java
new file mode 100644
index 0000000..142907e
--- /dev/null
+++ 
b/geode-spark-connector/geode-spark-connector/src/test/java/org/apache/geode/spark/connector/JavaAPITest.java
@@ -0,0 +1,163 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.pivotal.geode.spark.connector;
+
+import io.pivotal.geode.spark.connector.javaapi.*;
+import org.apache.spark.SparkContext;
+import org.apache.spark.api.java.JavaPairRDD;
+import org.apache.spark.api.java.JavaRDD;
+import org.apache.spark.api.java.JavaSparkContext;
+import org.apache.spark.api.java.function.PairFunction;
+import org.apache.spark.rdd.RDD;
+import org.apache.spark.sql.SQLContext;
+//import org.apache.spark.sql.api.java.JavaSQLContext;
+import org.apache.spark.streaming.api.java.JavaDStream;
+import org.apache.spark.streaming.api.java.JavaPairDStream;
+import org.apache.spark.streaming.dstream.DStream;
+import org.junit.Test;
+import org.scalatest.junit.JUnitSuite;
+import scala.Function1;
+import scala.Function2;
+import scala.Tuple2;
+import scala.Tuple3;
+import scala.collection.mutable.LinkedList;
+import scala.reflect.ClassTag;
+
+import static org.junit.Assert.*;
+import static io.pivotal.geode.spark.connector.javaapi.GeodeJavaUtil.*;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.*;
+
+public class JavaAPITest extends JUnitSuite {
+
+  @SuppressWarnings( "unchecked" )
+  public Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> 
createCommonMocks() {
+    SparkContext mockSparkContext = mock(SparkContext.class);
+    GeodeConnectionConf mockConnConf = mock(GeodeConnectionConf.class);
+    GeodeConnection mockConnection = mock(GeodeConnection.class);
+    when(mockConnConf.getConnection()).thenReturn(mockConnection);
+    when(mockConnConf.locators()).thenReturn(new LinkedList());
+    return new Tuple3<>(mockSparkContext, mockConnConf, mockConnection);
+  }
+  
+  @Test
+  public void testSparkContextFunction() throws Exception {
+    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
+    GeodeJavaSparkContextFunctions wrapper = javaFunctions(tuple3._1());
+    assertTrue(tuple3._1() == wrapper.sc);
+    String regionPath = "testregion";
+    JavaPairRDD<String, String> rdd = wrapper.geodeRegion(regionPath, 
tuple3._2());
+    verify(tuple3._3()).validateRegion(regionPath);
+  }
+
+  @Test
+  public void testJavaSparkContextFunctions() throws Exception {
+    SparkContext mockSparkContext = mock(SparkContext.class);
+    JavaSparkContext mockJavaSparkContext = mock(JavaSparkContext.class);
+    when(mockJavaSparkContext.sc()).thenReturn(mockSparkContext);
+    GeodeJavaSparkContextFunctions wrapper = 
javaFunctions(mockJavaSparkContext);
+    assertTrue(mockSparkContext == wrapper.sc);
+  }
+  
+  @Test
+  @SuppressWarnings( "unchecked" )
+  public void testJavaPairRDDFunctions() throws Exception {
+    JavaPairRDD<String, Integer> mockPairRDD = mock(JavaPairRDD.class);
+    RDD<Tuple2<String, Integer>> mockTuple2RDD = mock(RDD.class);
+    when(mockPairRDD.rdd()).thenReturn(mockTuple2RDD);
+    GeodeJavaPairRDDFunctions wrapper = javaFunctions(mockPairRDD);
+    assertTrue(mockTuple2RDD == wrapper.rddf.rdd());
+
+    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
+    when(mockTuple2RDD.sparkContext()).thenReturn(tuple3._1());
+    String regionPath = "testregion";
+    wrapper.saveToGeode(regionPath, tuple3._2());
+    verify(mockTuple2RDD, times(1)).sparkContext();
+    verify(tuple3._1(), times(1)).runJob(eq(mockTuple2RDD), 
any(Function2.class), any(ClassTag.class));
+  }
+
+  @Test
+  @SuppressWarnings( "unchecked" )
+  public void testJavaRDDFunctions() throws Exception {
+    JavaRDD<String> mockJavaRDD = mock(JavaRDD.class);
+    RDD<String> mockRDD = mock(RDD.class);
+    when(mockJavaRDD.rdd()).thenReturn(mockRDD);
+    GeodeJavaRDDFunctions wrapper = javaFunctions(mockJavaRDD);
+    assertTrue(mockRDD == wrapper.rddf.rdd());
+
+    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
+    when(mockRDD.sparkContext()).thenReturn(tuple3._1());
+    PairFunction<String, String, Integer> mockPairFunc = 
mock(PairFunction.class);
+    String regionPath = "testregion";
+    wrapper.saveToGeode(regionPath, mockPairFunc, tuple3._2());
+    verify(mockRDD, times(1)).sparkContext();
+    verify(tuple3._1(), times(1)).runJob(eq(mockRDD), any(Function2.class), 
any(ClassTag.class));
+  }
+
+  @Test
+  @SuppressWarnings( "unchecked" )
+  public void testJavaPairDStreamFunctions() throws Exception {
+    JavaPairDStream<String, String> mockJavaDStream = 
mock(JavaPairDStream.class);
+    DStream<Tuple2<String, String>> mockDStream = mock(DStream.class);
+    when(mockJavaDStream.dstream()).thenReturn(mockDStream);
+    GeodeJavaPairDStreamFunctions wrapper = javaFunctions(mockJavaDStream);
+    assertTrue(mockDStream == wrapper.dsf.dstream());
+
+    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
+    String regionPath = "testregion";
+    wrapper.saveToGeode(regionPath, tuple3._2());
+    verify(tuple3._2()).getConnection();
+    verify(tuple3._3()).validateRegion(regionPath);
+    verify(mockDStream).foreachRDD(any(Function1.class));
+  }
+
+  @Test
+  @SuppressWarnings( "unchecked" )
+  public void testJavaPairDStreamFunctionsWithTuple2DStream() throws Exception 
{
+    JavaDStream<Tuple2<String, String>> mockJavaDStream = 
mock(JavaDStream.class);
+    DStream<Tuple2<String, String>> mockDStream = mock(DStream.class);
+    when(mockJavaDStream.dstream()).thenReturn(mockDStream);
+    GeodeJavaPairDStreamFunctions wrapper = 
javaFunctions(toJavaPairDStream(mockJavaDStream));
+    assertTrue(mockDStream == wrapper.dsf.dstream());
+  }
+
+  @Test
+  @SuppressWarnings( "unchecked" )
+  public void testJavaDStreamFunctions() throws Exception {
+    JavaDStream<String> mockJavaDStream = mock(JavaDStream.class);
+    DStream<String> mockDStream = mock(DStream.class);
+    when(mockJavaDStream.dstream()).thenReturn(mockDStream);
+    GeodeJavaDStreamFunctions wrapper = javaFunctions(mockJavaDStream);
+    assertTrue(mockDStream == wrapper.dsf.dstream());
+
+    Tuple3<SparkContext, GeodeConnectionConf, GeodeConnection> tuple3 = 
createCommonMocks();
+    PairFunction<String, String, Integer> mockPairFunc = 
mock(PairFunction.class);
+    String regionPath = "testregion";
+    wrapper.saveToGeode(regionPath, mockPairFunc, tuple3._2());
+    verify(tuple3._2()).getConnection();
+    verify(tuple3._3()).validateRegion(regionPath);
+    verify(mockDStream).foreachRDD(any(Function1.class));
+  }
+
+  @Test
+  public void testSQLContextFunction() throws Exception {
+    SQLContext mockSQLContext = mock(SQLContext.class);
+    GeodeJavaSQLContextFunctions wrapper = javaFunctions(mockSQLContext);
+    assertTrue(wrapper.scf.getClass() == GeodeSQLContextFunctions.class);
+  }
+
+}

Reply via email to