Commit da378e90 authored by acoburn's avatar acoburn
Browse files

Update tests to conform to entailment regime

parent 35a9b46a
...@@ -19,15 +19,17 @@ import static java.nio.charset.StandardCharsets.UTF_8; ...@@ -19,15 +19,17 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.jena.rdf.model.ModelFactory.createDefaultModel; import static org.apache.jena.rdf.model.ModelFactory.createDefaultModel;
import static org.apache.jena.riot.RDFDataMgr.read; import static org.apache.jena.riot.RDFDataMgr.read;
import static org.apache.jena.riot.Lang.JSONLD; import static org.apache.jena.riot.Lang.JSONLD;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.slf4j.LoggerFactory.getLogger; import static org.slf4j.LoggerFactory.getLogger;
import java.io.InputStream; import java.io.InputStream;
import java.io.IOException; import java.io.IOException;
import java.io.StringWriter; import java.io.StringWriter;
import java.util.List;
import org.apache.commons.io.IOUtils; import org.apache.commons.io.IOUtils;
import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Resource;
import org.junit.Test; import org.junit.Test;
import org.slf4j.Logger; import org.slf4j.Logger;
/** /**
...@@ -59,9 +61,9 @@ public class EntailmentServiceTest { ...@@ -59,9 +61,9 @@ public class EntailmentServiceTest {
final String str = sw.toString(); final String str = sw.toString();
LOGGER.debug("string is : '{}'", str); LOGGER.debug("string is : '{}'", str);
assertFalse(str.equals("")); assertTrue(str.contains("skos:Concept"));
assertTrue(str.contains("rdfs:Resource") && str.contains("skos:Concept")); assertTrue(str.contains("skos:broaderTransitive"));
assertTrue(str.contains("skos:broaderTransitive") && str.contains("skos:semanticRelation")); assertTrue(str.contains("skos:semanticRelation"));
} }
@Test @Test
...@@ -73,8 +75,7 @@ public class EntailmentServiceTest { ...@@ -73,8 +75,7 @@ public class EntailmentServiceTest {
final String str = sw.toString(); final String str = sw.toString();
LOGGER.debug("string is : '{}'", str); LOGGER.debug("string is : '{}'", str);
assertFalse(str.equals("")); assertTrue(str.contains("rdfs:label"));
assertTrue(str.contains("rdfs:Resource") && str.contains("rdfs:label"));
} }
@Test @Test
...@@ -86,9 +87,11 @@ public class EntailmentServiceTest { ...@@ -86,9 +87,11 @@ public class EntailmentServiceTest {
final String str = sw.toString(); final String str = sw.toString();
LOGGER.debug("string is : '{}'", str); LOGGER.debug("string is : '{}'", str);
assertFalse(str.equals("")); assertTrue(str.contains("http://purl.org/dc/elements/1.1/rights"));
assertTrue(str.contains("dc:rights") && str.contains("dc:title") && str.contains("dc:description")); assertTrue(str.contains("http://purl.org/dc/elements/1.1/title"));
assertFalse(str.contains("dcterms:rights") && str.contains("dcterms:title")); assertTrue(str.contains("http://purl.org/dc/elements/1.1/description"));
assertTrue(str.contains("dcterms:rights"));
assertTrue(str.contains("dcterms:title"));
} }
@Test @Test
...@@ -100,7 +103,6 @@ public class EntailmentServiceTest { ...@@ -100,7 +103,6 @@ public class EntailmentServiceTest {
final String str = sw.toString(); final String str = sw.toString();
LOGGER.debug("string is : '{}'", str); LOGGER.debug("string is : '{}'", str);
assertFalse(str.equals(""));
assertTrue(str.contains("@prefix ex:")); assertTrue(str.contains("@prefix ex:"));
} }
...@@ -112,7 +114,7 @@ public class EntailmentServiceTest { ...@@ -112,7 +114,7 @@ public class EntailmentServiceTest {
final Model model = createDefaultModel(); final Model model = createDefaultModel();
read(model, is, JSONLD); read(model, is, JSONLD);
final String res = model.listSubjects().next().getURI(); final List<String> res = model.listSubjects().mapWith(Resource::getURI).toList();
assertTrue(res.equals("http://localhost:8080/fcrepo/rest/test")); assertTrue(res.contains("http://localhost:8080/fcrepo/rest/test"));
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment