Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 90   Methods: 7
NCLOC: 65   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
RecursiveRefTest.java - 100% 85.7% 97.1%
coverage coverage
 1    package org.jboss.cache.pojo;
 2   
 3    import junit.framework.TestCase;
 4    import org.apache.commons.logging.Log;
 5    import org.apache.commons.logging.LogFactory;
 6    import org.jboss.cache.pojo.test.IdObject;
 7    import org.jboss.cache.pojo.test.ValueObject;
 8   
 9    import java.util.ArrayList;
 10    import java.util.HashMap;
 11    import java.util.HashSet;
 12    import java.util.Map;
 13   
 14    public class RecursiveRefTest extends TestCase
 15    {
 16    private static final String CONFIG_FILENAME = "META-INF/local-service.xml";
 17    private PojoCache cache;
 18    Log log = LogFactory.getLog(RecursiveRefTest.class);
 19   
 20    private Map cachedMap;
 21   
 22  3 public RecursiveRefTest(String name)
 23    {
 24  3 super(name);
 25    }
 26   
 27  3 protected void setUp() throws Exception
 28    {
 29  3 super.setUp();
 30  3 log.info("setUp() ....");
 31  3 boolean toStart = false;
 32  3 cache = PojoCacheFactory.createCache(CONFIG_FILENAME, toStart);
 33  3 cache.start();
 34  3 cache.attach("/aop/test", new HashMap());
 35  3 cachedMap = (Map) cache.find("/aop/test");
 36    }
 37   
 38  3 protected void tearDown() throws Exception
 39    {
 40  3 super.tearDown();
 41    }
 42   
 43  0 public void XtestDummy()
 44    {
 45   
 46    }
 47    //
 48    // This is a bogus test. A key must be serializable since it part of an FQN.
 49    // Also it shouldn't be mutable.
 50    //
 51    // public void testRecuriveMapKey()
 52    // {
 53    // IdObject id = new IdObject("1");
 54    // ValueObject value = new ValueObject(id, 3.0f);
 55    // cachedMap.put(id, value);
 56    // }
 57   
 58  1 public void testRecursiveList() throws Exception
 59    {
 60  1 ArrayList list = new ArrayList();
 61  1 list.add("1");
 62  1 cache.attach("list", list);
 63  1 list = (ArrayList) cache.find("list");
 64  1 list.add(list);
 65  1 System.out.println(list.toString());
 66    }
 67   
 68  1 public void testRecursiveSet() throws Exception
 69    {
 70  1 HashSet set = new HashSet();
 71  1 set.add("1");
 72  1 cache.attach("set", set);
 73  1 set = (HashSet) cache.find("set");
 74  1 set.add(set);
 75  1 System.out.println(set.toString());
 76    }
 77   
 78  1 public void testRecursiveMap() throws Exception
 79    {
 80  1 HashMap map = new HashMap();
 81  1 map.put("1", "1");
 82  1 cache.attach("map", map);
 83  1 map = (HashMap) cache.find("map");
 84  1 map.put("2", map);
 85  1 System.out.println(map.toString());
 86    }
 87   
 88    } // class TestRunner
 89   
 90