Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 82   Methods: 6
NCLOC: 44   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ReplicatedObjectTest.java - 92.9% 83.3% 90%
coverage coverage
 1    /*
 2    * JBoss, Home of Professional Open Source
 3    * Copyright 2005, JBoss Inc., and individual contributors as indicated
 4    * by the @authors tag. See the copyright.txt in the distribution for a
 5    * full listing of individual contributors.
 6    *
 7    * This is free software; you can redistribute it and/or modify it
 8    * under the terms of the GNU Lesser General Public License as
 9    * published by the Free Software Foundation; either version 2.1 of
 10    * the License, or (at your option) any later version.
 11    *
 12    * This software is distributed in the hope that it will be useful,
 13    * but WITHOUT ANY WARRANTY; without even the implied warranty of
 14    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 15    * Lesser General Public License for more details.
 16    *
 17    * You should have received a copy of the GNU Lesser General Public
 18    * License along with this software; if not, write to the Free
 19    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 20    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 21    */
 22    package org.jboss.cache.pojo.notification;
 23   
 24    import junit.framework.Test;
 25    import junit.framework.TestSuite;
 26   
 27    import org.jboss.cache.config.Configuration.CacheMode;
 28    import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
 29    import org.jboss.cache.pojo.PojoCache;
 30    import org.jboss.cache.pojo.PojoCacheFactory;
 31    import org.jboss.cache.pojo.notification.event.Event;
 32   
 33    //$Id: ReplicatedObjectTest.java,v 1.2 2007/06/29 04:34:01 jgreene Exp $
 34   
 35    /**
 36    * Tests replicated set notifications
 37    *
 38    * @author Jason T. Greene
 39    */
 40    public class ReplicatedObjectTest extends ListTest
 41    {
 42    private PojoCache listenerCache;
 43   
 44  4 public ReplicatedObjectTest(String name)
 45    {
 46  4 super(name);
 47    }
 48   
 49  4 protected void setUp() throws Exception
 50    {
 51  4 super.setUp();
 52   
 53  4 cache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
 54  4 cache.start();
 55  4 listenerCache = PojoCacheFactory.createCache(UnitTestCacheConfigurationFactory.createConfiguration(CacheMode.REPL_SYNC), false);
 56  4 listenerCache.start();
 57  4 listenerCache.addListener(listener);
 58    }
 59   
 60  4 protected void tearDown() throws Exception
 61    {
 62  4 super.tearDown();
 63  4 cache.stop();
 64  4 listenerCache.stop();
 65    }
 66   
 67  24 protected void verifyNotification(Event notification)
 68    {
 69  24 assertSame(listenerCache, notification.getContext().getPojoCache());
 70  24 assertEquals(false, notification.isLocal());
 71    }
 72   
 73  1 public static Test suite() throws Exception
 74    {
 75  1 return new TestSuite(ReplicatedObjectTest.class);
 76    }
 77   
 78  0 public static void main(String[] args) throws Exception
 79    {
 80  0 junit.textui.TestRunner.run(ReplicatedObjectTest.suite());
 81    }
 82    }