use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class PairDLTest method testSimple.
@Test
public void testSimple() throws Exception {
GroupTemplate newGt = getGt();
Template t = newGt.getTemplate("/text/simple_pair_template.html");
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/text/simple_pair_expected.html"), str);
}
use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class SingleDLTest method testSimple.
@Test
public void testSimple() throws Exception {
GroupTemplate newGt = getGt();
Template t = newGt.getTemplate("/text/single_template.html");
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/text/single_expected.html"), str);
}
use of org.beetl.core.Template 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.Template 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.Template 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);
}
Aggregations