Examples of HashMapContext


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

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

  @Test
  public void test16() throws Exception {
    String t = "http://www.google.com/search?q={term}";
    String e = "http://www.google.com/search?q=\u00ce\u00f1\u0163\u00e9\u0072\u00f1\u00e5\u0163\u00ee\u00f6\u00f1\u00e5\u013c\u00ee\u017e\u00e5\u0163\u00ee\u00f6\u00f1";
    HashMapContext c = new HashMapContext();
    c.setIri(true);
    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)// use the IriEvaluator so that pct-encoding is done correctly for IRI's
  }
View Full Code Here

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

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

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

    @Test
    public void test1() throws Exception {
        String t = "http://bitworking.org/news/{entry}";
        String e = "http://bitworking.org/news/RESTLog_Specification";
        HashMapContext c = new HashMapContext();
        c.put("entry", "RESTLog_Specification");
        eval(t, e, c);
    }
View Full Code Here

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

    @Test
    public void test2() throws Exception {
        String t = "http://example.org/wiki/{entry=FrontPage}";
        String e = "http://example.org/wiki/FrontPage";
        HashMapContext c = new HashMapContext();
        eval(t, e, c);
    }
View Full Code Here

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

    @Test
    public void test3() throws Exception {
        String t = "http://bitworking.org/news/{-list|/|entry}";
        String e = "http://bitworking.org/news/240/Newsqueak";
        HashMapContext c = new HashMapContext();
        c.put("entry", new String[] {"240", "Newsqueak"});
        eval(t, e, c);
    }
View Full Code Here

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

    @Test
    public void test4() throws Exception {
        String t = "http://technorati.com/search/{term}";
        String e = "http://technorati.com/search/240%2FNewsqueak";
        HashMapContext c = new HashMapContext();
        c.put("term", "240/Newsqueak");
        eval(t, e, c);
    }
View Full Code Here

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

    @Test
    public void test5() throws Exception {
        String t = "http://example.org/{fruit=orange}/";
        String e = "http://example.org/apple/";
        String f = "http://example.org/orange/";
        HashMapContext c = new HashMapContext();
        c.put("fruit", "apple");
        eval(t, e, c);
        c.remove("fruit");
        eval(t, f, 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.