You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ja...@apache.org on 2013/05/08 09:33:44 UTC

[6/7] git commit: fixed paths to test-data files

fixed paths to test-data files

Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/2841bf3e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/2841bf3e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/2841bf3e

Branch: refs/heads/develop
Commit: 2841bf3ed8b8698824a749512618f62d808d9421
Parents: 6c82a02
Author: Jakob Frank <ja...@apache.org>
Authored: Tue May 7 16:51:04 2013 +0200
Committer: Jakob Frank <ja...@apache.org>
Committed: Tue May 7 16:51:04 2013 +0200

----------------------------------------------------------------------
 .../functions/BinaryNumericTestFunctionsTest.java  |    2 +-
 .../ldpath/model/functions/FunctionsTest.java      |    2 +-
 .../apache/marmotta/ldpath/parser/ParserTest.java  |    6 +-
 .../marmotta/ldpath/test/AbstractTestBase.java     |   36 +++++++-------
 4 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/2841bf3e/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java
index 5047873..b471e30 100644
--- a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/BinaryNumericTestFunctionsTest.java
@@ -70,7 +70,7 @@ public class BinaryNumericTestFunctionsTest extends AbstractTestBase {
 
     @Before
     public void loadData() throws RepositoryException, RDFParseException, IOException {
-        super.loadData("test-data.n3", RDFFormat.N3);
+        super.loadData("/ldpath/test-data.n3", RDFFormat.N3);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/2841bf3e/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java
index 5ee947e..8caced2 100644
--- a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/model/functions/FunctionsTest.java
@@ -47,7 +47,7 @@ public class FunctionsTest extends AbstractTestBase {
 
     @Before
     public void loadData() throws RepositoryException, RDFParseException, IOException {
-        loadData("test-data.n3", RDFFormat.N3);
+        loadData("/ldpath/test-data.n3", RDFFormat.N3);
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/2841bf3e/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java
index 510f370..8c787e5 100644
--- a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/parser/ParserTest.java
@@ -20,6 +20,7 @@ package org.apache.marmotta.ldpath.parser;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -37,7 +38,6 @@ import org.apache.marmotta.ldpath.api.tests.NodeTest;
 import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
 import org.apache.marmotta.ldpath.model.programs.Program;
 import org.hamcrest.CoreMatchers;
-import org.junit.Assume;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
@@ -110,8 +110,8 @@ public class ParserTest {
 
 
     private RdfPathParser<String> createParser(String input) throws IOException {
-        final URL resource = ParserTest.class.getResource(input);
-        Assume.assumeThat("Could not load test input data '" + input + "'", resource, CoreMatchers.notNullValue());
+        final URL resource = ParserTest.class.getResource("/parse/"+input);
+        assertThat("Could not load test input data '" + input + "'", resource, CoreMatchers.notNullValue());
 
         RdfPathParser<String> rdfPathParser = new RdfPathParser<String>(backend,new StringReader(IOUtils.toString(resource)));
         rdfPathParser.registerTransformer(NS_TEST + "type", new NodeTransformer<String, String>() {

http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/2841bf3e/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java
index 9152031..2fac58d 100644
--- a/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java
+++ b/libraries/ldpath/ldpath-core/src/test/java/org/apache/marmotta/ldpath/test/AbstractTestBase.java
@@ -18,13 +18,27 @@
 package org.apache.marmotta.ldpath.test;
 
 
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assert.assertThat;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.NoSuchElementException;
+
 import org.apache.marmotta.ldpath.api.selectors.NodeSelector;
 import org.apache.marmotta.ldpath.backend.sesame.SesameRepositoryBackend;
 import org.apache.marmotta.ldpath.model.fields.FieldMapping;
-import org.apache.marmotta.ldpath.parser.*;
+import org.apache.marmotta.ldpath.parser.ParseException;
+import org.apache.marmotta.ldpath.parser.RdfPathParser;
 import org.hamcrest.CoreMatchers;
 import org.junit.After;
-import org.junit.Assume;
+import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.rules.TestWatcher;
@@ -40,20 +54,6 @@ import org.openrdf.sail.memory.MemoryStore;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.net.URL;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assume.assumeThat;
-
 public abstract class AbstractTestBase {
     protected final static Map<String, String> NSS;
     static {
@@ -110,7 +110,7 @@ public abstract class AbstractTestBase {
 
     protected RdfPathParser<Value> createParserFromResource(String input) throws IOException {
         final URL resource = this.getClass().getResource(input);
-        assumeThat("Could not load test input data '" + input + "'", resource, CoreMatchers.notNullValue());
+        assertThat("Could not load test input data '" + input + "'", resource, CoreMatchers.notNullValue());
 
         RdfPathParser<Value> parser = new RdfPathParser<Value>(backend, resource.openStream());
         assertThat("Could not parse ldPath", parser, CoreMatchers.notNullValue());
@@ -132,7 +132,7 @@ public abstract class AbstractTestBase {
     protected final void loadData(String datafile, RDFFormat format, String baseURI) throws RepositoryException, RDFParseException, IOException {
         // load demo data
         InputStream data = this.getClass().getResourceAsStream(datafile);
-        Assume.assumeThat("Could not load test-data: " + datafile, data, notNullValue(InputStream.class));
+        Assert.assertThat("Could not load test-data: " + datafile, data, notNullValue(InputStream.class));
 
         final SailRepositoryConnection con = repository.getConnection();
         try {