Examples of HashMapContext


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

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
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.