Search in sources :

Example 1 with QueryTestException

use of org.apache.jena.sparql.junit.QueryTestException in project jena by apache.

the class QueryTestSDBFactory method makeTest.

@Override
public Test makeTest(Resource manifest, Resource entry, String testName, Resource action, Resource result) {
    // Defaults.
    Syntax querySyntax = getQuerySyntax(manifest);
    if (testRootName != null)
        testName = testRootName + testName;
    if (querySyntax != null) {
        if (!querySyntax.equals(Syntax.syntaxARQ) && !querySyntax.equals(Syntax.syntaxSPARQL))
            throw new QueryTestException("Unknown syntax: " + querySyntax);
    }
    TestItem testItem = TestItem.create(entry, TestManifestX.TestQuery);
    TestCase test = null;
    if (testItem.getTestType().equals(TestManifestX.TestQuery))
        test = new QueryTestSDB(storeDesc, testName, results, testItem);
    if (testItem.getTestType().equals(TestManifestX.TestSurpressed))
        test = new SurpressedTest(testName, results, testItem);
    if (test == null)
        System.err.println("Unrecognized test type: " + testItem.getTestType());
    Resource action2 = testItem.getAction();
    if (action2.hasProperty(TestManifestX.option))
        System.out.println("OPTION");
    return test;
}
Also used : TestCase(junit.framework.TestCase) Resource(org.apache.jena.rdf.model.Resource) SurpressedTest(org.apache.jena.sparql.junit.SurpressedTest) Syntax(org.apache.jena.query.Syntax) TestQueryUtils.getQuerySyntax(org.apache.jena.sparql.junit.TestQueryUtils.getQuerySyntax) QueryTestException(org.apache.jena.sparql.junit.QueryTestException) TestItem(org.apache.jena.sparql.junit.TestItem)

Aggregations

TestCase (junit.framework.TestCase)1 Syntax (org.apache.jena.query.Syntax)1 Resource (org.apache.jena.rdf.model.Resource)1 QueryTestException (org.apache.jena.sparql.junit.QueryTestException)1 SurpressedTest (org.apache.jena.sparql.junit.SurpressedTest)1 TestItem (org.apache.jena.sparql.junit.TestItem)1 TestQueryUtils.getQuerySyntax (org.apache.jena.sparql.junit.TestQueryUtils.getQuerySyntax)1