Repository: gora
Updated Branches:
  refs/heads/master 882fac979 -> dd6617261


GORA-488 setProperties method contains no code. Removed unused code. Edited the 
releated test codes.


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

Branch: refs/heads/master
Commit: 1339aad4760ac9afb41a5e1f0eb42b71d0103e2b
Parents: bb1a1ac
Author: cihad guzel <cguz...@gmail.com>
Authored: Mon Aug 29 00:38:23 2016 +0300
Committer: cihad guzel <cguz...@gmail.com>
Committed: Wed Sep 21 16:58:52 2016 +0300

----------------------------------------------------------------------
 .../gora/accumulo/GoraAccumuloTestDriver.java   |  8 +--
 .../gora/cassandra/GoraCassandraTestDriver.java |  6 +--
 .../java/org/apache/gora/GoraTestDriver.java    | 52 +++++++++++++-------
 .../gora/couchdb/GoraCouchDBTestDriver.java     |  8 ++-
 .../gora/dynamodb/GoraDynamoDBTestDriver.java   |  5 +-
 .../apache/gora/hbase/GoraHBaseTestDriver.java  |  6 +--
 .../infinispan/GoraInfinispanTestDriver.java    |  2 -
 .../gora/jcache/GoraHazelcastTestDriver.java    |  6 +--
 .../gora/mongodb/GoraMongodbTestDriver.java     |  9 ++--
 .../apache/gora/solr/GoraSolrTestDriver.java    |  7 ---
 .../apache/gora/solr/GoraSolrTestDriver.java    |  8 ---
 11 files changed, 57 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-accumulo/src/test/java/org/apache/gora/accumulo/GoraAccumuloTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-accumulo/src/test/java/org/apache/gora/accumulo/GoraAccumuloTestDriver.java
 
b/gora-accumulo/src/test/java/org/apache/gora/accumulo/GoraAccumuloTestDriver.java
index bd3b502..22dff6d 100644
--- 
a/gora-accumulo/src/test/java/org/apache/gora/accumulo/GoraAccumuloTestDriver.java
+++ 
b/gora-accumulo/src/test/java/org/apache/gora/accumulo/GoraAccumuloTestDriver.java
@@ -26,6 +26,8 @@ import org.junit.rules.TemporaryFolder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+
 /**
  * @author lmcgibbn
  *
@@ -44,8 +46,7 @@ public class GoraAccumuloTestDriver extends GoraTestDriver {
   }
 
   @Override
-  public void setUpClass() throws Exception {
-    super.setUpClass();
+  public void setUpClass() throws IOException, InterruptedException {
     log.info("Starting Accumulo MiniAccumuloCluster...");
     try {
       tmpDir.create();
@@ -62,8 +63,7 @@ public class GoraAccumuloTestDriver extends GoraTestDriver {
   }
 
   @Override
-  public void tearDownClass() throws Exception {
-    super.tearDownClass();
+  public void tearDownClass() throws IOException, InterruptedException {
     log.info("Shutting down Accumulo MiniAccumuloCluster...");
     if (cluster != null) {
       cluster.stop();

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java
 
b/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java
index ef9410e..0eb1619 100644
--- 
a/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java
+++ 
b/gora-cassandra/src/test/java/org/apache/gora/cassandra/GoraCassandraTestDriver.java
@@ -72,8 +72,7 @@ public class GoraCassandraTestDriver extends GoraTestDriver {
    *   if an error occurs
    */
   @Override
-  public void setUpClass() throws Exception {
-    super.setUpClass();
+  public void setUpClass(){
     log.info("Starting embedded Cassandra Server...");
     try {
       cleanupDirectoriesFailover();
@@ -111,8 +110,7 @@ public class GoraCassandraTestDriver extends GoraTestDriver 
{
    *   if an error occurs
    */
   @Override
-  public void tearDownClass() throws Exception {
-    super.tearDownClass();
+  public void tearDownClass(){
     log.info("Shutting down Embedded Cassandra server...");
     if (cassandraThread != null) {
       cassandraDaemon.stop();

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java
----------------------------------------------------------------------
diff --git a/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java 
b/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java
index 5c2d071..11eabbc 100644
--- a/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java
+++ b/gora-core/src/test/java/org/apache/gora/GoraTestDriver.java
@@ -35,7 +35,7 @@ import org.apache.hadoop.conf.Configuration;
  * or Cassandra cluster, local Hsqldb instance, etc) so that these 
  * details are abstracted away.
  */
-public class GoraTestDriver {
+public abstract class GoraTestDriver {
 
   protected static final Logger log = 
LoggerFactory.getLogger(GoraTestDriver.class);
 
@@ -54,16 +54,12 @@ public class GoraTestDriver {
   /** Should be called once before the tests are started, probably in the
    * method annotated with org.junit.BeforeClass
    */
-  public void setUpClass() throws Exception {
-    setProperties(DataStoreFactory.createProps());
-  }
+  public abstract void setUpClass() throws Exception;
 
   /** Should be called once after the tests have finished, probably in the
    * method annotated with org.junit.AfterClass
    */
-  public void tearDownClass() throws Exception {
-
-  }
+  public abstract void tearDownClass() throws Exception;
 
   /** Should be called once before each test, probably in the
    * method annotated with org.junit.Before
@@ -84,7 +80,6 @@ public class GoraTestDriver {
     //delete everything
     for(DataStore store : dataStores) {
       try {
-        //store.flush();
         store.deleteSchema();
         store.close();
       }catch (Exception ignore) {
@@ -93,26 +88,47 @@ public class GoraTestDriver {
     dataStores.clear();
   }
 
-  protected void setProperties(Properties properties) {
+  /**
+   * Instantiate a new {@link org.apache.gora.store.DataStore}. Uses default 
properties.
+   *
+   * @param keyClass        The key class.
+   * @param persistentClass The value class.
+   * @param <K>             class to be used for the key
+   * @param <T>             class to be persisted within the store
+   * @return a new store instance.
+   * @throws GoraException Gora specific exception. This extends IOException.
+   */
+  @SuppressWarnings("unchecked")
+  public <K, T extends Persistent> DataStore<K, T>
+  createDataStore(Class<K> keyClass, Class<T> persistentClass) throws 
GoraException {
+    final DataStore<K, T> dataStore = DataStoreFactory.createDataStore(
+        (Class<? extends DataStore<K, T>>) dataStoreClass, keyClass, 
persistentClass, conf);
+    dataStores.add(dataStore);
+    log.info("Datastore for {} was added.", persistentClass);
+    return dataStore;
   }
 
+  /**
+   * Instantiate a new {@link org.apache.gora.store.DataStore}.
+   *
+   * @param keyClass        The key class.
+   * @param persistentClass The value class.
+   * @param properties      The properties to be used be the store.
+   * @param <K>             class to be used for the key
+   * @param <T>             class to be persisted within the store
+   * @return new store instance.
+   * @throws GoraException Gora specific exception. This extends IOException.
+   */
   @SuppressWarnings("unchecked")
   public<K, T extends Persistent> DataStore<K,T>
-    createDataStore(Class<K> keyClass, Class<T> persistentClass) throws 
GoraException {
-    final Properties properties = DataStoreFactory.createProps();
+  createDataStore(Class<K> keyClass, Class<T> persistentClass, Properties 
properties) throws GoraException {
     final DataStore<K, T> dataStore = DataStoreFactory.createDataStore(
         (Class<? extends DataStore<K, T>>) dataStoreClass, keyClass, 
persistentClass, conf, properties);
-
     dataStores.add(dataStore);
-
     log.info("Datastore for {} was added.", persistentClass);
     return dataStore;
   }
-  
-  public Class<?> getDataStoreClass() {
-    return dataStoreClass;
-  }
-  
+
   public Configuration getConfiguration() {
     return this.conf;
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-couchdb/src/test/java/org/apache/gora/couchdb/GoraCouchDBTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-couchdb/src/test/java/org/apache/gora/couchdb/GoraCouchDBTestDriver.java 
b/gora-couchdb/src/test/java/org/apache/gora/couchdb/GoraCouchDBTestDriver.java
index bb48c83..7996708 100644
--- 
a/gora-couchdb/src/test/java/org/apache/gora/couchdb/GoraCouchDBTestDriver.java
+++ 
b/gora-couchdb/src/test/java/org/apache/gora/couchdb/GoraCouchDBTestDriver.java
@@ -51,10 +51,16 @@ public class GoraCouchDBTestDriver extends GoraTestDriver {
   }
 
   @Override
-  public void setUpClass() throws Exception {
+  public void setUpClass() {
+    log.info("Setting up CouchDB Test Driver");
     properties.put(CouchDBParameters.PROP_COUCHDB_PORT, 
couchdbContainer.getMappedPort(5984).toString());
   }
 
+  @Override
+  public void tearDownClass() {
+    log.info("Teardown CouchDB test driver");
+  }
+
   /**
    * Instantiate a new {@link DataStore}. Uses 'null' schema.
    *

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java
 
b/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java
index aa86170..c29efb3 100644
--- 
a/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java
+++ 
b/gora-dynamodb/src/test/java/org/apache/gora/dynamodb/GoraDynamoDBTestDriver.java
@@ -92,8 +92,7 @@ public class GoraDynamoDBTestDriver extends GoraTestDriver {
    * Sets up the class
    */
   @Override
-  public void setUpClass() throws Exception {
-    super.setUpClass();
+  public void setUpClass() throws IOException {
     log.info("Initializing DynamoDB.");
     createDataStore();
   }
@@ -154,7 +153,7 @@ public class GoraDynamoDBTestDriver extends GoraTestDriver {
    * Tears down the class
    */
   @Override
-  public void tearDownClass() throws Exception {
+  public void tearDownClass() {
     log.info("Finished DynamoDB driver.");
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java 
b/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
index ca9b559..c55f9b2 100644
--- a/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
+++ b/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
@@ -43,15 +43,13 @@ public class GoraHBaseTestDriver extends GoraTestDriver {
   }
   
   @Override
-  public void setUpClass() throws Exception {
-    super.setUpClass();
+  public void setUpClass() {
     conf = getConf();
     log.info("Setting up HBase Test Driver");
   }
 
   @Override
-  public void tearDownClass() throws Exception {
-    super.tearDownClass();
+  public void tearDownClass() {
     log.info("Teardown HBase test driver");
   }
 

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-infinispan/src/test/java/org/apache/gora/infinispan/GoraInfinispanTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-infinispan/src/test/java/org/apache/gora/infinispan/GoraInfinispanTestDriver.java
 
b/gora-infinispan/src/test/java/org/apache/gora/infinispan/GoraInfinispanTestDriver.java
index 17e3e9c..9f0272c 100644
--- 
a/gora-infinispan/src/test/java/org/apache/gora/infinispan/GoraInfinispanTestDriver.java
+++ 
b/gora-infinispan/src/test/java/org/apache/gora/infinispan/GoraInfinispanTestDriver.java
@@ -74,7 +74,6 @@ public class GoraInfinispanTestDriver extends GoraTestDriver {
 
   @Override
   public void setUpClass() throws Exception {
-    super.setUpClass();
     log.info("Starting Infinispan...");
     delegate = new SimulationDriver(numbderOfNodes,cacheNames);
     try{
@@ -86,7 +85,6 @@ public class GoraInfinispanTestDriver extends GoraTestDriver {
 
   @Override
   public void tearDownClass() throws Exception {
-    super.tearDownClass();
     log.info("Stopping Infinispan...");
     delegate.destroy();
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-jcache/src/test/java/org/apache/gora/jcache/GoraHazelcastTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-jcache/src/test/java/org/apache/gora/jcache/GoraHazelcastTestDriver.java 
b/gora-jcache/src/test/java/org/apache/gora/jcache/GoraHazelcastTestDriver.java
index e245557..4a77dd7 100644
--- 
a/gora-jcache/src/test/java/org/apache/gora/jcache/GoraHazelcastTestDriver.java
+++ 
b/gora-jcache/src/test/java/org/apache/gora/jcache/GoraHazelcastTestDriver.java
@@ -41,16 +41,14 @@ public class GoraHazelcastTestDriver extends GoraTestDriver 
{
   }
 
   @Override
-  public void setUpClass() throws Exception {
-    super.setUpClass();
+  public void setUpClass() {
     log.info("Starting Hazelcast server side cache provider.");
     Config config = new ClasspathXmlConfig(CONFIG);
     hazelcastInstance = Hazelcast.newHazelcastInstance(config);
   }
 
   @Override
-  public void tearDownClass() throws Exception {
-    super.tearDownClass();
+  public void tearDownClass() {
     log.info("Stopping Hazelcast server side cache provider.");
     hazelcastInstance.shutdown();
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java 
b/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java
index 560649a..a7fe2cf 100644
--- 
a/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java
+++ 
b/gora-mongodb/src/test/java/org/apache/gora/mongodb/GoraMongodbTestDriver.java
@@ -37,6 +37,8 @@ import org.apache.gora.mongodb.store.MongoStoreParameters;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.io.IOException;
+
 /**
  * Driver to set up an embedded MongoDB database instance for use in our
  * unit tests. We use embedded mongodb which is available from
@@ -68,9 +70,7 @@ public class GoraMongodbTestDriver extends GoraTestDriver {
    * Initiate the MongoDB server on the default port
    */
   @Override
-  public void setUpClass() throws Exception {
-    super.setUpClass();
-
+  public void setUpClass() throws IOException {
     IRuntimeConfig runtimeConfig = new RuntimeConfigBuilder()
             .defaultsWithLogger(Command.MongoD, log)
             .processOutput(ProcessOutput.getDefaultInstanceSilent())
@@ -104,9 +104,8 @@ public class GoraMongodbTestDriver extends GoraTestDriver {
    * Tear the server down
    */
   @Override
-  public void tearDownClass() throws Exception {
+  public void tearDownClass() {
     log.info("Shutting down mongodb server...");
-    super.tearDownClass();
     _mongod.stop();
     _mongodExe.stop();
   }

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java 
b/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java
index 0fecaf5..06b1fcb 100644
--- a/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java
+++ b/gora-solr-5/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java
@@ -40,14 +40,12 @@ public class GoraSolrTestDriver extends GoraTestDriver {
 
   @Override
   public void setUpClass() throws Exception {
-    super.setUpClass();
     solr = new JettySolrRunner("src/test/conf/solr","/solr", 9876);
     solr.start();
   }
 
   @Override
   public void tearDownClass() throws Exception {
-    super.tearDownClass();
     if (solr != null) {
       solr.stop();
       solr = null;
@@ -93,9 +91,4 @@ public class GoraSolrTestDriver extends GoraTestDriver {
     }
   }
 
-  @Override
-  protected void setProperties(Properties properties) {
-    super.setProperties(properties);
-  }
-
 }

http://git-wip-us.apache.org/repos/asf/gora/blob/1339aad4/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java
----------------------------------------------------------------------
diff --git 
a/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java 
b/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java
index d23788d..2c3a144 100644
--- a/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java
+++ b/gora-solr/src/test/java/org/apache/gora/solr/GoraSolrTestDriver.java
@@ -35,14 +35,12 @@ public class GoraSolrTestDriver extends GoraTestDriver {
 
   @Override
   public void setUpClass() throws Exception {
-    super.setUpClass();
     solr = new JettySolrRunner("src/test/conf/solr","/solr", 9876);
     solr.start();
   }
 
   @Override
   public void tearDownClass() throws Exception {
-    super.tearDownClass();
     if (solr != null) {
       solr.stop();
       solr = null;
@@ -87,10 +85,4 @@ public class GoraSolrTestDriver extends GoraTestDriver {
       FileUtils.deleteDirectory(webpageDirFile);
     }
   }
-
-  @Override
-  protected void setProperties(Properties properties) {
-    super.setProperties(properties);
-  }
-
 }

Reply via email to