KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > hp > hpl > jena > reasoner > rulesys > test > TestLPRDFS


1 /******************************************************************
2  * File: TestLPRDFS.java
3  * Created by: Dave Reynolds
4  * Created on: 26-Jul-2003
5  *
6  * (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
7  * [See end of file]
8  * $Id: TestLPRDFS.java,v 1.6 2005/02/21 12:18:11 andy_seaborne Exp $
9  *****************************************************************/

10 package com.hp.hpl.jena.reasoner.rulesys.test;
11
12 import java.io.IOException JavaDoc;
13
14 import com.hp.hpl.jena.reasoner.*;
15 import com.hp.hpl.jena.reasoner.rulesys.*;
16 import com.hp.hpl.jena.reasoner.test.ReasonerTester;
17
18 import junit.framework.TestCase;
19 import junit.framework.TestSuite;
20 import org.apache.commons.logging.Log;
21 import org.apache.commons.logging.LogFactory;
22 import java.util.*;
23
24 /**
25  * Test an FB hyrid using the emerging LP engine on the basic RDFS tests.
26  *
27  * @author <a HREF="mailto:der@hplb.hpl.hp.com">Dave Reynolds</a>
28  * @version $Revision: 1.6 $ on $Date: 2005/02/21 12:18:11 $
29  */

30 public class TestLPRDFS extends TestCase {
31     
32     /** The location of the OWL rule definitions on the class path */
33     public static final String JavaDoc RULE_FILE = "etc/rdfs-fb-lp-expt.rules";
34     
35     /** The parsed rules */
36     protected static List ruleSet;
37         
38     /** The tester utility */
39     protected ReasonerTester tester;
40      
41     static Log logger = LogFactory.getLog(TestLPRDFS.class);
42     
43     /**
44      * Boilerplate for junit
45      */

46     public TestLPRDFS( String JavaDoc name ) {
47         super( name );
48     }
49     
50     /**
51      * Boilerplate for junit.
52      * This is its own test suite
53      */

54     public static TestSuite suite() {
55         return new TestSuite(TestLPRDFS.class);
56 // TestSuite suite = new TestSuite();
57
// try {
58
// TestRDFSReasoners.constructQuerytests(
59
// suite,
60
// "rdfs/manifest-nodirect-noresource.rdf",
61
// makeReasoner());
62
// } catch (IOException e) {
63
// // failed to even built the test harness
64
// logger.error("Failed to construct RDFS test harness", e);
65
// }
66
// return suite;
67
}
68    
69     public void test1() throws IOException JavaDoc {
70         doTest("test1");
71     }
72    
73     public void test2() throws IOException JavaDoc {
74         doTest("test2");
75     }
76    
77     public void test3() throws IOException JavaDoc {
78         doTest("test3");
79     }
80    
81     public void test4() throws IOException JavaDoc {
82         doTest("test4");
83     }
84    
85     public void test5() throws IOException JavaDoc {
86         doTest("test5");
87     }
88    
89     public void test6() throws IOException JavaDoc {
90         doTest("test6");
91     }
92    
93     public void test7() throws IOException JavaDoc {
94         doTest("test7");
95     }
96    
97     public void test8() throws IOException JavaDoc {
98         doTest("test8");
99     }
100    
101     public void test9() throws IOException JavaDoc {
102         doTest("test9");
103     }
104    
105     public void test10() throws IOException JavaDoc {
106         doTest("test10");
107     }
108    
109     public void test11() throws IOException JavaDoc {
110         doTest("test11");
111     }
112    
113     public void test12() throws IOException JavaDoc {
114         doTest("test12");
115     }
116    
117     public void test13() throws IOException JavaDoc {
118         doTest("test13");
119     }
120    
121     public void test14() throws IOException JavaDoc {
122         doTest("test14");
123     }
124    
125     public void test15() throws IOException JavaDoc {
126         doTest("test15");
127     }
128    
129     public void test16() throws IOException JavaDoc {
130         doTest("test16");
131     }
132    
133     public void test18() throws IOException JavaDoc {
134         doTest("test18");
135     }
136    
137     public void test20() throws IOException JavaDoc {
138         doTest("test20");
139     }
140    
141     /**
142      * Run a named test.
143      */

144     public void doTest(String JavaDoc name) throws IOException JavaDoc {
145         ReasonerTester tester = new ReasonerTester("rdfs/manifest-nodirect-noresource.rdf");
146         tester.runTest(ReasonerTester.BASE_URI + "rdfs/" + name, makeReasoner(), this);
147     }
148     
149     /**
150      * Return the reasoner to test
151      */

152     public static Reasoner makeReasoner() {
153         FBRuleReasoner reasoner = new FBRuleReasoner(loadRules());
154         // Don't have TGC enable yet.
155
return reasoner;
156     }
157     
158     /**
159      * Return the RDFS rule set, loading it in if necessary
160      */

161     public static List loadRules() {
162         if (ruleSet == null) ruleSet = FBRuleReasoner.loadRules( RULE_FILE );
163         return ruleSet;
164     }
165
166 }
167
168
169
170 /*
171     (c) Copyright 2003, 2004, 2005 Hewlett-Packard Development Company, LP
172     All rights reserved.
173
174     Redistribution and use in source and binary forms, with or without
175     modification, are permitted provided that the following conditions
176     are met:
177
178     1. Redistributions of source code must retain the above copyright
179        notice, this list of conditions and the following disclaimer.
180
181     2. Redistributions in binary form must reproduce the above copyright
182        notice, this list of conditions and the following disclaimer in the
183        documentation and/or other materials provided with the distribution.
184
185     3. The name of the author may not be used to endorse or promote products
186        derived from this software without specific prior written permission.
187
188     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
189     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
190     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
191     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
192     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
193     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
194     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
195     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
196     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
197     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
198 */
Popular Tags