Examples of HashMapContext


Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test6() throws Exception {
        String t = "bar{-prefix|/|var}/";
        String e = "bar/foo/";
        HashMapContext c = new HashMapContext();
        c.put("var", "foo");
        eval(t, e, c);
    }
View Full Code Here

Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test7() throws Exception {
        String t = "bar/{-suffix|#home|var}";
        String e = "bar/foo#home";
        HashMapContext c = new HashMapContext();
        c.put("var", "foo");
        eval(t, e, c);
    }
View Full Code Here

Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test8() throws Exception {
        String t = "{-join|&|name,location,age}";
        String e = "name=joe&location=NYC";
        HashMapContext c = new HashMapContext();
        c.put("name", "joe");
        c.put("location", "NYC");
        eval(t, e, c);
    }
View Full Code Here

Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test9() throws Exception {
        String t = "{-list|/|segments}";
        String e = "a/b/c";
        HashMapContext c = new HashMapContext();
        c.put("segments", new String[] {"a", "b", "c"});
        eval(t, e, c);
    }
View Full Code Here

Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test10() throws Exception {
        String t = "{-opt|/|segments}";
        String e = "/";
        HashMapContext c = new HashMapContext();
        c.put("segments", new String[] {"a", "b", "c"});
        eval(t, e, c);
    }
View Full Code Here

Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test11() throws Exception {
        String t = "{-neg|/|segments}";
        String e = "";
        HashMapContext c = new HashMapContext();
        c.put("segments", new String[] {"a", "b", "c"});
        eval(t, e, c);
    }
View Full Code Here

Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test12() throws Exception {
        String t = "http://www.google.com/search?q={term}";
        String e = "http://www.google.com/search?q=ben%26jerrys";
        HashMapContext c = new HashMapContext();
        c.put("term", "ben&jerrys");
        eval(t, e, c);
        t = "http://www.google.com/search?q={term}";
        e = "http://www.google.com/search?q=2%2B2%3D5";
        c = new HashMapContext();
        c.put("term", "2+2=5");
        eval(t, e, c);
        t = "http://www.google.com/base/feeds/snippets/?{-join|&|author}";
        e = "http://www.google.com/base/feeds/snippets/?author=test%40example.com";
        c = new HashMapContext();
        c.put("author", "test@example.com");
        eval(t, e, c);
    }
View Full Code Here

Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test13() throws Exception {
        String t = "http://www.google.com/search?q={term}";
        String e =
            "http://www.google.com/search?q=%C3%8E%C3%B1%C5%A3%C3%A9r%C3%B1%C3%A5%C5%A3%C3%AE%C3%B6%C3%B1%C3%A5%C4%BC%C3%AE%C5%BE%C3%A5%C5%A3%C3%AE%C3%B6%C3%B1";
        HashMapContext c = new HashMapContext();
        c
            .put("term",
                 "\u00ce\u00f1\u0163\u00e9\u0072\u00f1\u00e5\u0163\u00ee\u00f6\u00f1\u00e5\u013c\u00ee\u017e\u00e5\u0163\u00ee\u00f6\u00f1");
        eval(t, e, c);
    }
View Full Code Here

Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test14() throws Exception {
        String t = "{-opt|/-/|categories}{-list|/|categories}";
        String e = "/-/A%7C-B/-C";
        HashMapContext c = new HashMapContext();
        c.put("categories", new String[] {"A|-B", "-C"});
        eval(t, e, c);
    }
View Full Code Here

Examples of org.apache.abdera.i18n.templates.HashMapContext

    @Test
    public void test15() throws Exception {
        String t =
            "http://www.google.com/notebook/feeds/{userID}{-prefix|/notebooks/|notebookID}{-opt|/-/|categories}{-list|/|categories}?{-join|&|updated-min,updated-max,alt,start-index,max-results,entryID,orderby}";
        String e = "http://www.google.com/notebook/feeds/a/notebooks/b?updated-min=c&max-results=d";
        HashMapContext c = new HashMapContext();
        c.put("userID", "a");
        c.put("notebookID", "b");
        c.put("updated-min", "c");
        c.put("max-results", "d");
        eval(t, e, c);
    }
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.