use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class HtmlTagTest method testNS.
@Test
public void testNS() throws Exception {
Template t = gt.getTemplate("/tag/html2_template.html");
this.bind(t, "list", User.getTestUsers());
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html2_expected.html"), str);
t = gt.getTemplate("/tag/html2_template.html");
this.bind(t, "list", User.getTestUsers());
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html2_expected.html"), str);
}
use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class HtmlTagTest method testMutilTagInSamePage.
@Test
public void testMutilTagInSamePage() throws Exception {
Template t = gt.getTemplate("/tag/html3_template.html");
this.bind(t, "list", User.getTestUsers());
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html3_expected.html"), str);
t = gt.getTemplate("/tag/html3_template.html");
this.bind(t, "list", User.getTestUsers());
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html3_expected.html"), str);
}
use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class HtmlTagTest method testCallMutipleTag.
@Test
public void testCallMutipleTag() throws Exception {
Template t = gt.getTemplate("/tag/html7_template.html");
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html7_expected.html"), str);
t = gt.getTemplate("/tag/html7_template.html");
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/html7_expected.html"), str);
}
use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class HtmlVarBinddingTagTest method testTagSeq.
@Test
public void testTagSeq() throws Exception {
// 测试按照顺序绑定
gt.registerTag("tagseqbinding", VarBindingSeqSampleTag.class);
// todo 会多出一个空行
Template t = gt.getTemplate("/tag/binding/tagseqbinding_template.html");
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/binding/tagseqbinding_expected.html"), str);
t = gt.getTemplate("/tag/binding/tagseqbinding_template.html");
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/binding/tagseqbinding_expected.html"), str);
}
use of org.beetl.core.Template in project beetl2.0 by javamonkey.
the class HtmlVarBinddingTagTest method testBindingByAttribute.
@Test
public void testBindingByAttribute() throws Exception {
// 测试通过特殊属性绑定
gt.registerTag("tagseqbinding", VarBindingSeqSampleTag.class);
// todo 会多出一个空行
Template t = gt.getTemplate("/tag/binding/tagAttr_template.html");
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/binding/tagAttr_expected.html"), str);
t = gt.getTemplate("/tag/binding/tagAttr_template.html");
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/binding/tagAttr_expected.html"), str);
}
Aggregations