01: /*
02: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP, all rights reserved.
03: [See end of file]
04: $Id: TestInfGraph.java,v 1.8 2008/01/02 12:08:31 andy_seaborne Exp $
05: */
06:
07: package com.hp.hpl.jena.reasoner.test;
08:
09: import junit.framework.*;
10:
11: import com.hp.hpl.jena.graph.Graph;
12: import com.hp.hpl.jena.graph.test.AbstractTestGraph;
13: import com.hp.hpl.jena.rdf.model.ModelFactory;
14: import com.hp.hpl.jena.reasoner.InfGraph;
15: import com.hp.hpl.jena.reasoner.rulesys.BasicFBReifier;
16:
17: /**
18: Needs extending; relys on knowing that the only InfGraph currently used is
19: the Jena-provided base. Needs to be made into an abstract test and
20: parametrised with the InfGraph being tested (hence getInfGraph).
21: @author hedgehog
22: */
23:
24: public class TestInfGraph extends AbstractTestGraph {
25: public TestInfGraph(String name) {
26: super (name);
27: }
28:
29: public static TestSuite suite() {
30: return new TestSuite(TestInfGraph.class);
31: }
32:
33: private InfGraph getInfGraph() {
34: return (InfGraph) ModelFactory.createOntologyModel().getGraph();
35: }
36:
37: public Graph getGraph() {
38: return getInfGraph();
39: }
40:
41: public void testInfGraph() {
42: InfGraph ig = getInfGraph();
43: assertSame(ig.getPrefixMapping(), ig.getRawGraph()
44: .getPrefixMapping());
45: }
46:
47: public void testInfReification() {
48: InfGraph ig = getInfGraph();
49: assertInstanceOf(BasicFBReifier.class, ig.getReifier());
50: }
51:
52: /**
53: Placeholder. Will need revision later.
54: */
55: public void testInfCapabilities() {
56: // The default Ontology inference model is RDFS which is safe
57: assertTrue(getInfGraph().getCapabilities().findContractSafe());
58: }
59: }
60:
61: /*
62: (c) Copyright 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
63: All rights reserved.
64:
65: Redistribution and use in source and binary forms, with or without
66: modification, are permitted provided that the following conditions
67: are met:
68:
69: 1. Redistributions of source code must retain the above copyright
70: notice, this list of conditions and the following disclaimer.
71:
72: 2. Redistributions in binary form must reproduce the above copyright
73: notice, this list of conditions and the following disclaimer in the
74: documentation and/or other materials provided with the distribution.
75:
76: 3. The name of the author may not be used to endorse or promote products
77: derived from this software without specific prior written permission.
78:
79: THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
80: IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
81: OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
82: IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
83: INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
84: NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
85: DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
86: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
87: (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
88: THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
89: */
|