Return-Path: X-Original-To: apmail-gora-commits-archive@www.apache.org Delivered-To: apmail-gora-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0474B10CC2 for ; Mon, 15 Apr 2013 19:20:48 +0000 (UTC) Received: (qmail 75303 invoked by uid 500); 15 Apr 2013 19:20:47 -0000 Delivered-To: apmail-gora-commits-archive@gora.apache.org Received: (qmail 75256 invoked by uid 500); 15 Apr 2013 19:20:47 -0000 Mailing-List: contact commits-help@gora.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@gora.apache.org Delivered-To: mailing list commits@gora.apache.org Received: (qmail 75243 invoked by uid 99); 15 Apr 2013 19:20:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Apr 2013 19:20:47 +0000 X-ASF-Spam-Status: No, hits=-1998.4 required=5.0 tests=ALL_TRUSTED,FR_ALMOST_VIAG2 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Apr 2013 19:20:45 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id CE8B023888CD; Mon, 15 Apr 2013 19:20:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1468198 - in /gora/branches/GORA_174: ./ gora-core/src/examples/java/org/apache/gora/examples/mapreduce/ gora-hbase/src/test/java/org/apache/gora/hbase/ gora-hbase/src/test/java/org/apache/gora/hbase/mapreduce/ gora-hbase/src/test/java/org... Date: Mon, 15 Apr 2013 19:20:25 -0000 To: commits@gora.apache.org From: alfonsonishikawa@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130415192025.CE8B023888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: alfonsonishikawa Date: Mon Apr 15 19:20:24 2013 New Revision: 1468198 URL: http://svn.apache.org/r1468198 Log: Merge from /trunk r1466967 Added: gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java - copied unchanged from r1468188, gora/trunk/gora-hbase/src/test/java/org/apache/gora/hbase/util/HBaseClusterSingleton.java Modified: gora/branches/GORA_174/ (props changed) gora/branches/GORA_174/CHANGES.txt gora/branches/GORA_174/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/GoraHBaseTestDriver.java gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/mapreduce/TestHBaseStoreCountQuery.java gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/mapreduce/TestHBaseStoreWordCount.java gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java Propchange: gora/branches/GORA_174/ ------------------------------------------------------------------------------ Merged /gora/trunk:r1458775-1468188 Modified: gora/branches/GORA_174/CHANGES.txt URL: http://svn.apache.org/viewvc/gora/branches/GORA_174/CHANGES.txt?rev=1468198&r1=1468197&r2=1468198&view=diff ============================================================================== --- gora/branches/GORA_174/CHANGES.txt (original) +++ gora/branches/GORA_174/CHANGES.txt Mon Apr 15 19:20:24 2013 @@ -5,6 +5,9 @@ Gora Change Log trunk (current development) +* GORA-159 gora-hbase MR tests should use HBaseTestingUtility instead of deprecated HBaseClusterTestCase via GORA-89 + +* GORA-89 Avoid HBase MiniCluster restarts to shorten gora-hbase tests (hsaputra, alfonso, Ioan eugen Stan) * GORA-203 Bug in setting column field attribute "qualifier" in CassandraMapping (rmarroquin, lewismc, kazk) Modified: gora/branches/GORA_174/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java URL: http://svn.apache.org/viewvc/gora/branches/GORA_174/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java?rev=1468198&r1=1468197&r2=1468198&view=diff ============================================================================== --- gora/branches/GORA_174/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java (original) +++ gora/branches/GORA_174/gora-core/src/examples/java/org/apache/gora/examples/mapreduce/QueryCounter.java Mon Apr 15 19:20:24 2013 @@ -47,8 +47,7 @@ public class QueryCounter - extends GoraMapper { + extends GoraMapper { @Override protected void map(K key, T value, @@ -95,6 +94,7 @@ public class QueryCounter dataStore, Query query) throws Exception { Job job = createJob(dataStore, query); job.waitForCompletion(true); + assert(job.isComplete() == true); return job.getCounters().findCounter(COUNTER_GROUP, ROWS).getValue(); } @@ -108,6 +108,7 @@ public class QueryCounter webPageStore; - + @Before - @Override public void setUp() throws Exception { - super.setUp(); + cluster.deleteAllTables(); webPageStore = DataStoreFactory.getDataStore( - HBaseStore.class, String.class, WebPage.class, conf); + HBaseStore.class, String.class, WebPage.class, cluster.getConf()); } @After - @Override public void tearDown() throws Exception { webPageStore.close(); - super.tearDown(); } @Test public void testCountQuery() throws Exception { - MapReduceTestUtils.testCountQuery(webPageStore, conf); + MapReduceTestUtils.testCountQuery(webPageStore, cluster.getConf()); } public static void main(String[] args) throws Exception { Modified: gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/mapreduce/TestHBaseStoreWordCount.java URL: http://svn.apache.org/viewvc/gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/mapreduce/TestHBaseStoreWordCount.java?rev=1468198&r1=1468197&r2=1468198&view=diff ============================================================================== --- gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/mapreduce/TestHBaseStoreWordCount.java (original) +++ gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/mapreduce/TestHBaseStoreWordCount.java Mon Apr 15 19:20:24 2013 @@ -21,9 +21,10 @@ package org.apache.gora.hbase.mapreduce; import org.apache.gora.examples.generated.TokenDatum; import org.apache.gora.examples.generated.WebPage; import org.apache.gora.hbase.store.HBaseStore; +import org.apache.gora.hbase.util.HBaseClusterSingleton; import org.apache.gora.mapreduce.MapReduceTestUtils; import org.apache.gora.store.DataStoreFactory; -import org.apache.hadoop.hbase.HBaseClusterTestCase; + import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -31,32 +32,30 @@ import org.junit.Test; /** * Tests related to {@link org.apache.gora.hbase.store.HBaseStore} using mapreduce. */ -public class TestHBaseStoreWordCount extends HBaseClusterTestCase{ +public class TestHBaseStoreWordCount { + private static final HBaseClusterSingleton cluster = HBaseClusterSingleton.build(1); private HBaseStore webPageStore; private HBaseStore tokenStore; @Before - @Override public void setUp() throws Exception { - super.setUp(); + cluster.deleteAllTables(); webPageStore = DataStoreFactory.getDataStore( - HBaseStore.class, String.class, WebPage.class, conf); + HBaseStore.class, String.class, WebPage.class, cluster.getConf()); tokenStore = DataStoreFactory.getDataStore(HBaseStore.class, - String.class, TokenDatum.class, conf); + String.class, TokenDatum.class, cluster.getConf()); } @After - @Override public void tearDown() throws Exception { webPageStore.close(); tokenStore.close(); - super.tearDown(); } @Test public void testWordCount() throws Exception { - MapReduceTestUtils.testWordCount(conf, webPageStore, tokenStore); + MapReduceTestUtils.testWordCount(cluster.getConf(), webPageStore, tokenStore); } public static void main(String[] args) throws Exception { Modified: gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java URL: http://svn.apache.org/viewvc/gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java?rev=1468198&r1=1468197&r2=1468198&view=diff ============================================================================== --- gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java (original) +++ gora/branches/GORA_174/gora-hbase/src/test/java/org/apache/gora/hbase/store/TestHBaseStore.java Mon Apr 15 19:20:24 2013 @@ -26,7 +26,6 @@ import junit.framework.Assert; import org.apache.gora.examples.generated.Employee; import org.apache.gora.examples.generated.WebPage; import org.apache.gora.hbase.GoraHBaseTestDriver; -import org.apache.gora.hbase.store.HBaseStore; import org.apache.gora.store.DataStore; import org.apache.gora.store.DataStoreFactory; import org.apache.gora.store.DataStoreTestBase; @@ -127,31 +126,31 @@ public class TestHBaseStore extends Data } - @Override - public void testQueryEndKey() throws IOException { - //We need to skip this test since gora considers endRow inclusive, while its exclusinve for HBase. - //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. - } - - @Override - public void testQueryKeyRange() throws IOException { - //We need to skip this test since gora considers endRow inclusive, while its exclusinve for HBase. - //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. - } - - @Override - public void testDeleteByQuery() throws IOException { - //We need to skip this test since gora considers endRow inclusive, while its exclusinve for HBase. - //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. - } + @Override + public void testQueryEndKey() throws IOException { + //We need to skip this test since gora considers endRow inclusive, while its exclusinve for HBase. + //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. + } + + @Override + public void testQueryKeyRange() throws IOException { + //We need to skip this test since gora considers endRow inclusive, while its exclusinve for HBase. + //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. + } + + @Override + public void testDeleteByQuery() throws IOException { + //We need to skip this test since gora considers endRow inclusive, while its exclusinve for HBase. + //TODO: We should raise an issue for HBase to allow us to specify if the endRow will be inclussive or exclusive. + } - public static void main(String[] args) throws Exception { + public static void main(String[] args) throws Exception { TestHBaseStore test = new TestHBaseStore(); test.setUpClass(); test.setUp(); - + test.testQuery(); - + test.tearDown(); test.tearDownClass(); }