Search in sources :

Example 1 with SurpressedTest

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

the class TestFactoryTDB method makeTest.

@Override
protected Test makeTest(Resource manifest, Resource entry, String testName, Resource action, Resource result) {
    if (testRootName != null)
        testName = testRootName + testName;
    TestItem testItem = TestItem.create(entry, null);
    TestCase test = null;
    if (testItem.getTestType() != null) {
        if (testItem.getTestType().equals(TestManifestX.TestQuery))
            test = new QueryTestTDB(testName, report, testItem);
        if (testItem.getTestType().equals(TestManifestX.TestSurpressed))
            test = new SurpressedTest(testName, report, testItem);
        if (test == null)
            System.err.println("Unrecognized test type: " + testItem.getTestType());
    }
    // Default 
    if (test == null)
        test = new QueryTestTDB(testName, report, testItem);
    return test;
}
Also used : TestCase(junit.framework.TestCase) SurpressedTest(org.apache.jena.sparql.junit.SurpressedTest) TestItem(org.apache.jena.sparql.junit.TestItem)

Example 2 with SurpressedTest

use of org.apache.jena.sparql.junit.SurpressedTest 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)2 SurpressedTest (org.apache.jena.sparql.junit.SurpressedTest)2 TestItem (org.apache.jena.sparql.junit.TestItem)2 Syntax (org.apache.jena.query.Syntax)1 Resource (org.apache.jena.rdf.model.Resource)1 QueryTestException (org.apache.jena.sparql.junit.QueryTestException)1 TestQueryUtils.getQuerySyntax (org.apache.jena.sparql.junit.TestQueryUtils.getQuerySyntax)1