Clover coverage report -
Coverage timestamp: Wed Jan 31 2007 15:38:53 EST
file stats: LOC: 63   Methods: 6
NCLOC: 45   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
TreeNodeTest.java - 94.7% 83.3% 92%
coverage coverage
 1    package org.jboss.cache;
 2   
 3    import junit.framework.Test;
 4    import junit.framework.TestCase;
 5    import junit.framework.TestSuite;
 6   
 7    /**
 8    * Tests restart (stop-destroy-create-start) of CacheImpl
 9    *
 10    * @author Bela Ban
 11    * @version $Id: TreeNodeTest.java,v 1.6 2007/01/11 13:49:06 msurtani Exp $
 12    */
 13    public class TreeNodeTest extends TestCase
 14    {
 15    CacheImpl cache;
 16   
 17  1 protected void setUp() throws Exception
 18    {
 19  1 super.setUp();
 20  1 cache = (CacheImpl) DefaultCacheFactory.getInstance().createCache();
 21    }
 22   
 23  1 protected void tearDown() throws Exception
 24    {
 25  1 super.tearDown();
 26  1 stopCache(cache);
 27    }
 28   
 29  1 public void testChildExist() throws Exception
 30    {
 31  1 Object key = 1;
 32  1 cache.put("/a/b/c", key, "test");
 33  1 Node node;
 34  1 node = cache.get("/a/b");
 35  1 assertFalse(node.getChildren().isEmpty());
 36  1 assertTrue(node.getChild(new Fqn("c")) != null);
 37   
 38  1 Fqn fqn = Fqn.fromString("/e/f");
 39  1 cache.put(fqn, "1", "1");
 40  1 node = cache.get("/e");
 41  1 assertFalse(node.getChildren().isEmpty());
 42  1 assertTrue(node.getChild(new Fqn("f")) != null);
 43   
 44    }
 45   
 46   
 47  1 void stopCache(CacheImpl c)
 48    {
 49  1 c.stop();
 50  1 c.destroy();
 51    }
 52   
 53  1 public static Test suite()
 54    {
 55  1 return new TestSuite(TreeNodeTest.class);
 56    }
 57   
 58  0 public static void main(String[] args)
 59    {
 60  0 junit.textui.TestRunner.run(suite());
 61    }
 62   
 63    }