fix test that relies on the NQuadsWriter expanding namespaces, when this is never necessary with the Sesame API, as namespaces are always expanded automatically inside of the org.openrdf.model.URI interface, and in addition, N-Quads has never, and will never have, any support for namespaces. If that happens it will be as an extension to Turtle, which will be separate from N-Quads as N-Quads is by design a very thin wrapper over N-Triples, which will also never have namespace/prefixes
Project: http://git-wip-us.apache.org/repos/asf/any23/repo Commit: http://git-wip-us.apache.org/repos/asf/any23/commit/c7562f9e Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/c7562f9e Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/c7562f9e Branch: refs/heads/ANY23-141 Commit: c7562f9e20f2604f273ffd8af83445d024762e24 Parents: bc291c0 Author: Peter Ansell <[email protected]> Authored: Wed Oct 24 13:55:18 2012 +1000 Committer: Peter Ansell <[email protected]> Committed: Fri Apr 19 13:34:55 2013 +1000 ---------------------------------------------------------------------- .../apache/any23/io/nquads/NQuadsWriterTest.java | 23 ++++++++------- 1 files changed, 12 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/any23/blob/c7562f9e/nquads/src/test/java/org/apache/any23/io/nquads/NQuadsWriterTest.java ---------------------------------------------------------------------- diff --git a/nquads/src/test/java/org/apache/any23/io/nquads/NQuadsWriterTest.java b/nquads/src/test/java/org/apache/any23/io/nquads/NQuadsWriterTest.java index 368e876..1fe92c6 100644 --- a/nquads/src/test/java/org/apache/any23/io/nquads/NQuadsWriterTest.java +++ b/nquads/src/test/java/org/apache/any23/io/nquads/NQuadsWriterTest.java @@ -97,12 +97,12 @@ public class NQuadsWriterTest { literal("12345", uri("http://www.w3.org/2001/XMLSchema#integer")), uri("http://gra2") ); - Statement s6 = quad( - uri("p1:sub"), - uri("p1:pre"), - uri("p1:obj"), - uri("p1:gra2") - ); +// Statement s6 = quad( +// uri("p1:sub"), +// uri("p1:pre"), +// uri("p1:obj"), +// uri("p1:gra2") +// ); Statement s7 = quad( uri("http://sub"), uri("http://pre"), @@ -112,29 +112,30 @@ public class NQuadsWriterTest { // Sending events. writer.startRDF(); - writer.handleNamespace("p1", "http://test.com/"); + //writer.handleNamespace("p1", "http://test.com/"); writer.handleStatement(s1); writer.handleStatement(s2); writer.handleStatement(s3); writer.handleStatement(s4); writer.handleStatement(s5); - writer.handleStatement(s6); + //writer.handleStatement(s6); writer.handleStatement(s7); writer.endRDF(); // Checking content. String content = baos.toString(); + logger.info("output={}", content); String[] lines = content.split("\n"); - Assert.assertEquals("Unexpected number of lines.", 7, lines.length); + Assert.assertEquals("Unexpected number of lines.", 6, lines.length); Assert.assertTrue( lines[0].matches("<.*> <.*> <.*> <.*> \\.") ); Assert.assertTrue( lines[1].matches("_:.* <.*> _:.* <.*> \\.") ); Assert.assertTrue( lines[2].matches("_:.* <.*> \".*\" <.*> \\.") ); Assert.assertTrue( lines[3].matches("_:.* <.*> \".*\"@en <.*> \\.") ); Assert.assertTrue( lines[4].matches("_:.* <.*> \".*\"\\^\\^<.*> <.*> \\.") ); - Assert.assertTrue( lines[5].matches("<http://.*> <http://.*> <http://.*> <http://.*> \\.") ); + //Assert.assertTrue( lines[5].matches("<http://.*> <http://.*> <http://.*> <http://.*> \\.") ); Assert.assertEquals( "<http://sub> <http://pre> \"This is line 1.\\nThis is line 2.\\n\" <http://gra3> .", - lines[6] + lines[5] ); }
