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/94f6d302 Tree: http://git-wip-us.apache.org/repos/asf/any23/tree/94f6d302 Diff: http://git-wip-us.apache.org/repos/asf/any23/diff/94f6d302 Branch: refs/heads/master Commit: 94f6d302061bbe51decbfe947938b6d808c5f8fa Parents: 493c573 Author: Peter Ansell <[email protected]> Authored: Wed Oct 24 13:55:18 2012 +1000 Committer: Peter Ansell <[email protected]> Committed: Wed Jun 26 10:08:07 2013 +1000 ---------------------------------------------------------------------- .../any23/io/nquads/NQuadsWriterTest.java | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/any23/blob/94f6d302/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] ); }
