Search in sources :

Example 1 with Templates

use of com.querydsl.core.types.Templates in project querydsl by querydsl.

the class JavaTemplatesTest method mappings.

@Test
public void mappings() {
    Templates templates = new JavaTemplates();
    int matched = 0;
    for (Operator operator : Ops.values()) {
        ++matched;
        assertNotNull(templates.getTemplate(operator));
    }
    assertTrue(matched > 0);
}
Also used : Operator(com.querydsl.core.types.Operator) JavaTemplates(com.querydsl.core.types.JavaTemplates) Templates(com.querydsl.core.types.Templates) JavaTemplates(com.querydsl.core.types.JavaTemplates) Test(org.junit.Test)

Example 2 with Templates

use of com.querydsl.core.types.Templates in project querydsl by querydsl.

the class TemplatesTestBase method default_instance.

@Test
public void default_instance() {
    Set<Class<? extends Templates>> templates = querydsl.getSubTypesOf(Templates.class);
    Set<Class<? extends Templates>> moduleSpecific = getAll(templates, MODULE_SPECIFIC);
    for (Class<? extends Templates> template : moduleSpecific) {
        try {
            Templates defaultInstance = (Templates) template.getField("DEFAULT").get(null);
            errorCollector.checkThat(defaultInstance, instanceOf(template));
        } catch (Exception ex) {
            errorCollector.addError(ex);
        }
    }
}
Also used : Templates(com.querydsl.core.types.Templates) Test(org.junit.Test)

Aggregations

Templates (com.querydsl.core.types.Templates)2 Test (org.junit.Test)2 JavaTemplates (com.querydsl.core.types.JavaTemplates)1 Operator (com.querydsl.core.types.Operator)1