Some minor tweaks
Project: http://git-wip-us.apache.org/repos/asf/marmotta/repo Commit: http://git-wip-us.apache.org/repos/asf/marmotta/commit/7b2de207 Tree: http://git-wip-us.apache.org/repos/asf/marmotta/tree/7b2de207 Diff: http://git-wip-us.apache.org/repos/asf/marmotta/diff/7b2de207 Branch: refs/heads/develop Commit: 7b2de20764172ad037bd73a19fd0e89d8cdfe8fb Parents: 14d61a1 Author: Jakob Frank <[email protected]> Authored: Fri Feb 28 08:58:10 2014 +0100 Committer: Jakob Frank <[email protected]> Committed: Fri Feb 28 08:58:10 2014 +0100 ---------------------------------------------------------------------- .../apache/marmotta/platform/ldp/patch/RdfPatchIO.java | 2 ++ .../marmotta/platform/ldp/patch/RdfPatchIOTest.java | 12 +++++++----- .../marmotta/platform/ldp/patch/RdfPatchUtilTest.java | 6 ------ 3 files changed, 9 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/marmotta/blob/7b2de207/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/main/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIO.java ---------------------------------------------------------------------- diff --git a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/main/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIO.java b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/main/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIO.java index 2120a23..30d0ce4 100644 --- a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/main/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIO.java +++ b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/main/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIO.java @@ -155,6 +155,8 @@ public class RdfPatchIO { } return sb.toString(); } + + // Fall through return v.toString(); } http://git-wip-us.apache.org/repos/asf/marmotta/blob/7b2de207/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIOTest.java ---------------------------------------------------------------------- diff --git a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIOTest.java b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIOTest.java index 4ba507f..9130c81 100644 --- a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIOTest.java +++ b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchIOTest.java @@ -19,13 +19,15 @@ package org.apache.marmotta.platform.ldp.patch; import org.apache.marmotta.platform.ldp.patch.model.PatchLine; import org.apache.marmotta.platform.ldp.patch.parser.ParseException; -import org.apache.marmotta.platform.ldp.patch.parser.RdfPatchParser; import org.apache.marmotta.platform.ldp.patch.parser.RdfPatchParserImpl; import org.junit.Assert; import org.junit.Test; +import org.openrdf.model.vocabulary.DCTERMS; import java.io.StringReader; +import java.util.Collections; import java.util.List; +import java.util.Map; /** * Testing {@link org.apache.marmotta.platform.ldp.patch.RdfPatchIO} @@ -35,19 +37,19 @@ public class RdfPatchIOTest { @Test public void testIllustrative() throws Exception { RdfPatchParserImpl parser = new RdfPatchParserImpl(getClass().getResourceAsStream("/illustrative.rdfp")); - checkRoundtrip(parser); + checkRoundtrip(parser, Collections.<String, String>emptyMap()); } @Test public void testRdfPatch() throws ParseException { RdfPatchParserImpl parser = new RdfPatchParserImpl(getClass().getResourceAsStream("/rdf-patch.rdfp")); - checkRoundtrip(parser); + checkRoundtrip(parser, Collections.singletonMap(DCTERMS.PREFIX, DCTERMS.NAMESPACE)); } - private void checkRoundtrip(RdfPatchParserImpl parser) throws ParseException { + private void checkRoundtrip(RdfPatchParserImpl parser, Map<String, String> namespaces) throws ParseException { final List<PatchLine> patch1 = parser.parsePatch(); - final String serialized = RdfPatchIO.toString(patch1); + final String serialized = RdfPatchIO.toString(patch1, namespaces); parser.ReInit(new StringReader(serialized)); final List<PatchLine> patch2 = parser.parsePatch(); http://git-wip-us.apache.org/repos/asf/marmotta/blob/7b2de207/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchUtilTest.java ---------------------------------------------------------------------- diff --git a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchUtilTest.java b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchUtilTest.java index b03b1ef..6d9b326 100644 --- a/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchUtilTest.java +++ b/commons/marmotta-sesame-tools/marmotta-util-rdfpatch/src/test/java/org/apache/marmotta/platform/ldp/patch/RdfPatchUtilTest.java @@ -17,12 +17,9 @@ */ package org.apache.marmotta.platform.ldp.patch; -import org.apache.marmotta.platform.ldp.patch.InvalidPatchDocumentException; -import org.apache.marmotta.platform.ldp.patch.RdfPatchUtil; import org.apache.marmotta.platform.ldp.patch.model.PatchLine; import org.apache.marmotta.platform.ldp.patch.model.WildcardStatement; import org.apache.marmotta.platform.ldp.patch.parser.ParseException; -import org.hamcrest.CoreMatchers; import org.hamcrest.collection.IsIterableContainingInOrder; import org.junit.After; import org.junit.Assert; @@ -30,9 +27,6 @@ import org.junit.Before; import org.junit.Test; import org.openrdf.model.Literal; import org.openrdf.model.URI; -import org.openrdf.model.impl.LiteralImpl; -import org.openrdf.model.impl.StatementImpl; -import org.openrdf.model.impl.URIImpl; import org.openrdf.model.vocabulary.FOAF; import org.openrdf.repository.Repository; import org.openrdf.repository.RepositoryConnection;
