use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class HtmlTagTest method testJavaTag.
@Test
public void testJavaTag() throws Exception {
gt.registerTag("simpleTag", SimpleHtmlTag.class);
Template t = gt.getTemplate("/tag/html5_template.html");
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html5_expected.html"), str);
t = gt.getTemplate("/tag/html5_template.html");
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html5_expected.html"), str);
}
use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class HtmlTagTest method testDilimterHtmlTag.
@Test
public void testDilimterHtmlTag() throws Exception {
Template t = newGt.getTemplate("/tag/html_dilimeter_template.html");
this.bind(t, "list", User.getTestUsers());
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html_dilimeter_expected.html"), str);
t = newGt.getTemplate("/tag/html_dilimeter_template.html");
this.bind(t, "list", User.getTestUsers());
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html_dilimeter_expected.html"), str);
}
use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class HtmlVarBinddingTagTest method testEmptyTag.
@Test
public void testEmptyTag() throws Exception {
// 将默认搜索路径更改到tag目录下
gt.registerTag("tagbinding", VarBindingSampleTag.class);
Template t = gt.getTemplate("/tag/binding/tagbinding_template.html");
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/binding/tagbinding_expected.html"), str);
t = gt.getTemplate("/tag/binding/tagbinding_template.html");
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/binding/tagbinding_expected.html"), str);
}
use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class HtmlVarBinddingTagTest method testLoopTag.
@Test
public void testLoopTag() throws Exception {
// 将默认搜索路径更改到tag目录下
gt.registerTag("tagloopbinding", VarBindingLoopSampleTag.class);
// todo 会多出一个空行
Template t = gt.getTemplate("/tag/binding/tagloopbinding_template.html");
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/binding/tagloopbinding_expected.html"), str);
t = gt.getTemplate("/tag/binding/tagloopbinding_template.html");
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/binding/tagloopbinding_expected.html"), str);
}
use of org.beetl.core.Template 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