/** * Check that the files referred to are ok. * * @exception Throwable if an error occurs */ public void runTest() throws Throwable { SpeciesValidator sv = new SpeciesValidator(); sv.setReporter(new ValidatorLogger()); sv.setConnection(connection); // URI uri = new URI( manifestURI ); for (Iterator it = test.getDocuments().iterator(); it.hasNext(); ) { /* First off, make sure that the connection has *no* * ontologies in it. We need to do this as a number of the * tests use the same logical URI for ontologies -- this * causes problems. By clearing them all out, we ensure that * everything will be fine. Probably. */ /* Note that we have to do this before validating each * document, as parsing one of the test documents may drag * in another via an import. Phew! */ String doc = ((String) it.next()); Set levels = (Set) test.getDocumentLevels().get(doc); // logger.info(doc + ""); URI ontoURI = new URI(doc + ""); if (levels != null) { if (levels.contains(OWLTestVocabularyAdapter.INSTANCE.getOWLLite())) { logger.info(doc + "" + " Lite..."); dropAllOntologies(); assertTrue(doc + "" + " Lite", sv.isOWLLite(ontoURI)); logger.info(doc + "" + " OK!"); } else if (levels.contains(OWLTestVocabularyAdapter.INSTANCE.getOWLDL())) { logger.info(doc + "" + " DL..."); dropAllOntologies(); assertTrue(doc + "" + " Not Lite", !sv.isOWLLite(ontoURI)); dropAllOntologies(); assertTrue(doc + "" + " DL", sv.isOWLDL(ontoURI)); logger.info(doc + "" + " OK!"); } else if (levels.contains(OWLTestVocabularyAdapter.INSTANCE.getOWLFull())) { logger.info(doc + "" + " Full..."); dropAllOntologies(); assertTrue(doc + "" + " Not Lite", !sv.isOWLLite(ontoURI)); dropAllOntologies(); assertTrue(doc + "" + " Not DL", !sv.isOWLDL(ontoURI)); dropAllOntologies(); assertTrue(doc + "" + " Full", sv.isOWLFull(ontoURI)); logger.info(doc + "" + " OK!"); } } } }
public OWLTestTest(OWLConnection connection, OWLTest test) { super("OWLTest " + test.getURI()); // this.manifestURI = manifestURI; this.connection = connection; this.test = test; }