Search in sources :

Example 6 with StringTemplateResourceLoader

use of org.beetl.core.resource.StringTemplateResourceLoader in project beetl2.0 by javamonkey.

the class NativeTest method testSecurity.

@Test
public void testSecurity() throws Exception {
    StringTemplateResourceLoader resourceLoader = new StringTemplateResourceLoader();
    Configuration cfg = Configuration.defaultConfiguration();
    GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
    Template t = gt.getTemplate("hello,${@java.lang.System.currentTimeMillis()}");
    String str = t.render();
    AssertJUnit.assertEquals("hello,", str);
}
Also used : Configuration(org.beetl.core.Configuration) StringTemplateResourceLoader(org.beetl.core.resource.StringTemplateResourceLoader) GroupTemplate(org.beetl.core.GroupTemplate) GroupTemplate(org.beetl.core.GroupTemplate) Template(org.beetl.core.Template) Test(org.testng.annotations.Test)

Aggregations

Template (org.beetl.core.Template)6 StringTemplateResourceLoader (org.beetl.core.resource.StringTemplateResourceLoader)6 GroupTemplate (org.beetl.core.GroupTemplate)4 Configuration (org.beetl.core.Configuration)3 Test (org.testng.annotations.Test)3 JSONObject (com.alibaba.fastjson.JSONObject)2 Context (org.beetl.core.Context)2 VirtualAttributeEval (org.beetl.core.VirtualAttributeEval)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1 Test (org.junit.Test)1