Skip to content
Permalink
Browse files
COMMONSRDF-47: Avoid hard-coded RDFSyntax names
  • Loading branch information
stain committed Feb 11, 2017
1 parent 92998b3 commit fbd72a9173b35d73c27af068ca75bdd44c3045f0
Showing 1 changed file with 7 additions and 3 deletions.
@@ -21,6 +21,7 @@
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.apache.commons.rdf.api.RDFSyntax.*;

import java.io.ByteArrayInputStream;
import java.io.IOException;
@@ -162,7 +163,8 @@ public void parseFileContentType() throws Exception {
// international characters
assertEquals("<" + testNt.toUri().toString() + ">", firstPredicate(g, "source"));
assertEquals("<" + testNt.toUri().toString() + ">", firstPredicate(g, "base"));
assertEquals("\"NTRIPLES\"", firstPredicate(g, "contentTypeSyntax"));
assertEquals("\"" + RDFSyntax.NTRIPLES.name() + "\"",
firstPredicate(g, "contentTypeSyntax"));
assertEquals("\"application/n-triples\"", firstPredicate(g, "contentType"));
}

@@ -213,7 +215,8 @@ public void parseInputStreamWithNQuads() throws Exception {
// bnode source indicates InputStream
assertTrue(firstPredicate(g, "source").startsWith("_:"));
assertEquals("\"application/n-quads\"", firstPredicate(g, "contentType"));
assertEquals("\"NQUADS\"", firstPredicate(g, "contentTypeSyntax"));
assertEquals("\"" + RDFSyntax.NQUADS.name() + "\"",
firstPredicate(g, "contentTypeSyntax"));
}

@Test
@@ -243,7 +246,8 @@ public void parseIRIBaseContentType() throws Exception {
checkGraph(g);
assertEquals("<http://www.example.net/test.ttl>", firstPredicate(g, "source"));
assertEquals("<http://www.example.net/test.ttl>", firstPredicate(g, "base"));
assertEquals("\"TURTLE\"", firstPredicate(g, "contentTypeSyntax"));
assertEquals("\"" + RDFSyntax.TURTLE.name() + "\"",
firstPredicate(g, "contentTypeSyntax"));
assertEquals("\"text/turtle\"", firstPredicate(g, "contentType"));
}

0 comments on commit fbd72a9

Please sign in to comment.