use of jetbrick.template.utils.UnsafeCharArrayWriter in project jetbrick-template-1x by subchen.
the class IssueTestCase method test100.
@Test
public void test100() throws Exception {
String source = "#set(Map<String, String> map = {'name':'jetbrick'})\n";
source += "${map.name.length()}";
JetTemplate template = engine.createTemplate(source);
UnsafeCharArrayWriter out = new UnsafeCharArrayWriter();
template.render(new JetContext(), out);
Assert.assertEquals("8", out.toString());
}
use of jetbrick.template.utils.UnsafeCharArrayWriter in project jetbrick-template-1x by subchen.
the class SecurityManagerTestCase method methodAccess.
@Test
public void methodAccess() throws Exception {
try {
JetTemplate template = engine.createTemplate("${new Date().time}");
UnsafeCharArrayWriter out = new UnsafeCharArrayWriter();
template.render(new JetContext(), out);
} catch (AccessControlException e) {
return;
}
Assert.fail();
}
use of jetbrick.template.utils.UnsafeCharArrayWriter in project jetbrick-template-1x by subchen.
the class SecurityManagerTestCase method pkgAccess.
@Test
public void pkgAccess() throws Exception {
try {
JetTemplate template = engine.createTemplate("${new HashMap()}");
UnsafeCharArrayWriter out = new UnsafeCharArrayWriter();
template.render(new JetContext(), out);
} catch (AccessControlException e) {
return;
}
Assert.fail();
}
use of jetbrick.template.utils.UnsafeCharArrayWriter in project jetbrick-template-1x by subchen.
the class SecurityManagerTestCase method fieldAccess.
@Test
public void fieldAccess() throws Exception {
try {
JetTemplate template = engine.createTemplate("${@Integer.MAX_VALUE}");
UnsafeCharArrayWriter out = new UnsafeCharArrayWriter();
template.render(new JetContext(), out);
} catch (AccessControlException e) {
return;
}
Assert.fail();
}
Aggregations