Package org.springmodules.cache.config

Examples of org.springmodules.cache.config.DomElementStub


  public void testDoParseFlushingModel() {
    String cacheNames = "testCache";
    boolean flushBeforeMethodExecution = true;

    Element element = new DomElementStub("flushing");
    element.setAttribute("cacheNames", cacheNames);

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);
    EhCacheFlushingModel expected = new EhCacheFlushingModel(cacheNames);
    expected.setFlushBeforeMethodExecution(flushBeforeMethodExecution);
View Full Code Here


  }

  public void testParseCachingModel() {
    String cacheName = "testCache";

    Element element = new DomElementStub("caching");
    element.setAttribute("cacheName", cacheName);

    CachingModel actual = parser.parseCachingModel(element);
    CachingModel expected = new EhCacheCachingModel(cacheName);

    assertEquals(expected, actual);
View Full Code Here

  }

  public void testDoParseFlushingModelWithMoreThanOneCacheSubelement() {
    boolean flushBeforeMethodExecution = true;

    Element element = new DomElementStub("flushing");
    element.appendChild(createCacheElement("cacheOne", "pojos,daos"));
    element.appendChild(createCacheElement("cacheTwo", "services,web"));

    CacheStruct[] cacheStructs = { new CacheStruct("cacheOne", "pojos,daos"),
        new CacheStruct("cacheTwo", "services,web") };

    JcsFlushingModel expected = new JcsFlushingModel();
View Full Code Here

  public void testDoParseFlushingModelWithOneCacheSubelement() {
    String cacheName = "testCache";
    String groups = "group1,group2";
    boolean flushBeforeMethodExecution = true;

    Element element = new DomElementStub("flushing");
    element.appendChild(createCacheElement(cacheName, groups));

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);
    JcsFlushingModel expected = new JcsFlushingModel();
    expected.setCacheStruct(new CacheStruct(cacheName, groups));
View Full Code Here

  }

  public void testDoParseFlushingModelWithoutCacheSubelements() {
    boolean flushBeforeMethodExecution = true;

    Element element = new DomElementStub("flushing");

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);
    JcsFlushingModel expected = new JcsFlushingModel();
    expected.setFlushBeforeMethodExecution(flushBeforeMethodExecution);
View Full Code Here

  }

  public void testParseCachingModel() {
    String cacheName = "testCache";

    Element element = new DomElementStub("caching");
    element.setAttribute("cacheName", cacheName);

    CachingModel actual = parser.parseCachingModel(element);
    CachingModel expected = new JcsCachingModel(cacheName);

    assertEquals(expected, actual);
View Full Code Here

  protected void setUp() {
    parser = new JcsModelParser();
  }

  private Element createCacheElement(String cacheName, String groups) {
    Element cacheElement = new DomElementStub("cache");
    cacheElement.setAttribute("name", cacheName);
    cacheElement.setAttribute("groups", groups);

    return cacheElement;
  }
View Full Code Here

  public void testDoParseFlushingModel() {
    String nodes = "testCache";
    boolean flushBeforeMethodExecution = true;

    Element element = new DomElementStub("flushing");
    element.setAttribute("nodes", nodes);

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);
    JbossCacheFlushingModel expected = new JbossCacheFlushingModel(nodes);
    expected.setFlushBeforeMethodExecution(flushBeforeMethodExecution);
View Full Code Here

  }

  public void testParseCachingModel() {
    String node = "testCache";

    Element element = new DomElementStub("caching");
    element.setAttribute("node", node);

    CachingModel actual = parser.parseCachingModel(element);
    CachingModel expected = new JbossCacheCachingModel(node);

    assertEquals(expected, actual);
View Full Code Here

  public void testDoParseFlushingModel() {
    String cacheNames = "testCache";
    boolean flushBeforeMethodExecution = true;

    Element element = new DomElementStub("flushing");
    element.setAttribute("cacheNames", cacheNames);

    FlushingModel actual = parser.doParseFlushingModel(element,
        flushBeforeMethodExecution);
    CoherenceFlushingModel expected = new CoherenceFlushingModel(cacheNames);
    expected.setFlushBeforeMethodExecution(flushBeforeMethodExecution);
View Full Code Here

TOP

Related Classes of org.springmodules.cache.config.DomElementStub

Copyright © 2018 www.massapicom. 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.