Examples of StringTemplateLoader


Examples of net.sf.lapg.templates.api.impl.StringTemplateLoader

  public void testOverrides() {
    Hashtable<String,String[]> h = new Hashtable<String,String[]>();
    h.put("list", new String[] { "a", "b" });
    TemplatesFacade env = new TestTemplatesFacade(new DefaultNavigationFactory(),
        new StringTemplateLoader("inline", "${template overrides.my2}go next my2(${call base})\n\n${end}"),
        new ClassTemplateLoader(getClass().getClassLoader(), TEMPLATES_LOCATION, TEMPLATES_CHARSET));
    EvaluationContext context = new EvaluationContext(h);
    context.setVariable("util", new DefaultStaticMethods());

    // test 1
View Full Code Here

Examples of net.sf.lapg.templates.api.impl.StringTemplateLoader

    Assert.assertEquals("go next my2(my2\n)\n\n", q);
  }

  public void testOverrides2() {
    TestTemplatesFacade env = new TestTemplatesFacade(new DefaultNavigationFactory(),
        new StringTemplateLoader("inline", "${template overrides.my1(aa)}go next my1\n\n${end}"),
        new ClassTemplateLoader(getClass().getClassLoader(), TEMPLATES_LOCATION, TEMPLATES_CHARSET));
    EvaluationContext context = new EvaluationContext(null);

    // test 1
    env.addErrors("Template `my1(aa)` is not compatible with base template `my1`");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.