Package org.stringtree.tract

Examples of org.stringtree.tract.MapTract


        common.put("template.thing", new MapTract("hello"));
        assertEquals("hello", request("/thing"));
    }
   
    public void testPageWithDefaultPrologue() throws IOException {
        common.put("template.thing", new MapTract("hello"));
        common.put("template.page_prologue", "<<");
        assertEquals("<<hello", request("/thing"));
    }
View Full Code Here


        common.put("template.page_prologue", "<<");
        assertEquals("<<hello", request("/thing"));
    }
   
    public void testPageWithDefaultEpilogue() throws IOException {
        common.put("template.thing", new MapTract("hello"));
        common.put("template.page_epilogue", ">>");
        assertEquals("hello>>", request("/thing"));
    }
View Full Code Here

        common.put("template.page_epilogue", ">>");
        assertEquals("hello>>", request("/thing"));
    }
   
    public void testPageWithDefaultPrologueAndEpilogue() throws IOException {
        common.put("template.thing", new MapTract("hello"));
        common.put("template.page_prologue", "<<");
        common.put("template.page_epilogue", ">>");
        assertEquals("<<hello>>", request("/thing"));
    }
View Full Code Here

        common.put("template.page_epilogue", ">>");
        assertEquals("<<hello>>", request("/thing"));
    }
   
    public void testOverridePrologue() throws IOException {
        common.put("template.thing", new MapTract("hello"));
        common.put("template.page_prologue", "<<");
        common.put("template.page_epilogue", ">>");
        common.put("template.new_prologue", "xx");
        common.put("template.new_epilogue", "yy");
        assertEquals("xxhello>>", request("/thing?prologue.template=new_prologue"));
View Full Code Here

        common.put("template.new_epilogue", "yy");
        assertEquals("xxhello>>", request("/thing?prologue.template=new_prologue"));
    }
   
    public void testOverrideEpilogue() throws IOException {
        common.put("template.thing", new MapTract("hello"));
        common.put("template.page_prologue", "<<");
        common.put("template.page_epilogue", ">>");
        common.put("template.new_prologue", "xx");
        common.put("template.new_epilogue", "yy");
        assertEquals("<<helloyy", request("/thing?epilogue.template=new_epilogue"));
View Full Code Here

public class TractReturnTest extends WebAppTestCase {
    Map<String, Object> params;

    public void setUp() {
        Tract t1 = new MapTract("hello");
        Tract t2 = new MapTract("hello${@" + HTTPConstants.RESPONSE_CODE +"='404'}");
        params = new HashMap<String, Object>();
        params.put(MojasefConstants.HTTP_APPLICATION, new StringRet());
        params.put(Templater.TEMPLATE + ".t1", t1);
        params.put(Templater.TEMPLATE + ".t2", t2);
        init(params);
View Full Code Here

TOP

Related Classes of org.stringtree.tract.MapTract

Copyright © 2018 www.massapicom. 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.