use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class DeleteTagTest method testDeleteTag.
@Test
public void testDeleteTag() throws Exception {
User user = User.getTestUser();
Template t = gt.getTemplate("/tag/delete_template.html");
this.bind(t, "user", user);
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/delete_expected.html"), str);
t = gt.getTemplate("/tag/delete_template.html");
this.bind(t, "user", user);
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/delete_expected.html"), str);
}
use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class IncludeTest method testInclude.
@Test
public void testInclude() throws Exception {
User user = User.getTestUser();
Template t = gt.getTemplate("/tag/include_template.html");
this.bind(t, "user", user);
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/include_expected.html"), str);
t = gt.getTemplate("/tag/include_template.html");
this.bind(t, "user", user);
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/include_expected.html"), str);
}
use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class IncludeTest method testIncludeRel.
@Test
public void testIncludeRel() throws Exception {
User user = User.getTestUser();
Template t = gt.getTemplate("/tag/main_include_template.html");
this.bind(t, "user", user);
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/main_include_expected.html"), str);
t = gt.getTemplate("/tag/main_include_template.html");
this.bind(t, "user", user);
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/main_include_expected.html"), str);
}
use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class LayoutTagTest method testLayout.
@Test
public void testLayout() throws Exception {
User user = User.getTestUser();
Template t = gt.getTemplate("/tag/layout_template.html");
this.bind(t, "user", user);
String str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/layout_expected.html"), str);
t = gt.getTemplate("/tag/layout_template.html");
this.bind(t, "user", user);
str = t.render();
AssertJUnit.assertEquals(this.getFileContent("/tag/layout_expected.html"), str);
}
use of org.beetl.core.User in project beetl2.0 by javamonkey.
the class NullFunction method call.
@Override
public Map call(Object[] paras, Context ctx) {
Boolean b = (Boolean) paras[0];
if (b) {
return null;
} else {
Map map = new HashMap();
User user = new User("name");
map.put("user", user);
return map;
}
}
Aggregations