Repository: gora
Updated Branches:
  refs/heads/master 1b20b1072 -> 25188aacd


Remove deprecated methods from data store test base


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

Branch: refs/heads/master
Commit: 25188aacd98cbcfeec79026a285fb7b1f37187eb
Parents: 1b20b10
Author: nishadi <ndime...@gmail.com>
Authored: Fri Jun 2 14:43:34 2017 +0530
Committer: nishadi <ndime...@gmail.com>
Committed: Fri Jun 2 14:43:34 2017 +0530

----------------------------------------------------------------------
 .../gora/accumulo/store/AccumuloStoreTest.java  | 13 +-----
 .../cassandra/store/TestCassandraStore.java     | 12 ------
 .../apache/gora/memory/store/MemStoreTest.java  | 16 ++-----
 .../gora/memory/store/MemStoreTestDriver.java   | 44 ++++++++++++++++++++
 .../apache/gora/store/DataStoreTestBase.java    | 13 ------
 .../gora/couchdb/store/TestCouchDBStore.java    | 12 ------
 .../apache/gora/hbase/store/TestHBaseStore.java | 16 -------
 .../infinispan/store/InfinispanStoreTest.java   | 12 ------
 .../jcache/store/JCacheGoraDataStoreTest.java   | 10 -----
 .../gora/mongodb/store/TestMongoStore.java      | 14 -------
 .../apache/gora/solr/store/TestSolrStore.java   | 16 -------
 11 files changed, 49 insertions(+), 129 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/AccumuloStoreTest.java
----------------------------------------------------------------------
diff --git 
a/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/AccumuloStoreTest.java
 
b/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/AccumuloStoreTest.java
index 285f439..f8b7526 100644
--- 
a/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/AccumuloStoreTest.java
+++ 
b/gora-accumulo/src/test/java/org/apache/gora/accumulo/store/AccumuloStoreTest.java
@@ -51,18 +51,7 @@ public class AccumuloStoreTest extends DataStoreTestBase {
     return (GoraAccumuloTestDriver) testDriver;
   }
 
-  @Override
-  protected DataStore<String,Employee> createEmployeeDataStore() throws 
IOException {
-    return DataStoreFactory.getDataStore(String.class, Employee.class, new 
Configuration());
-  }
-
-  @Override
-  protected DataStore<String,WebPage> createWebPageDataStore() throws 
IOException {
-    return DataStoreFactory.getDataStore(String.class, WebPage.class, new 
Configuration());
-  }
-
-
-  //Until GORA-66 is resolved this test will always fail, so 
+  //Until GORA-66 is resolved this test will always fail, so
   //do not run it
   @Ignore("skipped until GORA-66 is resolved")
   @Override

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java
----------------------------------------------------------------------
diff --git 
a/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java
 
b/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java
index aad1a87..9518891 100644
--- 
a/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java
+++ 
b/gora-cassandra/src/test/java/org/apache/gora/cassandra/store/TestCassandraStore.java
@@ -51,18 +51,6 @@ public class TestCassandraStore extends DataStoreTestBase{
     super.setUp();
   }
 
-  @SuppressWarnings("unchecked")
-  @Override
-  protected DataStore<String, Employee> createEmployeeDataStore() throws 
IOException {
-    return DataStoreFactory.getDataStore(CassandraStore.class, String.class, 
Employee.class, conf);
-  }
-
-  @SuppressWarnings("unchecked")
-  @Override
-  protected DataStore<String, WebPage> createWebPageDataStore() throws 
IOException {
-    return DataStoreFactory.getDataStore(CassandraStore.class, String.class, 
WebPage.class, conf);
-  }
-
   public GoraCassandraTestDriver getTestDriver() {
     return (GoraCassandraTestDriver) testDriver;
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-core/src/test/java/org/apache/gora/memory/store/MemStoreTest.java
----------------------------------------------------------------------
diff --git 
a/gora-core/src/test/java/org/apache/gora/memory/store/MemStoreTest.java 
b/gora-core/src/test/java/org/apache/gora/memory/store/MemStoreTest.java
index 8e94662..3972cca 100644
--- a/gora-core/src/test/java/org/apache/gora/memory/store/MemStoreTest.java
+++ b/gora-core/src/test/java/org/apache/gora/memory/store/MemStoreTest.java
@@ -58,23 +58,15 @@ public class MemStoreTest extends DataStoreTestBase {
 
   private Configuration conf;
 
+  static {
+    setTestDriver(new MemStoreTestDriver());
+  }
+
   @Before
   public void setUp() throws Exception {
     super.setUp();
   }
 
-  @SuppressWarnings("unchecked")
-  @Override
-  protected DataStore<String, Employee> createEmployeeDataStore() throws 
IOException {
-    return DataStoreFactory.getDataStore(MemStore.class, String.class, 
Employee.class, conf);
-  }
-
-  @SuppressWarnings("unchecked")
-  @Override
-  protected DataStore<String, WebPage> createWebPageDataStore() throws 
IOException {
-    return DataStoreFactory.getDataStore(MemStore.class, String.class, 
WebPage.class, conf);
-  }
-
   @Test
   public void testGetMissingValue() {
     DataStore<String, WebPage> store = new MemStore<>();

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-core/src/test/java/org/apache/gora/memory/store/MemStoreTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-core/src/test/java/org/apache/gora/memory/store/MemStoreTestDriver.java 
b/gora-core/src/test/java/org/apache/gora/memory/store/MemStoreTestDriver.java
new file mode 100644
index 0000000..f99586f
--- /dev/null
+++ 
b/gora-core/src/test/java/org/apache/gora/memory/store/MemStoreTestDriver.java
@@ -0,0 +1,44 @@
+/**
+ * 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 org.apache.gora.memory.store;
+
+import org.apache.gora.GoraTestDriver;
+
+/**
+ * MemStoreTestDriver class is used to initialize
+ * the data stores for MemStoreTest
+ */
+public class MemStoreTestDriver extends GoraTestDriver {
+
+  public MemStoreTestDriver() {
+    super(MemStore.class);
+  }
+
+  @Override
+  public void setUpClass() throws Exception {
+    // Method is not implemented as MemStore does not include
+    // third party clusters
+  }
+
+  @Override
+  public void tearDownClass() throws Exception {
+    // Method is not implemented as MemStore does not include
+    // third party clusters
+  }
+}

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java
----------------------------------------------------------------------
diff --git 
a/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java 
b/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java
index adca963..2de6a41 100644
--- a/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java
+++ b/gora-core/src/test/java/org/apache/gora/store/DataStoreTestBase.java
@@ -45,13 +45,6 @@ public abstract class DataStoreTestBase {
   protected DataStore<String,Employee> employeeStore;
   protected DataStore<String,WebPage> webPageStore;
 
-  @Deprecated
-  protected abstract DataStore<String,Employee> createEmployeeDataStore() 
throws IOException;
-
-  @Deprecated
-  protected abstract DataStore<String,WebPage> createWebPageDataStore() throws 
IOException;
-
-
   /** junit annoyingly forces BeforeClass to be static, so this method
    * should be called from a static block
    */
@@ -92,12 +85,6 @@ public abstract class DataStoreTestBase {
       employeeStore = testDriver.createDataStore(String.class, Employee.class);
       webPageStore = testDriver.createDataStore(String.class, WebPage.class);
       testDriver.setUp();
-    } else {
-      employeeStore =  createEmployeeDataStore();
-      webPageStore = createWebPageDataStore();
-
-      employeeStore.truncateSchema();
-      webPageStore.truncateSchema();
     }
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-couchdb/src/test/java/org/apache/gora/couchdb/store/TestCouchDBStore.java
----------------------------------------------------------------------
diff --git 
a/gora-couchdb/src/test/java/org/apache/gora/couchdb/store/TestCouchDBStore.java
 
b/gora-couchdb/src/test/java/org/apache/gora/couchdb/store/TestCouchDBStore.java
index 1c8fb9d..b2cfc9a 100644
--- 
a/gora-couchdb/src/test/java/org/apache/gora/couchdb/store/TestCouchDBStore.java
+++ 
b/gora-couchdb/src/test/java/org/apache/gora/couchdb/store/TestCouchDBStore.java
@@ -62,18 +62,6 @@ public class TestCouchDBStore extends DataStoreTestBase {
     super.setUp();
   }
 
-  @SuppressWarnings("unchecked")
-  @Override
-  protected DataStore<String, Employee> createEmployeeDataStore() throws 
IOException {
-    throw new UnsupportedOperationException();
-  }
-
-  @SuppressWarnings("unchecked")
-  @Override
-  protected DataStore<String, WebPage> createWebPageDataStore() throws 
IOException {
-    throw new UnsupportedOperationException();
-  }
-
   @Test
   public void testPutAndGet() {
     WebPage page = webPageStore.newPersistent();

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
----------------------------------------------------------------------
diff --git 
a/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java 
b/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
index 7fd320a..ccfea85 100644
--- a/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
+++ b/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
@@ -58,22 +58,6 @@ public class TestHBaseStore extends DataStoreTestBase {
     super.setUp();
     conf = getTestDriver().getConf();
   }
-    
-  @SuppressWarnings("unchecked")
-  @Override
-  protected DataStore<String, Employee> createEmployeeDataStore()
-      throws IOException {
-    return DataStoreFactory.createDataStore(HBaseStore.class, String.class, 
-        Employee.class, conf);
-  }
-
-  @SuppressWarnings("unchecked")
-  @Override
-  protected DataStore<String, WebPage> createWebPageDataStore()
-      throws IOException {
-    return DataStoreFactory.createDataStore(HBaseStore.class, String.class, 
-        WebPage.class, conf);
-  }
 
   public GoraHBaseTestDriver getTestDriver() {
     return (GoraHBaseTestDriver) testDriver;

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-infinispan/src/test/java/org/apache/gora/infinispan/store/InfinispanStoreTest.java
----------------------------------------------------------------------
diff --git 
a/gora-infinispan/src/test/java/org/apache/gora/infinispan/store/InfinispanStoreTest.java
 
b/gora-infinispan/src/test/java/org/apache/gora/infinispan/store/InfinispanStoreTest.java
index 5d17ee2..9289e1d 100644
--- 
a/gora-infinispan/src/test/java/org/apache/gora/infinispan/store/InfinispanStoreTest.java
+++ 
b/gora-infinispan/src/test/java/org/apache/gora/infinispan/store/InfinispanStoreTest.java
@@ -77,18 +77,6 @@ public class InfinispanStoreTest extends DataStoreTestBase {
     webPageDataStore = (InfinispanStore<String, WebPage>) webPageStore;
   }
 
-  @Override
-  protected DataStore<String, Employee> createEmployeeDataStore()
-      throws IOException {
-    throw new IllegalStateException("Using driver.");
-  }
-
-  @Override
-  protected DataStore<String, WebPage> createWebPageDataStore()
-      throws IOException {
-    throw new IllegalStateException("Using driver.");
-  }
-
   @Test
   public void testQueryMarshability() throws Exception {
     Utils.populateEmployeeStore(employeeStore, 100);

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-jcache/src/test/java/org/apache/gora/jcache/store/JCacheGoraDataStoreTest.java
----------------------------------------------------------------------
diff --git 
a/gora-jcache/src/test/java/org/apache/gora/jcache/store/JCacheGoraDataStoreTest.java
 
b/gora-jcache/src/test/java/org/apache/gora/jcache/store/JCacheGoraDataStoreTest.java
index dc81ee5..5d4c225 100644
--- 
a/gora-jcache/src/test/java/org/apache/gora/jcache/store/JCacheGoraDataStoreTest.java
+++ 
b/gora-jcache/src/test/java/org/apache/gora/jcache/store/JCacheGoraDataStoreTest.java
@@ -79,16 +79,6 @@ public class JCacheGoraDataStoreTest extends 
DataStoreTestBase {
     super.webPageStore.close();
   }
 
-  @SuppressWarnings("unchecked")
-  protected DataStore<String, Employee> createEmployeeDataStore() throws 
IOException {
-    return DataStoreFactory.getDataStore(String.class, Employee.class, conf, 
true);
-  }
-
-  @SuppressWarnings("unchecked")
-  protected DataStore<String, WebPage> createWebPageDataStore() throws 
IOException {
-    return DataStoreFactory.getDataStore(String.class, WebPage.class, conf, 
true);
-  }
-
   @Test
   public void testGetMissingValue() throws IOException {
     DataStore<String, WebPage> store = super.webPageStore;

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoStore.java
----------------------------------------------------------------------
diff --git 
a/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoStore.java 
b/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoStore.java
index 1271acf..62e19f9 100644
--- 
a/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoStore.java
+++ 
b/gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoStore.java
@@ -42,20 +42,6 @@ public abstract class TestMongoStore extends 
DataStoreTestBase {
 
   private int keySequence;
 
-  @Deprecated
-  @Override
-  protected DataStore<String, Employee> createEmployeeDataStore()
-          throws IOException {
-    throw new UnsupportedOperationException();
-  }
-
-  @Deprecated
-  @Override
-  protected DataStore<String, WebPage> createWebPageDataStore()
-          throws IOException {
-    throw new UnsupportedOperationException();
-  }
-
   @Before
   @Override
   public void setUp() throws Exception {

http://git-wip-us.apache.org/repos/asf/gora/blob/25188aac/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrStore.java
----------------------------------------------------------------------
diff --git 
a/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrStore.java 
b/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrStore.java
index 4c86e1c..4aae629 100644
--- a/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrStore.java
+++ b/gora-solr-5/src/test/java/org/apache/gora/solr/store/TestSolrStore.java
@@ -47,22 +47,6 @@ public class TestSolrStore extends DataStoreTestBase {
   }
 
   @Override
-  protected DataStore<String, Employee> createEmployeeDataStore()
-      throws IOException {
-    SolrStore<String, Employee> store = new SolrStore<>();
-    store.initialize(String.class, Employee.class, 
DataStoreFactory.createProps());
-    return store;
-  }
-
-  @Override
-  protected DataStore<String, WebPage> createWebPageDataStore()
-      throws IOException {
-    SolrStore<String, WebPage> store = new SolrStore<>();
-    store.initialize(String.class, WebPage.class, 
DataStoreFactory.createProps());
-    return store;
-  }
-
-  @Override
   public void testDeleteByQueryFields()
           throws Exception {
     Query<String, WebPage> query;

Reply via email to