Search in sources :

Example 1 with JavaTemplates

use of com.querydsl.core.types.JavaTemplates 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 JavaTemplates

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

the class SerializerBaseTest method test.

@Test
public void test() {
    DummySerializer serializer = new DummySerializer(new JavaTemplates());
    StringPath strPath = Expressions.stringPath("str");
    // path
    serializer.handle(strPath);
    // operation
    serializer.handle(strPath.isNotNull());
    // long path
    serializer.handle(new PathBuilder<Object>(Object.class, "p").getList("l", Map.class).get(0));
    // constant
    serializer.handle(ConstantImpl.create(""));
    // custom
    serializer.handle(ExpressionUtils.template(Object.class, "xxx", ConstantImpl.create("")));
}
Also used : JavaTemplates(com.querydsl.core.types.JavaTemplates) StringPath(com.querydsl.core.types.dsl.StringPath) Test(org.junit.Test)

Aggregations

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