1 10 11 package com.hp.hpl.jena.reasoner.rulesys.test; 12 13 import com.hp.hpl.jena.rdf.model.Model; 14 import com.hp.hpl.jena.rdf.model.ModelFactory; 15 import com.hp.hpl.jena.reasoner.InfGraph; 16 import com.hp.hpl.jena.reasoner.Reasoner; 17 import com.hp.hpl.jena.reasoner.ReasonerRegistry; 18 import com.hp.hpl.jena.reasoner.rulesys.DAMLMicroReasonerFactory; 19 20 import junit.framework.TestCase; 21 import junit.framework.TestSuite; 22 23 30 31 public class TestCapabilities extends TestCase { 32 33 36 public TestCapabilities( String name ) { 37 super( name ); 38 } 39 40 44 public static TestSuite suite() { 45 return new TestSuite( TestCapabilities.class ); 46 } 47 48 51 public void testCapabilityValues() { 52 Object [][] testSpec = new Object [][] { 53 {ReasonerRegistry.getOWLMicroReasoner(), Boolean.TRUE}, 54 {ReasonerRegistry.getOWLMiniReasoner(), Boolean.TRUE}, 55 {ReasonerRegistry.getOWLReasoner(), Boolean.FALSE}, 56 {ReasonerRegistry.getDIGReasoner(), Boolean.FALSE}, 57 {ReasonerRegistry.getRDFSReasoner(), Boolean.TRUE}, 58 {ReasonerRegistry.getRDFSSimpleReasoner(), Boolean.TRUE}, 59 {DAMLMicroReasonerFactory.theInstance().create(null), Boolean.TRUE}, 60 }; 61 Model data = ModelFactory.createDefaultModel(); 62 for (int i = 0; i < testSpec.length; i++) { 63 Object [] test = testSpec[i]; 64 Reasoner r = (Reasoner)test[0]; 65 Boolean safe = (Boolean )test[1]; 66 InfGraph ig = r.bind(data.getGraph()); 67 assertEquals(r.toString(), safe.booleanValue(), ig.getCapabilities().findContractSafe()); 68 } 69 } 70 } 71 72 73 102 | Popular Tags |