Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-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 10590101C7 for ; Sun, 22 Sep 2013 01:52:24 +0000 (UTC) Received: (qmail 80800 invoked by uid 500); 22 Sep 2013 01:52:24 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 80742 invoked by uid 500); 22 Sep 2013 01:52:23 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 80735 invoked by uid 99); 22 Sep 2013 01:52:23 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 22 Sep 2013 01:52:23 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id D1C358B04F8; Sun, 22 Sep 2013 01:52:22 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Message-Id: <2e5b5dca1ba1436f9dca63ac40516b7d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: ACCUMULO-1222 Move resources from server to test and cleanup a not-so-useful test case Date: Sun, 22 Sep 2013 01:52:22 +0000 (UTC) Updated Branches: refs/heads/1.5.1-SNAPSHOT 0bc311b1a -> 5da415ae7 ACCUMULO-1222 Move resources from server to test and cleanup a not-so-useful test case Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/5da415ae Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/5da415ae Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/5da415ae Branch: refs/heads/1.5.1-SNAPSHOT Commit: 5da415ae7ba3b86410b4f3d6e957e8c829868721 Parents: 0bc311b Author: Josh Elser Authored: Sat Sep 21 21:43:29 2013 -0400 Committer: Josh Elser Committed: Sat Sep 21 21:44:22 2013 -0400 ---------------------------------------------------------------------- server/src/main/resources/randomwalk/Basic.xml | 37 ----------- server/src/main/resources/randomwalk/Simple.xml | 43 ------------ server/src/main/resources/randomwalk/module.xsd | 69 -------------------- .../accumulo/test/randomwalk/FrameworkTest.java | 46 +++---------- test/src/test/resources/randomwalk/Basic.xml | 37 +++++++++++ test/src/test/resources/randomwalk/Simple.xml | 43 ++++++++++++ test/src/test/resources/randomwalk/module.xsd | 69 ++++++++++++++++++++ test/src/test/resources/unit/Basic.xml | 37 +++++++++++ test/src/test/resources/unit/Simple.xml | 43 ++++++++++++ 9 files changed, 237 insertions(+), 187 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/5da415ae/server/src/main/resources/randomwalk/Basic.xml ---------------------------------------------------------------------- diff --git a/server/src/main/resources/randomwalk/Basic.xml b/server/src/main/resources/randomwalk/Basic.xml deleted file mode 100644 index 2dead02..0000000 --- a/server/src/main/resources/randomwalk/Basic.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/accumulo/blob/5da415ae/server/src/main/resources/randomwalk/Simple.xml ---------------------------------------------------------------------- diff --git a/server/src/main/resources/randomwalk/Simple.xml b/server/src/main/resources/randomwalk/Simple.xml deleted file mode 100644 index cad940e..0000000 --- a/server/src/main/resources/randomwalk/Simple.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/accumulo/blob/5da415ae/server/src/main/resources/randomwalk/module.xsd ---------------------------------------------------------------------- diff --git a/server/src/main/resources/randomwalk/module.xsd b/server/src/main/resources/randomwalk/module.xsd deleted file mode 100644 index bcdaaae0..0000000 --- a/server/src/main/resources/randomwalk/module.xsd +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - http://git-wip-us.apache.org/repos/asf/accumulo/blob/5da415ae/test/src/test/java/org/apache/accumulo/test/randomwalk/FrameworkTest.java ---------------------------------------------------------------------- diff --git a/test/src/test/java/org/apache/accumulo/test/randomwalk/FrameworkTest.java b/test/src/test/java/org/apache/accumulo/test/randomwalk/FrameworkTest.java index ce5b599..7829ac5 100644 --- a/test/src/test/java/org/apache/accumulo/test/randomwalk/FrameworkTest.java +++ b/test/src/test/java/org/apache/accumulo/test/randomwalk/FrameworkTest.java @@ -19,20 +19,17 @@ package org.apache.accumulo.test.randomwalk; import java.io.File; import java.util.Properties; +import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.validation.Schema; import javax.xml.validation.SchemaFactory; -import javax.xml.XMLConstants; - -import org.apache.accumulo.test.randomwalk.Framework; -import org.apache.accumulo.test.randomwalk.Module; -import org.apache.accumulo.test.randomwalk.State; -import org.apache.accumulo.test.randomwalk.Test; -import org.apache.accumulo.test.randomwalk.unit.CreateTable; import junit.framework.TestCase; +import org.apache.accumulo.test.randomwalk.unit.CreateTable; +import org.junit.Assert; + public class FrameworkTest extends TestCase { public void testXML() { @@ -43,19 +40,19 @@ public class FrameworkTest extends TestCase { SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema moduleSchema = null; try { - moduleSchema = sf.newSchema(new File(this.getClass().getClassLoader().getResource("randomwalk/module.xsd").toURI())); + moduleSchema = sf.newSchema(new File(this.getClass().getResource("/randomwalk/module.xsd").toURI())); } catch (Exception e) { - e.printStackTrace(); + Assert.fail("Caught exception: " + e); } dbf.setSchema(moduleSchema); try { - File f = new File(this.getClass().getClassLoader().getResource("randomwalk/Basic.xml").toURI()); + File f = new File(this.getClass().getResource("/randomwalk/Basic.xml").toURI()); docbuilder = dbf.newDocumentBuilder(); docbuilder.parse(f); } catch (Exception e) { - e.printStackTrace(); + Assert.fail("Caught exception: " + e); } } @@ -68,31 +65,4 @@ public class FrameworkTest extends TestCase { assertTrue(t1.equals(t2)); } - public void testModule() { - - // don't run test if accumulo home is not set - String acuHome = System.getenv("ACCUMULO_HOME"); - if (acuHome == null) - return; - - String confDir = acuHome + "/test/system/randomwalk/conf/"; - try { - Module module = new Module(new File(confDir + "modules/unit/Basic.xml")); - module.visit(new State(new Properties()), new Properties()); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public void testFramework() { - - // don't run test if accumulo home is not set - String acuHome = System.getenv("ACCUMULO_HOME"); - if (acuHome == null) - return; - - Framework framework = Framework.getInstance(); - String confDir = acuHome + "/test/system/randomwalk/conf/"; - framework.run("unit/Basic.xml", new State(new Properties()), confDir); - } } http://git-wip-us.apache.org/repos/asf/accumulo/blob/5da415ae/test/src/test/resources/randomwalk/Basic.xml ---------------------------------------------------------------------- diff --git a/test/src/test/resources/randomwalk/Basic.xml b/test/src/test/resources/randomwalk/Basic.xml new file mode 100644 index 0000000..2dead02 --- /dev/null +++ b/test/src/test/resources/randomwalk/Basic.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/accumulo/blob/5da415ae/test/src/test/resources/randomwalk/Simple.xml ---------------------------------------------------------------------- diff --git a/test/src/test/resources/randomwalk/Simple.xml b/test/src/test/resources/randomwalk/Simple.xml new file mode 100644 index 0000000..cad940e --- /dev/null +++ b/test/src/test/resources/randomwalk/Simple.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/accumulo/blob/5da415ae/test/src/test/resources/randomwalk/module.xsd ---------------------------------------------------------------------- diff --git a/test/src/test/resources/randomwalk/module.xsd b/test/src/test/resources/randomwalk/module.xsd new file mode 100644 index 0000000..bcdaaae0 --- /dev/null +++ b/test/src/test/resources/randomwalk/module.xsd @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/accumulo/blob/5da415ae/test/src/test/resources/unit/Basic.xml ---------------------------------------------------------------------- diff --git a/test/src/test/resources/unit/Basic.xml b/test/src/test/resources/unit/Basic.xml new file mode 100644 index 0000000..2dead02 --- /dev/null +++ b/test/src/test/resources/unit/Basic.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + http://git-wip-us.apache.org/repos/asf/accumulo/blob/5da415ae/test/src/test/resources/unit/Simple.xml ---------------------------------------------------------------------- diff --git a/test/src/test/resources/unit/Simple.xml b/test/src/test/resources/unit/Simple.xml new file mode 100644 index 0000000..cad940e --- /dev/null +++ b/test/src/test/resources/unit/Simple.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +