[jbosscache-commits] JBoss Cache SVN: r7320 - in core/trunk/src/test/java/org/jboss/cache/jmx: deprecated and 1 other directory.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Fri Dec 12 19:54:00 EST 2008
Author: mircea.markus
Date: 2008-12-12 19:54:00 -0500 (Fri, 12 Dec 2008)
New Revision: 7320
Modified:
core/trunk/src/test/java/org/jboss/cache/jmx/JmxRegistrationManagerTest.java
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/CacheJmxWrapperTest.java
core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/NotificationTest.java
Log:
deprecated tests don't only create local cache instaces now
Modified: core/trunk/src/test/java/org/jboss/cache/jmx/JmxRegistrationManagerTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/jmx/JmxRegistrationManagerTest.java 2008-12-12 23:59:35 UTC (rev 7319)
+++ core/trunk/src/test/java/org/jboss/cache/jmx/JmxRegistrationManagerTest.java 2008-12-13 00:54:00 UTC (rev 7320)
@@ -21,9 +21,7 @@
*/
package org.jboss.cache.jmx;
-import org.testng.annotations.Test;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.AfterMethod;
+import org.testng.annotations.*;
import org.jboss.cache.factories.UnitTestCacheConfigurationFactory;
import org.jboss.cache.config.Configuration;
import org.jboss.cache.DefaultCacheFactory;
Modified: core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/CacheJmxWrapperTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/CacheJmxWrapperTest.java 2008-12-12 23:59:35 UTC (rev 7319)
+++ core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/CacheJmxWrapperTest.java 2008-12-13 00:54:00 UTC (rev 7320)
@@ -234,15 +234,7 @@
printLockInfoTest(true);
}
- public void testGetLocalAddress() throws Exception
- {
- Configuration c = createConfiguration();
- c.setCacheMode(CacheMode.REPL_ASYNC);
- CacheJmxWrapperMBean<String, String> wrapper = registerWrapper(c);
- wrapper.start();
- assertTrue("Got an IpAddress", wrapper.getLocalAddress() instanceof IpAddress);
- }
-
+ @Test
public void testGetMembers() throws Exception
{
Configuration c = createConfiguration();
@@ -252,31 +244,13 @@
new UnitTestCacheFactory<String, String>().mangleConfiguration(c);
CacheJmxWrapperMBean<String, String> wrapper = registerWrapper(c);
wrapper.start();
-
- c = createConfiguration();
- c.setCacheMode(CacheMode.REPL_ASYNC);
- Cache cache2 = null;
- try
- {
- cache2 = createCache(c);
- cache2.start();
- Cache[] caches = new Cache[]{wrapper.getCache(), cache2};
- TestingUtil.blockUntilViewsReceived(caches, 5000);
-
- Address addr = wrapper.getLocalAddress();
- assertNotNull("Got an Address", addr);
- List members = wrapper.getMembers();
- assertNotNull("Got members", addr);
- assertEquals("Got correct number of members", 2, members.size());
- assertTrue("I am a member", members.contains(addr));
- }
- finally
- {
- if (cache2 != null)
- {
- cache2.destroy();
- }
- }
+ Address addr = wrapper.getLocalAddress();
+ assertNotNull("Got an Address", addr);
+ List members = wrapper.getMembers();
+ assertNotNull("Got members", addr);
+ assertEquals("Got correct number of members", 1, members.size());
+ assertTrue("Got an IpAddress", wrapper.getLocalAddress() instanceof IpAddress);
+ assertTrue("I am a member", members.contains(addr));
}
public void testDuplicateInvocation() throws Exception
@@ -373,7 +347,6 @@
String details = html ? wrapper.printCacheDetailsAsHtml() : wrapper.printCacheDetails();
-
assertTrue("Details include testing", details.contains("testing"));
assertTrue("Details include jmx", details.contains("jmx"));
assertTrue("Details include foobar", details.contains("foobar"));
Modified: core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/NotificationTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/NotificationTest.java 2008-12-12 23:59:35 UTC (rev 7319)
+++ core/trunk/src/test/java/org/jboss/cache/jmx/deprecated/NotificationTest.java 2008-12-13 00:54:00 UTC (rev 7320)
@@ -184,7 +184,6 @@
assertTrue("Expected NodePassivated notification", events.contains(Type.POSTPASSIVATE));
assertTrue("Expected NodeRemoved notification", events.contains(Type.PREREMOVE));
assertTrue("Expected NodeRemoved notification", events.contains(Type.POSTREMOVE));
- assertTrue("Expected ViewChange notification", events.contains(Type.VIEWCHANGE));
validateHealthyListener(listener);
}
@@ -280,6 +279,7 @@
private CacheSPI<Object, Object> createCache(String clusterName) throws Exception
{
Configuration config = createConfiguration(clusterName);
+ config.setCacheMode(CacheMode.LOCAL);
UnitTestCacheFactory<Object, Object> factory = new UnitTestCacheFactory<Object, Object>();
CacheSPI<Object, Object> cache = (CacheSPI<Object, Object>) factory.createCache(config, false, getClass());
More information about the jbosscache-commits
mailing list