Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 65   Methods: 5
NCLOC: 43   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
NotificationTest.java 100% 92.3% 80% 90%
coverage coverage
 1    package org.jboss.cache.pojo.jmx;
 2   
 3    import javax.management.ObjectName;
 4   
 5    import org.jboss.cache.CacheImpl;
 6    import org.jboss.cache.config.Configuration;
 7    import org.jboss.cache.pojo.PojoCache;
 8    import org.jboss.cache.pojo.PojoCacheFactory;
 9    import org.jboss.cache.pojo.impl.PojoCacheImpl;
 10   
 11    /**
 12    * Functional tests for CacheJmxWrapper broadcast of cache event notifications
 13    *
 14    * @author Jerry Gauthier
 15    * @version $Id: NotificationTest.java,v 1.1 2007/06/04 22:56:05 bstansberry Exp $
 16    */
 17    public class NotificationTest extends org.jboss.cache.jmx.NotificationTest
 18    {
 19    private PojoCache pojoCache;
 20   
 21   
 22   
 23  8 @Override
 24    protected Object createCacheAndJmxWrapper() throws Exception
 25    {
 26  8 pojoCache = createCache(CLUSTER_NAME);
 27  8 cache = (CacheImpl) pojoCache.getCache();
 28  8 return new PojoCacheJmxWrapper(pojoCache);
 29    }
 30   
 31  10 @Override
 32    protected void destroyCache()
 33    {
 34  10 if (pojoCache != null)
 35    {
 36    // stop the cache before the listener is unregistered
 37    //cache1.stop();
 38  8 pojoCache.destroy();
 39  8 pojoCache = null;
 40  8 cache = null;
 41    }
 42    }
 43   
 44  26 protected ObjectName getWrapperObjectName() throws Exception
 45    {
 46  26 return new ObjectName(JmxUtil.PREFIX + CLUSTER_NAME);
 47    }
 48   
 49  8 protected PojoCacheImpl createCache(String clusterName) throws Exception
 50    {
 51  8 Configuration config = createConfiguration(clusterName);
 52   
 53  8 PojoCacheImpl cache = (PojoCacheImpl) PojoCacheFactory.createCache(config, false);
 54   
 55  8 cache.create();
 56    // start the cache after the listener has been registered
 57    //cache.start();
 58  8 return cache;
 59    }
 60   
 61  0 private String getTempDir()
 62    {
 63  0 return System.getProperty("java.io.tempdir", "/tmp");
 64    }
 65    }