[jboss-cvs] JBossCache/tests/functional/org/jboss/cache/pojo/jmx ...
Brian Stansberry
brian.stansberry at jboss.com
Mon Jun 4 18:56:06 EDT 2007
User: bstansberry
Date: 07/06/04 18:56:06
Added: tests/functional/org/jboss/cache/pojo/jmx
OptimisticNotificationTest.java
NotificationTest.java
Log:
[JBCACHE-1089] PojoCacheJmxWrapper should implement NotificationEmitter
Revision Changes Path
1.1 date: 2007/06/04 22:56:05; author: bstansberry; state: Exp;JBossCache/tests/functional/org/jboss/cache/pojo/jmx/OptimisticNotificationTest.java
Index: OptimisticNotificationTest.java
===================================================================
/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package org.jboss.cache.pojo.jmx;
/**
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
*/
public class OptimisticNotificationTest extends NotificationTest
{
public OptimisticNotificationTest()
{
optimistic = true;
}
}
1.1 date: 2007/06/04 22:56:05; author: bstansberry; state: Exp;JBossCache/tests/functional/org/jboss/cache/pojo/jmx/NotificationTest.java
Index: NotificationTest.java
===================================================================
package org.jboss.cache.pojo.jmx;
import javax.management.ObjectName;
import org.jboss.cache.CacheImpl;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.pojo.PojoCache;
import org.jboss.cache.pojo.PojoCacheFactory;
import org.jboss.cache.pojo.impl.PojoCacheImpl;
/**
* Functional tests for CacheJmxWrapper broadcast of cache event notifications
*
* @author Jerry Gauthier
* @version $Id: NotificationTest.java,v 1.1 2007/06/04 22:56:05 bstansberry Exp $
*/
public class NotificationTest extends org.jboss.cache.jmx.NotificationTest
{
private PojoCache pojoCache;
@Override
protected Object createCacheAndJmxWrapper() throws Exception
{
pojoCache = createCache(CLUSTER_NAME);
cache = (CacheImpl) pojoCache.getCache();
return new PojoCacheJmxWrapper(pojoCache);
}
@Override
protected void destroyCache()
{
if (pojoCache != null)
{
// stop the cache before the listener is unregistered
//cache1.stop();
pojoCache.destroy();
pojoCache = null;
cache = null;
}
}
protected ObjectName getWrapperObjectName() throws Exception
{
return new ObjectName(JmxUtil.PREFIX + CLUSTER_NAME);
}
protected PojoCacheImpl createCache(String clusterName) throws Exception
{
Configuration config = createConfiguration(clusterName);
PojoCacheImpl cache = (PojoCacheImpl) PojoCacheFactory.createCache(config, false);
cache.create();
// start the cache after the listener has been registered
//cache.start();
return cache;
}
private String getTempDir()
{
return System.getProperty("java.io.tempdir", "/tmp");
}
}
More information about the jboss-cvs-commits
mailing list