| java.lang.Object com.hp.hpl.jena.reasoner.test.ReasonerTester
ReasonerTester | public class ReasonerTester (Code) | | A utility for loading a set of test reasoner problems and running defined
sets of listStatement operations and checking the results.
Each of the source, query and result models are specified in
different files. The files can be of type .rdf, .nt or .n3.
A single manifest file defines the set of tests to run. Each test
specifies a name, source tbox file, source data file, query file and result file using
the properties "name", "source", "query" and "result" in the namespace
"http://www.hpl.hp.com/semweb/2003/query_tester#". The file names are
given as strings instead of URIs because the base directory for the test
files is subject to change.
Within the query file each triple is treated as a triple pattern
to be searched for. Variables are indicated by resources in of the
form "var:x".
author: Dave Reynolds version: $Revision: 1.31 $ on $Date: 2008/01/02 12:08:31 $ |
Method Summary | |
public List | listTests() Return a list of all test names defined in the manifest for this test harness. | public Model | loadFile(String file, boolean cache) Utility to load a file in rdf/nt/n3 format as a Model. | public Graph | loadTestFile(Resource test, Property predicate) Load the datafile given by the property name. | public static Node | nodeToPattern(Node n) Convert a node into a pattern node by converting var resources into wildcard
variables. | public boolean | runTest(String uri, ReasonerFactory reasonerF, TestCase testcase, Resource configuration) Run a single designated test. | public boolean | runTest(String uri, Reasoner reasoner, TestCase testcase) Run a single designated test. | public boolean | runTests(ReasonerFactory reasonerF, TestCase testcase, Resource configuration) | public boolean | runTests(Reasoner reasoner, TestCase testcase) | public static TriplePattern | tripleToPattern(Triple t) Convert a triple into a triple pattern by converting var resources into
wildcard variables. |
BASE_URI | final public static String BASE_URI(Code) | | The base URI in which the files are purported to reside
|
NS | final public static String NS(Code) | | The namespace for the test specification schema
|
baseDir | final public static String baseDir(Code) | | The base directory in which the test data is stored
|
dataP | final public static Property dataP(Code) | | The predicate defining the source data file for the test
|
descriptionP | final public static Property descriptionP(Code) | | The predicate defining the description of the test
|
logger | protected static Log logger(Code) | | |
queryP | final public static Property queryP(Code) | | The predicate defining the query file for the test
|
resultP | final public static Property resultP(Code) | | The predicate defining the result file for the test
|
sourceCache | protected Map sourceCache(Code) | | A cache of loaded source files, map from source name to Model
|
tboxP | final public static Property tboxP(Code) | | The predicate defining the source tbox file for the test
|
testClass | final public static Resource testClass(Code) | | The rdf class to which all tests belong
|
testManifest | protected Model testManifest(Code) | | The rdf defining all the tests to be run
|
ReasonerTester | public ReasonerTester(String manifest) throws IOException(Code) | | Constructor.
Parameters: manifest - the name of the manifest file defining thesetests - relative to baseDir |
listTests | public List listTests()(Code) | | Return a list of all test names defined in the manifest for this test harness.
|
loadFile | public Model loadFile(String file, boolean cache) throws IOException(Code) | | Utility to load a file in rdf/nt/n3 format as a Model.
Parameters: file - the file name, relative to baseDir Parameters: cache - set to true if the file could be usefully cached the loaded Model |
loadTestFile | public Graph loadTestFile(Resource test, Property predicate) throws IOException(Code) | | Load the datafile given by the property name.
Parameters: test - the test being processed Parameters: predicate - the property of the test giving the file name to load a graph containing the file contents or an empty graph if the propertyis not present throws: IOException - if the property is present but the file can't be found |
nodeToPattern | public static Node nodeToPattern(Node n)(Code) | | Convert a node into a pattern node by converting var resources into wildcard
variables.
|
runTest | public boolean runTest(String uri, ReasonerFactory reasonerF, TestCase testcase, Resource configuration) throws IOException(Code) | | Run a single designated test.
Parameters: uri - the uri of the test, as defined in the manifest file Parameters: reasonerF - the factory for the reasoner to be tested Parameters: testcase - the JUnit test case which is requesting this test Parameters: configuration - optional configuration information true if the test passes throws: IOException - if one of the test files can't be found throws: RDFException - if the test can't be found or fails internally |
runTest | public boolean runTest(String uri, Reasoner reasoner, TestCase testcase) throws IOException(Code) | | Run a single designated test.
Parameters: uri - the uri of the test, as defined in the manifest file Parameters: reasoner - the reasoner to be tested Parameters: testcase - the JUnit test case which is requesting this test true if the test passes throws: IOException - if one of the test files can't be found throws: RDFException - if the test can't be found or fails internally |
runTests | public boolean runTests(ReasonerFactory reasonerF, TestCase testcase, Resource configuration) throws IOException(Code) | | Run all the tests in the manifest
Parameters: reasonerF - the factory for the reasoner to be tested Parameters: testcase - the JUnit test case which is requesting this test Parameters: configuration - optional configuration information true if all the tests pass throws: IOException - if one of the test files can't be found throws: RDFException - if the test can't be found or fails internally |
runTests | public boolean runTests(Reasoner reasoner, TestCase testcase) throws IOException(Code) | | Run all the tests in the manifest
Parameters: reasoner - the reasoner to be tested Parameters: testcase - the JUnit test case which is requesting this test true if all the tests pass throws: IOException - if one of the test files can't be found throws: RDFException - if the test can't be found or fails internally |
tripleToPattern | public static TriplePattern tripleToPattern(Triple t)(Code) | | Convert a triple into a triple pattern by converting var resources into
wildcard variables.
|
|
|