Package org.stringtemplate.v4

Examples of org.stringtemplate.v4.STGroupDir.unload()


    writeFile(dir, "b.st", b);
    STGroup group = new STGroupDir(dir);
    group.load(); // force load
    ST st = group.getInstanceOf("a");
    int originalHashCode = System.identityHashCode(st);
    group.unload(); // blast cache
    st = group.getInstanceOf("a");
    int newHashCode = System.identityHashCode(st);
    assertEquals(originalHashCode==newHashCode, false); // diff objects
    String expected = "foo";
    String result = st.render();
View Full Code Here


    writeFile(dir, "a.stg", a);
    STGroup group = new STGroupFile(dir+"/a.stg");
    group.load(); // force load
    ST st = group.getInstanceOf("a");
    int originalHashCode = System.identityHashCode(st);
    group.unload(); // blast cache
    st = group.getInstanceOf("a");
    int newHashCode = System.identityHashCode(st);
    assertEquals(originalHashCode==newHashCode, false); // diff objects
    String expected = "foo";
    String result = st.render();
View Full Code Here

    Assert.assertEquals("v1-g1", st.render());

    // Change the text of group t, including the imports.
    writeFile(tmpdir, "t.stg",
        "import \"g2.stg\"\n\nmain() ::= <<\nv2-<f()>;<f2()>\n>>");
    group.unload();
    st = group.getInstanceOf("main");
    Assert.assertEquals("v2-g2;f2", st.render());
  }

  @Test public void testLineBreakInGroup() throws Exception {
View Full Code Here

    writeFile(dir, "b.st", b);
    STGroup group = new STGroupDir(dir);
    group.load(); // force load
    ST st = group.getInstanceOf("a");
    int originalHashCode = System.identityHashCode(st);
    group.unload(); // blast cache
    st = group.getInstanceOf("a");
    int newHashCode = System.identityHashCode(st);
    assertEquals(originalHashCode==newHashCode, false); // diff objects
    String expected = "foo";
    String result = st.render();
View Full Code Here

    writeFile(dir, "a.stg", a);
    STGroup group = new STGroupFile(dir+"/a.stg");
    group.load(); // force load
    ST st = group.getInstanceOf("a");
    int originalHashCode = System.identityHashCode(st);
    group.unload(); // blast cache
    st = group.getInstanceOf("a");
    int newHashCode = System.identityHashCode(st);
    assertEquals(originalHashCode==newHashCode, false); // diff objects
    String expected = "foo";
    String result = st.render();
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.