1 10 package com.hp.hpl.jena.reasoner.rulesys.test; 11 12 import com.hp.hpl.jena.reasoner.ReasonerFactory; 13 import com.hp.hpl.jena.reasoner.rulesys.*; 14 import com.hp.hpl.jena.reasoner.rulesys.impl.oldCode.*; 15 16 import junit.framework.TestCase; 17 import junit.framework.TestSuite; 18 import java.io.IOException ; 19 20 26 public class TestOWLRules extends TestCase { 27 28 29 protected String manifest; 30 31 32 protected static boolean testForward = false; 33 34 35 protected static boolean testExpt = false; 36 37 38 protected static boolean enableTracing = false; 39 40 41 protected static boolean printStats = false; 42 43 46 public TestOWLRules( String manifest ) { 47 super( manifest ); 48 this.manifest = manifest; 49 } 50 51 55 public static TestSuite suite() { 56 TestSuite suite = new TestSuite(); 57 58 suite.addTest(new TestOWLRules("SymmetricProperty/Manifest001.rdf")); 60 suite.addTest(new TestOWLRules("SymmetricProperty/Manifest001.rdf")); 61 suite.addTest(new TestOWLRules("FunctionalProperty/Manifest001.rdf")); 62 suite.addTest(new TestOWLRules("FunctionalProperty/Manifest002.rdf")); 63 suite.addTest(new TestOWLRules("FunctionalProperty/Manifest003.rdf")); 64 suite.addTest(new TestOWLRules("InverseFunctionalProperty/Manifest001.rdf")); 65 suite.addTest(new TestOWLRules("InverseFunctionalProperty/Manifest002.rdf")); 66 suite.addTest(new TestOWLRules("InverseFunctionalProperty/Manifest003.rdf")); 67 68 suite.addTest(new TestOWLRules("rdf-charmod-uris/Manifest.rdf")); 69 suite.addTest(new TestOWLRules("I4.6/Manifest003.rdf")); 70 suite.addTest(new TestOWLRules("I5.2/Manifest002.rdf")); 71 suite.addTest(new TestOWLRules("I5.5/Manifest001.rdf")); 72 suite.addTest(new TestOWLRules("I5.5/Manifest002.rdf")); 73 suite.addTest(new TestOWLRules("I5.5/Manifest003.rdf")); 74 suite.addTest(new TestOWLRules("I5.5/Manifest004.rdf")); 75 suite.addTest(new TestOWLRules("inverseOf/Manifest001.rdf")); 76 suite.addTest(new TestOWLRules("TransitiveProperty/Manifest001.rdf")); 77 suite.addTest(new TestOWLRules("equivalentClass/Manifest001.rdf")); suite.addTest(new TestOWLRules("equivalentClass/Manifest002.rdf")); suite.addTest(new TestOWLRules("equivalentClass/Manifest003.rdf")); suite.addTest(new TestOWLRules("equivalentClass/Manifest005.rdf")); suite.addTest(new TestOWLRules("equivalentProperty/Manifest001.rdf")); suite.addTest(new TestOWLRules("equivalentProperty/Manifest002.rdf")); suite.addTest(new TestOWLRules("equivalentProperty/Manifest003.rdf")); 84 suite.addTest(new TestOWLRules("I5.1/Manifest001.rdf")); suite.addTest(new TestOWLRules("I5.24/Manifest001.rdf")); 86 suite.addTest(new TestOWLRules("I5.24/Manifest002-mod.rdf")); 87 suite.addTest(new TestOWLRules("equivalentProperty/Manifest006.rdf")); 88 suite.addTest(new TestOWLRules("intersectionOf/Manifest001.rdf")); 90 suite.addTest(new TestOWLRules("differentFrom/Manifest001.rdf")); 92 suite.addTest(new TestOWLRules("disjointWith/Manifest001.rdf")); 93 suite.addTest(new TestOWLRules("disjointWith/Manifest002.rdf")); 94 suite.addTest(new TestOWLRules("AllDifferent/Manifest001.rdf")); 96 suite.addTest(new TestOWLRules("allValuesFrom/Manifest001.rdf")); suite.addTest(new TestOWLRules("allValuesFrom/Manifest002.rdf")); suite.addTest(new TestOWLRules("someValuesFrom/Manifest002.rdf")); suite.addTest(new TestOWLRules("maxCardinality/Manifest001.rdf")); 101 suite.addTest(new TestOWLRules("maxCardinality/Manifest002.rdf")); 102 suite.addTest(new TestOWLRules("FunctionalProperty/Manifest005-mod.rdf")); 103 suite.addTest(new TestOWLRules("I5.24/Manifest004-mod.rdf")); suite.addTest(new TestOWLRules("cardinality/Manifest001-mod.rdf")); suite.addTest(new TestOWLRules("cardinality/Manifest002-mod.rdf")); suite.addTest(new TestOWLRules("cardinality/Manifest003-mod.rdf")); suite.addTest(new TestOWLRules("cardinality/Manifest004-mod.rdf")); suite.addTest(new TestOWLRules("I5.24/Manifest003-mod.rdf")); 109 suite.addTest(new TestOWLRules("cardinality/Manifest005-mod.rdf")); suite.addTest(new TestOWLRules("cardinality/Manifest006-mod.rdf")); suite.addTest(new TestOWLRules("equivalentClass/Manifest004.rdf")); 113 suite.addTest(new TestOWLRules("someValuesFrom/Manifest001.rdf")); 116 suite.addTest(new TestOWLRules("localtests/Manifest001.rdf")); 118 suite.addTest(new TestOWLRules("localtests/Manifest002.rdf")); 119 suite.addTest(new TestOWLRules("localtests/Manifest003.rdf")); 120 suite.addTest(new TestOWLRules("localtests/Manifest004.rdf")); 121 suite.addTest(new TestOWLRules("localtests/Manifest005.rdf")); 122 suite.addTest(new TestOWLRules("localtests/Manifest006.rdf")); 123 124 128 138 145 162 163 return suite; 164 } 165 166 169 175 176 179 protected void runTest() throws IOException { 180 if (testForward) { 181 OWLWGTester tester = new OWLWGTester(OWLRuleReasonerFactory.theInstance(), this, null); 182 tester.runTests(manifest, enableTracing, printStats); 183 } else { 185 ReasonerFactory rf = testExpt ? OWLExptRuleReasonerFactory.theInstance() 186 : OWLFBRuleReasonerFactory.theInstance(); 187 OWLWGTester tester = new OWLWGTester(rf, this, null); 188 tester.runTests(manifest, enableTracing, printStats); 189 } 190 } 191 192 193 private static class DelayTest extends TestCase { 194 public DelayTest(String name) { 195 super(name); 196 } 197 protected void runTest() throws InterruptedException { 198 Thread.sleep(2000); 199 assertTrue(true); 200 } 201 } 202 203 206 public static void main(String [] args) { 207 try { 208 String test = "FunctionalProperty/Manifest002.rdf"; 209 ReasonerFactory rf = OWLExptRuleReasonerFactory.theInstance(); 210 OWLWGTester tester = new OWLWGTester(rf, null, null); 212 System.out.println("Start test ..."); 213 tester.runTests(test, false , true ); 214 System.out.println("...end test\n"); 215 216 } catch (Exception e) { 217 e.printStackTrace(); 219 } 220 } 221 222 } 223 224 253 254 | Popular Tags |