[jbosscache-commits] JBoss Cache SVN: r4753 - in core/trunk/src: main/java/org/jboss/cache/buddyreplication and 1 other directories.
jbosscache-commits at lists.jboss.org
jbosscache-commits at lists.jboss.org
Wed Nov 14 07:00:03 EST 2007
Author: mircea.markus
Date: 2007-11-14 07:00:03 -0500 (Wed, 14 Nov 2007)
New Revision: 4753
Modified:
core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyGroupAssignmentTest.java
Log:
fixed ut, propagate exceptions from remote calls
Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2007-11-14 08:03:53 UTC (rev 4752)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java 2007-11-14 12:00:03 UTC (rev 4753)
@@ -2061,6 +2061,11 @@
}
else
{
+ if (rsp.getValue() instanceof Exception)
+ {
+ if (log.isTraceEnabled()) log.trace("Recieved exception'" + rsp.getValue() + "' from " + rsp.getSender());
+ throw (Exception) rsp.getValue();
+ }
retval.add(rsp.getValue());
}
}
@@ -2869,7 +2874,7 @@
if (method_call.getMethodId() != MethodDeclarations.putForExternalReadMethodLocal_id
|| method_call.getMethodId() != MethodDeclarations.putForExternalReadVersionedMethodLocal_id )
{
- if (log.isWarnEnabled()) log.warn("replication failure with method_call " + method_call + " exception", ex);
+ if (!MethodDeclarations.isBuddyGroupOrganisationMethod(method_call.getMethodId()) && log.isWarnEnabled()) log.warn("replication failure with method_call " + method_call + " exception", ex);
throw ex;
}
else return null;
Modified: core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2007-11-14 08:03:53 UTC (rev 4752)
+++ core/trunk/src/main/java/org/jboss/cache/buddyreplication/BuddyManager.java 2007-11-14 12:00:03 UTC (rev 4753)
@@ -113,7 +113,7 @@
/**
* number of times to retry communicating with a selected buddy if the buddy has not been initialised.
*/
- private static int UNINIT_BUDDIES_RETRIES = 5;
+ private final static int UNINIT_BUDDIES_RETRIES = 5;
/**
* wait time between retries
*/
@@ -474,7 +474,10 @@
try
{
if (!initialisationLatch.await(0, TimeUnit.NANOSECONDS))
+ {
+ if (log.isDebugEnabled()) log.debug("Local buddy mamanger not initialized, rejecting assign call " + newGroup);
throw new BuddyNotInitException("Not yet initialised");
+ }
}
catch (InterruptedException e)
{
Modified: core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyGroupAssignmentTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyGroupAssignmentTest.java 2007-11-14 08:03:53 UTC (rev 4752)
+++ core/trunk/src/test/java/org/jboss/cache/buddyreplication/BuddyGroupAssignmentTest.java 2007-11-14 12:00:03 UTC (rev 4753)
@@ -11,12 +11,14 @@
import org.jboss.cache.Cache;
import org.jboss.cache.CacheSPI;
import org.jboss.cache.misc.TestingUtil;
+import org.testng.annotations.Test;
/**
* Tests how groups are formed and disbanded
*
* @author <a href="mailto:manik at jboss.org">Manik Surtani (manik at jboss.org)</a>
*/
+ at Test(groups = {"functional", "jgroups"})
public class BuddyGroupAssignmentTest extends BuddyReplicationTestsBase
{
private Log log = LogFactory.getLog(BuddyGroupAssignmentTest.class);
More information about the jbosscache-commits
mailing list