Skip to content

Commit

Permalink
rdf.tests: add test loading multiple formats in flipped order
Browse files Browse the repository at this point in the history
This test was failing when running from OSGi, due to RIOT not starting
correctly when Jena was not packaged as an uber-JAR.
  • Loading branch information
agarciadom committed Nov 21, 2024
1 parent 5e6f10e commit b2588ef
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
public class RDFModelMultipleUriTest {

private static final String SPIDERMAN_TTL = "resources/spiderman.ttl";
private static final String FOAF_RDFXML = "resources/foaf.rdfxml";
private static final String FOAF_RDFXML = "resources/foaf.rdf";

@Test
public void classIsAvailable() throws Exception {
public void ttlThenRDFXML() throws Exception {
try (RDFModel model = new RDFModel()) {
model.getUris().add(getAbsoluteURI(SPIDERMAN_TTL));
model.getUris().add(getAbsoluteURI(FOAF_RDFXML));
Expand All @@ -34,6 +34,17 @@ public void classIsAvailable() throws Exception {
}
}

@Test
public void rdfXMLThenTTL() throws Exception {
try (RDFModel model = new RDFModel()) {
model.getUris().add(getAbsoluteURI(FOAF_RDFXML));
model.getUris().add(getAbsoluteURI(SPIDERMAN_TTL));
model.load();

assertEquals("The FOAF vocabulary has 13 classes", 13, model.getAllOfType("Class").size());
}
}

private String getAbsoluteURI(String path) {
return new File(path).getAbsoluteFile().toURI().toString();
}
Expand Down

0 comments on commit b2588ef

Please sign in to comment.