Examples of TreeMapValuesProvider


Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

  @Test
  public void testVarsTreeMap(){
    TreeMap<String, Object> model = new TreeMap<String, Object>();
    model.put("var", 10);
    model.put("var2", "joe");
    String result = engine.parse("Hi there ${var},${var2}", new TreeMapValuesProvider(model)).trim();
    assertEquals("Hi there 10,joe",result);
  }
View Full Code Here

Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

    TreeMap<String, Object> model = new TreeMap<String, Object>();
    model.put("truefact", true);
    model.put("falsefact", false);
    String result = engine.parse("#if ($truefact)\n" +
                    "TRUE\n" +
                    "#end", new TreeMapValuesProvider(model)).trim();
    assertEquals("TRUE",result);
  }
View Full Code Here

Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

    TreeMap<String, Object> model = new TreeMap<String, Object>();
    model.put("truefact", true);
    model.put("falsefact", false);
    String result = engine.parse("#if ($falsefact)\n" +
                    "TRUE\n" +
                    "#end", new TreeMapValuesProvider(model)).trim();
    assertEquals("",result);
  }
View Full Code Here

Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

    model.put("falsefact", false);
    String result = engine.parse("#if ($falsefact)\n" +
                    "FALSE\n" +
                    "#else\n" +
                    "TRUE\n" +
                    "#end", new TreeMapValuesProvider(model)).trim();
    assertEquals("TRUE",result);
  }
View Full Code Here

Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

    model.put("falsefact", false);
    String result = engine.parse("#if ($truefact)\n" +
                    "FALSE\n" +
                    "#else\n" +
                    "TRUE\n" +
                    "#end", new TreeMapValuesProvider(model)).trim();
    assertEquals("FALSE",result);
  }
View Full Code Here

Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

    TreeMap<String, Object> model = new TreeMap<String, Object>();
    String result = engine.parse("#if ($nonexistvar)\n" +
                    "FALSE\n" +
                    "#else\n" +
                    "TRUE\n" +
                    "#end", new TreeMapValuesProvider(model)).trim();
    assertEquals("TRUE",result);
  }
View Full Code Here

Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

    TreeMap<String, Object> model = new TreeMap<String, Object>();
    ArrayList<Integer> lst = new ArrayList<Integer>();
    model.put("items", lst);
    String result = engine.parse("#foreach($item in $items)\n" +
                    "BBB\n" +
                    "#end", new TreeMapValuesProvider(model)).trim();
    assertEquals("",result);
  }
View Full Code Here

Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

    lst.add(2);
    lst.add(3);
    model.put("items", lst);
    String result = engine.parse("#foreach($item in $items)\n" +
                    "BBB\n" +
                    "#end", new TreeMapValuesProvider(model)).trim();
    assertEquals("BBB\r\n" +
           "BBB\r\n" +
           "BBB",result);
  }
View Full Code Here

Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

    lst.add(2);
    lst.add(3);
    model.put("items", lst);
    String result = engine.parse("#foreach($item in $items)\n" +
                    "BBB:${item}\n" +
                    "#end", new TreeMapValuesProvider(model)).trim();
    assertEquals("BBB:1\r\n" +
           "BBB:2\r\n" +
           "BBB:3",result);
  }
View Full Code Here

Examples of yms.tinyvelocity.providers.TreeMapValuesProvider

    TreeMap<String, Object> model = new TreeMap<String, Object>();
   
    model.put("items", new int[]{1,2,3});
    String result = engine.parse("#foreach($item in $items)\n" +
                    "BBB:${item}\n" +
                    "#end", new TreeMapValuesProvider(model)).trim();
    assertEquals("BBB:1\r\n" +
           "BBB:2\r\n" +
           "BBB:3",result);
  }
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.