Search in sources :

Example 16 with User

use of org.beetl.core.User in project beetl2.0 by javamonkey.

the class SetTest method testPojo.

@Test
public void testPojo() throws Exception {
    Template t = gt.getTemplate("/exp/set_pojo_template.html");
    User user = new User("joelli");
    User lover = new User("lucymiao");
    t.binding("user", user);
    t.binding("lover", lover);
    String str = t.render();
    AssertJUnit.assertEquals(this.getFileContent("/exp/set_pojo_expected.html"), str);
    t = gt.getTemplate("/exp/set_pojo_template.html");
    t.binding("user", user);
    t.binding("lover", lover);
    str = t.render();
    AssertJUnit.assertEquals(this.getFileContent("/exp/set_pojo_expected.html"), str);
}
Also used : User(org.beetl.core.User) Template(org.beetl.core.Template) Test(org.testng.annotations.Test)

Aggregations

User (org.beetl.core.User)16 Template (org.beetl.core.Template)14 Test (org.testng.annotations.Test)14 HashMap (java.util.HashMap)5 Map (java.util.Map)5 List (java.util.List)2 JSONObject (com.alibaba.fastjson.JSONObject)1 Context (org.beetl.core.Context)1 VirtualClassAttribute (org.beetl.core.VirtualClassAttribute)1