assertNotNull(shouldBeNotNull);
}
@Test
public void testRemoveCustomOntology() throws Exception {
OntologySpace space = null;
space = factory.createCustomOntologySpace("testRemoveCustomOntology", dropSrc);
IRI dropId = dropSrc.getRootOntology().getOntologyID().getOntologyIRI();
IRI nonexId = nonexSrc.getRootOntology().getOntologyID().getOntologyIRI();
space.addOntology(inMemorySrc);
space.addOntology(nonexSrc);
// The other remote ontologies may change base IRI...
assertTrue(space.hasOntology(ont.getOntologyID().getOntologyIRI()));
assertTrue(space.hasOntology(dropId));
assertTrue(space.hasOntology(nonexId));
IRI bogus = IRI.create("http://www.example.org/ontology/bogus");
try {
space.removeOntology(bogus);
fail("Removing nonexisting ontology succeeded without an exception. This should not happen.");
} catch (MissingOntologyException mex) {
log.info("Expected exception caught when removing missing ontology {}", bogus);
}
space.removeOntology(dropId);
assertFalse(space.hasOntology(dropId));
space.removeOntology(nonexId);
assertFalse(space.hasOntology(nonexId));
// OntologyUtils.printOntology(space.getTopOntology(), System.err);
}