use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class VarBindingSeqSampleTag method render.
@Override
public void render() {
this.binds("abc", new User("lijz"));
this.doBodyRender();
}
use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class DynamicTest method testDynamicUser2.
@Test
public void testDynamicUser2() throws Exception {
/*语法兼容1.x*/
Map map = new HashMap();
map.put("name", "joelli");
map.put("age", 36);
Template t = gt.getTemplate("/type/dynamic_user2_template.html");
this.bind(t, "user", map);
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/type/dynamic_user2_expected.html"), str);
User user = User.getTestUser();
t = gt.getTemplate("/type/dynamic_user2_template.html");
this.bind(t, "user", user);
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/type/dynamic_user2_expected.html"), str);
}
use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class DynamicTest method testDynamicAll.
@Test
public void testDynamicAll() throws Exception {
Map map = new HashMap();
map.put("name", "joelli");
map.put("age", 36);
Template t = gt.getTemplate("/type/dynamic_all_template.html");
this.bind(t, "user", map);
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/type/dynamic_all_expected.html"), str);
User user = User.getTestUser();
t = gt.getTemplate("/type/dynamic_all_template.html");
this.bind(t, "user", user);
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/type/dynamic_all_expected.html"), str);
}
use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class SimpleVATest method testUserAttribute.
@Test
public void testUserAttribute() throws Exception {
User user = User.getTestUser();
Template t = gt.getTemplate("/va/va_simple_template.html");
this.bind(t, "user", user);
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/va/va_simple_expected.html"), str);
t = gt.getTemplate("/va/va_simple_template.html");
this.bind(t, "user", user);
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/va/va_simple_expected.html"), str);
}
use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class LayoutTagTest method testLayoutInclude.
@Test
public void testLayoutInclude() throws Exception {
User user = User.getTestUser();
Template t = gt.getTemplate("/tag/layoutinclude_template.html");
this.bind(t, "user", user);
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/layoutinclude_expected.html"), str);
t = gt.getTemplate("/tag/layoutinclude_template.html");
this.bind(t, "user", user);
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/layoutinclude_expected.html"), str);
}
Aggregations