Package net.sf.lapg.templates.api.impl

Examples of net.sf.lapg.templates.api.impl.DefaultEvaluationCache.lookup()


public class ApiTests extends TemplateTestCase {

  public void testCache() {
    DefaultEvaluationCache cache = new DefaultEvaluationCache();
    cache.cache(3, 1, 2, 5);
    Assert.assertEquals(3, cache.lookup(1, 2, 5));
    Assert.assertEquals(null, cache.lookup(1, 2, 6));
    cache.cache(8, new Object[] { 3,4,7}, 9);
    Assert.assertEquals(8, cache.lookup(new Object[] { 3,4,7}, 9));
    Assert.assertEquals(null, cache.lookup(new Object[] { 3,5,7}, 9));
  }
View Full Code Here


  public void testCache() {
    DefaultEvaluationCache cache = new DefaultEvaluationCache();
    cache.cache(3, 1, 2, 5);
    Assert.assertEquals(3, cache.lookup(1, 2, 5));
    Assert.assertEquals(null, cache.lookup(1, 2, 6));
    cache.cache(8, new Object[] { 3,4,7}, 9);
    Assert.assertEquals(8, cache.lookup(new Object[] { 3,4,7}, 9));
    Assert.assertEquals(null, cache.lookup(new Object[] { 3,5,7}, 9));
  }
View Full Code Here

    DefaultEvaluationCache cache = new DefaultEvaluationCache();
    cache.cache(3, 1, 2, 5);
    Assert.assertEquals(3, cache.lookup(1, 2, 5));
    Assert.assertEquals(null, cache.lookup(1, 2, 6));
    cache.cache(8, new Object[] { 3,4,7}, 9);
    Assert.assertEquals(8, cache.lookup(new Object[] { 3,4,7}, 9));
    Assert.assertEquals(null, cache.lookup(new Object[] { 3,5,7}, 9));
  }

  public void testIds() {
    DefaultStaticMethods util = new DefaultStaticMethods();
View Full Code Here

    cache.cache(3, 1, 2, 5);
    Assert.assertEquals(3, cache.lookup(1, 2, 5));
    Assert.assertEquals(null, cache.lookup(1, 2, 6));
    cache.cache(8, new Object[] { 3,4,7}, 9);
    Assert.assertEquals(8, cache.lookup(new Object[] { 3,4,7}, 9));
    Assert.assertEquals(null, cache.lookup(new Object[] { 3,5,7}, 9));
  }

  public void testIds() {
    DefaultStaticMethods util = new DefaultStaticMethods();
    Assert.assertEquals("CamelCase", util.toCamelCase("camel_case", true));
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.