You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gora.apache.org by rm...@apache.org on 2013/11/20 23:16:02 UTC

svn commit: r1543970 - in /gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase: GoraHBaseTestDriver.java store/TestHBaseStore.java util/HBaseClusterSingleton.java

Author: rmarroquin
Date: Wed Nov 20 22:16:02 2013
New Revision: 1543970

URL: http://svn.apache.org/r1543970
Log:
Fixing hanging tests on the HBase data store.

Modified:
    gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
    gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
    gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java

Modified: gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java?rev=1543970&r1=1543969&r2=1543970&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java (original)
+++ gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java Wed Nov 20 22:16:02 2013
@@ -22,8 +22,6 @@ import org.apache.gora.GoraTestDriver;
 import org.apache.gora.hbase.store.HBaseStore;
 import org.apache.gora.hbase.util.HBaseClusterSingleton;
 import org.apache.hadoop.conf.Configuration;
-
-//HBase imports
 import org.apache.hadoop.hbase.HBaseTestingUtility;
 
 /**
@@ -31,8 +29,15 @@ import org.apache.hadoop.hbase.HBaseTest
  * @see GoraTestDriver
  */
 public class GoraHBaseTestDriver extends GoraTestDriver {
+
+  /**
+   * Cluster object used for testing.
+   */
   private static final HBaseClusterSingleton cluster = HBaseClusterSingleton.build(1);
 
+  /**
+   * Default Constructor.
+   */
   public GoraHBaseTestDriver() {
     super(HBaseStore.class);
   }
@@ -40,6 +45,7 @@ public class GoraHBaseTestDriver extends
   @Override
   public void setUpClass() throws Exception {
     super.setUpClass();
+    conf = getConf();
     log.info("Setting up HBase Test Driver");
   }
 
@@ -48,28 +54,40 @@ public class GoraHBaseTestDriver extends
     super.tearDownClass();
     log.info("Teardown HBase test driver");
   }
-  
+
   @Override
   public void setUp() throws Exception {
     cluster.truncateAllTables();
     // super.setUp() deletes all tables, but must only truncate in the right way -HBaseClusterSingleton-
     //super.setUp();
   }
-  
+
   @Override
   public void tearDown() throws Exception {
     // Do nothing. setUp() must ensure the right data.
   }
+
+  /**
+   * Deletes all tables from the MiniCluster
+   * @throws Exception in case some table is not able to be deleted.
+   */
   public void deleteAllTables() throws Exception {
     cluster.deleteAllTables();
   }
-  
+
+  /**
+   * Gets the configuration from the MiniCluster.
+   * @return Configuration from MiniCluster.
+   */
   public Configuration getConf() {
     return cluster.getHbaseTestingUtil().getConfiguration();
   }
-  
+
+  /**
+   * Gets HBaseTestingUtility from the MiniCluster object.
+   * @return HBaseTestingUtility object
+   */
   public HBaseTestingUtility getHbaseUtil() {
     return cluster.getHbaseTestingUtil();
   }
-  
-}		
+}

Modified: gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java?rev=1543970&r1=1543969&r2=1543970&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java (original)
+++ gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java Wed Nov 20 22:16:02 2013
@@ -204,7 +204,7 @@ public class TestHBaseStore extends Data
     HTable table = new HTable(conf,"WebPage");
     Get get = new Get(Bytes.toBytes("com.example/http"));
     org.apache.hadoop.hbase.client.Result result = table.get(get);
-        
+    table.close();
     byte[] contentBytes = result.getValue(Bytes.toBytes("content"), null);
 
     assertNull(webPageStore.get("com.example/http", new String[]{"content"})) ;

Modified: gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java
URL: http://svn.apache.org/viewvc/gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java?rev=1543970&r1=1543969&r2=1543970&view=diff
==============================================================================
--- gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java (original)
+++ gora/branches/GORA_94/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java Wed Nov 20 22:16:02 2013
@@ -85,8 +85,8 @@ public final class HBaseClusterSingleton
 
     htu.getConfiguration().setBoolean("dfs.support.append", true);
     htu.getConfiguration().setInt("zookeeper.session.timeout", 20000);
-    htu.getConfiguration().set("hbase.zookeeper.quorum", "localhost");
-    htu.getConfiguration().setInt("hbase.zookeeper.property.clientPort", 2181);
+    //htu.getConfiguration().set("hbase.zookeeper.quorum", "localhost");
+    //htu.getConfiguration().setInt("hbase.zookeeper.property.clientPort", 2181);
     
     try {
       LOG.info("Start HBase mini cluster.");