Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 81   Methods: 7
NCLOC: 60   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
NonAspectizedTest.java - 96.3% 85.7% 94.1%
coverage coverage
 1    package org.jboss.cache.pojo;
 2   
 3    import junit.framework.Test;
 4    import junit.framework.TestCase;
 5    import junit.framework.TestSuite;
 6    import org.apache.commons.logging.Log;
 7    import org.apache.commons.logging.LogFactory;
 8    import org.jboss.cache.pojo.test.SerializedAddress;
 9   
 10   
 11    /**
 12    * Test for Serializable POJOs
 13    *
 14    * @author Ben Wang
 15    */
 16   
 17    public class NonAspectizedTest extends TestCase
 18    {
 19    Log log_ = LogFactory.getLog(NonAspectizedTest.class);
 20    PojoCache cache_;
 21   
 22  2 public NonAspectizedTest(String name)
 23    {
 24  2 super(name);
 25    }
 26   
 27  2 protected void setUp() throws Exception
 28    {
 29  2 super.setUp();
 30  2 log_.info("setUp() ....");
 31  2 String configFile = "META-INF/local-service.xml";
 32  2 boolean toStart = false;
 33  2 cache_ = PojoCacheFactory.createCache(configFile, toStart);
 34  2 cache_.start();
 35    }
 36   
 37  2 protected void tearDown() throws Exception
 38    {
 39  2 super.tearDown();
 40  2 cache_.stop();
 41    }
 42   
 43    // public void testDummy() {}
 44   
 45  1 public void testPutPrimitive() throws Exception
 46    {
 47  1 log_.info("testPutPrimitive() ....");
 48  1 String test = "test";
 49  1 cache_.attach("/a", test);
 50  1 String result = (String) cache_.find("/a");
 51  1 assertEquals("test string ", "test", result);
 52  1 cache_.detach("/a");
 53  1 assertNull("Object should be null ", cache_.find("/a"));
 54    }
 55   
 56  1 public void testPutSerializable() throws Exception
 57    {
 58  1 log_.info("testPutSerializable() ....");
 59  1 SerializedAddress test = new SerializedAddress();
 60  1 test.setCity("Sunnyvale");
 61  1 test.setZip(94086);
 62  1 cache_.attach("/a", test);
 63  1 SerializedAddress result = (SerializedAddress) cache_.find("/a");
 64  1 assertEquals("test SerializedAddress ", test, result);
 65  1 cache_.detach("/a");
 66  1 assertNull("Object should be null ", cache_.find("/a"));
 67    }
 68   
 69  1 public static Test suite() throws Exception
 70    {
 71  1 return new TestSuite(NonAspectizedTest.class);
 72    }
 73   
 74   
 75  0 public static void main(String[] args) throws Exception
 76    {
 77  0 junit.textui.TestRunner.run(suite());
 78    }
 79   
 80    }
 81