1 19 20 package com.hp.hpl.jena.ontology.event.test; 23 24 25 26 import com.hp.hpl.jena.ontology.*; 29 import com.hp.hpl.jena.ontology.event.OntEventHandler; 30 import com.hp.hpl.jena.ontology.impl.test.*; 31 import com.hp.hpl.jena.rdf.model.*; 32 33 34 42 public class TestOntEvents 43 extends OntTestBase 44 { 45 46 49 52 55 58 public TestOntEvents(String name) { 59 super(name); 60 } 61 62 63 66 69 73 private static class OntEventTestCase 74 extends OntTestBase 75 { 76 private ModelUpdater m_updater; 77 private OntModel m_model; 78 private Resource m_expected; 79 private boolean m_taleOfExpected = false; 80 private boolean m_taleOfUnexpected = false; 81 82 private OntEventTestCase( String name, ModelUpdater upd, String lang, Resource event ) { 83 super( name ); 84 m_updater = upd; 85 m_model = ModelFactory.createOntologyModel( lang ); 86 m_expected = event; 87 } 88 89 public void runTest() { 90 m_model.getEventManager().addHandler( m_expected, new OntEventHandler() { 92 public void action(Resource event, boolean add, Model source, RDFNode arg0, RDFNode arg1, RDFNode arg2) { 93 94 } 95 }); 96 } 97 98 public void setUp() { 99 OntDocumentManager.getInstance().reset( true ); 101 } 102 103 104 } 105 106 private static interface ModelUpdater { 107 public void update( OntModel m ); 108 } 109 } 110 111 112 113 142 | Popular Tags |