use of org.beetl.core.resource.ClasspathResourceLoader in project beetl2.0 by javamonkey.
the class ResourceLoaderTest method testSimple.
@Test
public void testSimple() throws Exception {
FileResourceLoader f = new FileResourceLoader();
boolean exist = f.exist("/build.xml");
AssertJUnit.assertTrue(exist);
ClasspathResourceLoader cp = new ClasspathResourceLoader();
exist = cp.exist("/template/resourceloader/cp.txt");
AssertJUnit.assertTrue(exist);
}
use of org.beetl.core.resource.ClasspathResourceLoader in project beetl2.0 by javamonkey.
the class ErrorTest method main.
public static void main(String[] args) throws Exception {
ClasspathResourceLoader resourceLoader = new ClasspathResourceLoader();
Configuration cfg = Configuration.defaultConfiguration();
GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
Template t = gt.getTemplate("/org/beetl/sample/s0125/error1.txt");
String str = t.render();
t = gt.getTemplate("/org/beetl/sample/s0125/error2.txt");
str = t.render();
System.out.println(str);
}
Aggregations