Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 82   Methods: 6
NCLOC: 53   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ArrayTest.java - 95.5% 83.3% 92.9%
coverage coverage
 1    /*
 2    * JBoss, Home of Professional Open Source
 3    *
 4    * Distributable under LGPL license.
 5    * See terms of license at gnu.org.
 6    */
 7   
 8    package org.jboss.cache.pojo;
 9   
 10    import junit.framework.Test;
 11    import junit.framework.TestCase;
 12    import junit.framework.TestSuite;
 13    import org.apache.commons.logging.Log;
 14    import org.apache.commons.logging.LogFactory;
 15    import org.jboss.cache.pojo.test.ArrayObject;
 16    import org.jboss.cache.pojo.test.Person;
 17   
 18    /**
 19    * Basic PojoCache test case.
 20    *
 21    * @author Ben Wang
 22    */
 23   
 24    public class ArrayTest extends TestCase
 25    {
 26    Log log = LogFactory.getLog(ArrayTest.class);
 27    PojoCache cache_;
 28   
 29  1 public ArrayTest(String name)
 30    {
 31  1 super(name);
 32    }
 33   
 34  1 protected void setUp() throws Exception
 35    {
 36  1 super.setUp();
 37  1 log.info("setUp() ....");
 38  1 String configFile = "META-INF/local-service.xml";
 39  1 boolean toStart = false;
 40  1 cache_ = PojoCacheFactory.createCache(configFile, toStart);
 41  1 cache_.start();
 42    }
 43   
 44  1 protected void tearDown() throws Exception
 45    {
 46  1 super.tearDown();
 47  1 cache_.stop();
 48    }
 49   
 50  1 public void testSimple() throws Exception
 51    {
 52  1 log.info("testSimple() ....");
 53  1 ArrayObject ao = new ArrayObject();
 54  1 Person joe = new Person();
 55  1 joe.setName("Joe");
 56  1 joe.setAge(19);
 57   
 58  1 Person ben = new Person();
 59  1 ben.setName("Ben");
 60  1 ben.setAge(19);
 61   
 62  1 ao.setPerson(0, joe);
 63   
 64  1 cache_.attach("ao", ao);
 65   
 66    // TODO This should trigger a write on team but instead it does a read only. Why?
 67  1 ao.setPerson(1, ben);
 68   
 69    }
 70   
 71  1 public static Test suite() throws Exception
 72    {
 73  1 return new TestSuite(ArrayTest.class);
 74    }
 75   
 76   
 77  0 public static void main(String[] args) throws Exception
 78    {
 79  0 junit.textui.TestRunner.run(ArrayTest.suite());
 80    }
 81   
 82    }