public void storedOntologyOutlivesScope() throws Exception {
String ephemeralScopeId = "CaducousScope";
OntologyInputSource<OWLOntology,?> ois = new RootOntologyIRISource(IRI.create(getClass().getResource(
"/ontologies/nonexistentcharacters.owl")));
IRI ontologyId = ois.getRootOntology().getOntologyID().getOntologyIRI();
OntologyScope scope = onManager.getOntologyScopeFactory().createOntologyScope(ephemeralScopeId);
// Initially, the ontology is not there
assertNull(ontologyProvider.getKey(ontologyId));
// Once added, the ontology is there
scope.getCustomSpace().addOntology(ois);
assertNotNull(ontologyProvider.getKey(ontologyId));
// Once removed from the scope, the ontology is still there
scope.getCustomSpace().removeOntology(ontologyId);
assertNotNull(ontologyProvider.getKey(ontologyId));
// Once the scope is killed, the ontology is still there
// TODO find a more appropriate method to kill scopes?
scope.tearDown();
assertNotNull(ontologyProvider.getKey(ontologyId));
}