Search in sources :

Example 1 with SystemSource

use of org.teiid.query.function.source.SystemSource in project teiid by teiid.

the class TestFunctionTree method testWalkTree.

/**
 * Walk through all functions by metadata and verify that we can look
 * each one up by signature
 */
@Test
public void testWalkTree() {
    SystemSource source = new SystemSource();
    FunctionTree ft = new FunctionTree("foo", source);
    Collection<String> categories = ft.getCategories();
    for (String category : categories) {
        assertTrue(ft.getFunctionsInCategory(category).size() > 0);
    }
}
Also used : SystemSource(org.teiid.query.function.source.SystemSource) Test(org.junit.Test)

Example 2 with SystemSource

use of org.teiid.query.function.source.SystemSource in project teiid by teiid.

the class TestSystemSource method testValidate.

@Test
public void testValidate() {
    SystemSource source = new SystemSource();
    // $NON-NLS-1$
    ValidatorReport report = new ValidatorReport("Test Report");
    FunctionMetadataValidator.validateFunctionMethods(source.getFunctionMethods(), report);
    if (report.hasItems()) {
        // $NON-NLS-1$
        fail("Got validation errors while validating system functions: " + report);
    }
}
Also used : SystemSource(org.teiid.query.function.source.SystemSource) ValidatorReport(org.teiid.query.validator.ValidatorReport) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 SystemSource (org.teiid.query.function.source.SystemSource)2 ValidatorReport (org.teiid.query.validator.ValidatorReport)1