[jbosscache-commits] JBoss Cache SVN: r4862 - core/trunk/src/test/java/org/jboss/cache/buddyreplication.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Fri Dec 14 11:56:28 EST 2007


Author: mircea.markus
Date: 2007-12-14 11:56:28 -0500 (Fri, 14 Dec 2007)
New Revision: 4862

Added:
   core/trunk/src/test/java/org/jboss/cache/buddyreplication/RemoveRootBuddyTest.java
Log:
added tests to reproduce an issues.

Added: core/trunk/src/test/java/org/jboss/cache/buddyreplication/RemoveRootBuddyTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/RemoveRootBuddyTest.java	                        (rev 0)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/RemoveRootBuddyTest.java	2007-12-14 16:56:28 UTC (rev 4862)
@@ -0,0 +1,42 @@
+package org.jboss.cache.buddyreplication;
+
+import org.jboss.cache.CacheImpl;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.CacheException;
+import org.testng.annotations.Test;
+
+import java.util.ArrayList;
+
+/**
+ * Test added to replicate a found issue. When fixing it consider moving test to some other class.
+ *
+ * @author Mircea.Markus at jboss.com
+ * @since 2.1
+ */
+ at Test(groups = {"functional"})
+public class RemoveRootBuddyTest extends BuddyReplicationTestsBase
+{
+   public void testRemoveRootNode() throws Exception
+   {
+      CacheImpl cache1 = createCache(false, 1, "myBuddyPoolReplicationGroup", false, true, true);
+      CacheImpl cache2 = createCache(false, 1, "myBuddyPoolReplicationGroup", false, true, true);
+      caches = new ArrayList<CacheImpl<Object, Object>>(2);
+      caches.add(cache1);
+      caches.add(cache2);
+      int opCount = 10;
+      for (int i = 0; i < opCount; i++)
+      {
+         String key = String.valueOf(opCount);
+         String value = String.valueOf(opCount);
+         Fqn f = new Fqn("test", key);
+         cache1.put(f, key, value);
+      }
+      try
+      {
+         cache1.remove(Fqn.ROOT);
+      } catch (CacheException e)
+      {
+         e.printStackTrace();
+      }
+   }
+}




More information about the jbosscache-commits mailing list