|
a/src/test/java/org/sbaresearch/owl/OwlApiFacadeTest.java |
|
b/src/test/java/org/sbaresearch/owl/OwlApiFacadeTest.java |
|
... |
|
... |
29 |
import org.semanticweb.owlapi.apibinding.OWLManager;
|
29 |
import org.semanticweb.owlapi.apibinding.OWLManager;
|
30 |
import org.semanticweb.owlapi.model.*;
|
30 |
import org.semanticweb.owlapi.model.*;
|
31 |
import org.semanticweb.owlapi.vocab.OWL2Datatype;
|
31 |
import org.semanticweb.owlapi.vocab.OWL2Datatype;
|
32 |
import uk.ac.manchester.cs.owl.owlapi.OWL2DatatypeImpl;
|
32 |
import uk.ac.manchester.cs.owl.owlapi.OWL2DatatypeImpl;
|
33 |
|
33 |
|
|
|
34 |
import java.io.ByteArrayInputStream;
|
34 |
import java.io.File;
|
35 |
import java.io.File;
|
35 |
import java.io.IOException;
|
36 |
import java.io.IOException;
|
36 |
import java.lang.reflect.InvocationTargetException;
|
37 |
import java.lang.reflect.InvocationTargetException;
|
37 |
import java.lang.reflect.Method;
|
38 |
import java.lang.reflect.Method;
|
38 |
import java.lang.reflect.Modifier;
|
39 |
import java.lang.reflect.Modifier;
|
|
... |
|
... |
814 |
assertTrue(owlApi.isIndividualOfClass(indiv, IRI.create("http://localhost/test_ab2.owl#ClassB")));
|
815 |
assertTrue(owlApi.isIndividualOfClass(indiv, IRI.create("http://localhost/test_ab2.owl#ClassB")));
|
815 |
assertTrue(owlApi.isIndividualOfClass(indiv, IRI.create("http://localhost/test_ab3.owl#ClassD")));
|
816 |
assertTrue(owlApi.isIndividualOfClass(indiv, IRI.create("http://localhost/test_ab3.owl#ClassD")));
|
816 |
assertFalse(owlApi.isIndividualOfClass(indiv, IRI.create("http://localhost/test_ab4.owl#ClassE")));
|
817 |
assertFalse(owlApi.isIndividualOfClass(indiv, IRI.create("http://localhost/test_ab4.owl#ClassE")));
|
817 |
}
|
818 |
}
|
818 |
|
819 |
|
|
|
820 |
@Test(expected = ConstraintsViolatedException.class)
|
|
|
821 |
public void testToXMLString_ontologyNull_shouldThrowException() throws IOException, OWLOntologyStorageException {
|
|
|
822 |
OwlApiFacade.toXMLString(null);
|
|
|
823 |
}
|
|
|
824 |
|
|
|
825 |
@Test
|
|
|
826 |
public void testToXMLString_validOntology_shouldReturnOntologyAsXML() throws IOException, OWLOntologyStorageException, OWLOntologyCreationException {
|
|
|
827 |
OwlApiFacade expected = TestUtils.createDefaultOwlApiFacade();
|
|
|
828 |
expected.load(new ByteArrayInputStream(TestResources.testOntology.getBytes("UTF-8")));
|
|
|
829 |
String xmlString = OwlApiFacade.toXMLString(expected.getOntology());
|
|
|
830 |
OwlApiFacade actual = TestUtils.createDefaultOwlApiFacade();
|
|
|
831 |
actual.load(new ByteArrayInputStream(xmlString.getBytes("UTF-8")));
|
|
|
832 |
assertThat(actual.getOntology().getAxiomCount(), equalTo(expected.getOntology().getAxiomCount()));
|
|
|
833 |
}
|
|
|
834 |
|
819 |
//<editor-fold desc="helper methods">
|
835 |
//<editor-fold desc="helper methods">
|
820 |
|
836 |
|
821 |
private String getOwlUri() throws URISyntaxException {
|
837 |
private String getOwlUri() throws URISyntaxException {
|
822 |
return TestUtils.getUri("/test.owl");
|
838 |
return TestUtils.getUri("/test.owl");
|
823 |
}
|
839 |
}
|