[jbosscache-commits] JBoss Cache SVN: r4600 - in core/trunk/src: main/java/org/jboss/cache/config and 1 other directories.

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Thu Oct 11 09:40:52 EDT 2007


Author: manik.surtani at jboss.com
Date: 2007-10-11 09:40:52 -0400 (Thu, 11 Oct 2007)
New Revision: 4600

Modified:
   core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
   core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
   core/trunk/src/test/java/org/jboss/cache/replicated/ExceptionTest.java
Log:
Added a delay to the test so that the SyncReplTimeout is guaranteed to be hit

Modified: core/trunk/src/main/java/org/jboss/cache/CacheImpl.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/CacheImpl.java	2007-10-11 12:58:59 UTC (rev 4599)
+++ core/trunk/src/main/java/org/jboss/cache/CacheImpl.java	2007-10-11 13:40:52 UTC (rev 4600)
@@ -4138,27 +4138,6 @@
       return marshaller_;
    }
 
-   /**
-    * Returns the default JGroup properties.
-    * Subclasses may wish to override this method.
-    */
-   protected String getDefaultProperties()
-   {
-      return "UDP(mcast_addr=224.0.0.36;mcast_port=55566;ip_ttl=32;" +
-              "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" +
-              "PING(timeout=1000;num_initial_members=2):" +
-              "MERGE2(min_interval=5000;max_interval=10000):" +
-              "FD_SOCK:" +
-              "VERIFY_SUSPECT(timeout=1500):" +
-              "pbcast.NAKACK(gc_lag=50;retransmit_timeout=600,1200,2400,4800):" +
-              "UNICAST(timeout=600,1200,2400,4800):" +
-              "pbcast.STABLE(desired_avg_gossip=20000):" +
-              "FRAG(frag_size=8192):" +
-              "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;" +
-              "shun=false;print_local_addr=true):" +
-              "pbcast.STATE_TRANSFER";
-   }
-
    private void initialiseCacheLoaderManager() throws CacheException
    {
       if (cacheLoaderManager == null)
@@ -4225,7 +4204,7 @@
             if (configuration.getClusterConfig() == null)
             {
                log.debug("setting cluster properties to default value");
-               configuration.setClusterConfig(getDefaultProperties());
+               configuration.setClusterConfig(configuration.getDefaultClusterConfig());
             }
             try
             {

Modified: core/trunk/src/main/java/org/jboss/cache/config/Configuration.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/config/Configuration.java	2007-10-11 12:58:59 UTC (rev 4599)
+++ core/trunk/src/main/java/org/jboss/cache/config/Configuration.java	2007-10-11 13:40:52 UTC (rev 4600)
@@ -628,6 +628,27 @@
       this.numberOfNotifierThreads = numberOfNotifierThreads;
    }
 
+   /**
+    * Returns the default JGroup properties.
+    */
+   public String getDefaultClusterConfig()
+   {
+      return "UDP(mcast_addr=224.0.0.36;mcast_port=55566;ip_ttl=32;" +
+              "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" +
+              "PING(timeout=1000;num_initial_members=2):" +
+              "MERGE2(min_interval=5000;max_interval=10000):" +
+              "FD_SOCK:" +
+              "VERIFY_SUSPECT(timeout=1500):" +
+              "pbcast.NAKACK(gc_lag=50;retransmit_timeout=600,1200,2400,4800):" +
+              "UNICAST(timeout=600,1200,2400,4800):" +
+              "pbcast.STABLE(desired_avg_gossip=20000):" +
+              "FRAG(frag_size=8192):" +
+              "pbcast.GMS(join_timeout=5000;join_retry_timeout=2000;" +
+              "shun=false;print_local_addr=true):" +
+              "pbcast.STATE_TRANSFER";
+   }
+
+
    // ------------------------------------------------------------------------------------------------------------
    //   HELPERS
    // ------------------------------------------------------------------------------------------------------------

Modified: core/trunk/src/test/java/org/jboss/cache/replicated/ExceptionTest.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/replicated/ExceptionTest.java	2007-10-11 12:58:59 UTC (rev 4599)
+++ core/trunk/src/test/java/org/jboss/cache/replicated/ExceptionTest.java	2007-10-11 13:40:52 UTC (rev 4600)
@@ -1,6 +1,7 @@
 package org.jboss.cache.replicated;
 
 import org.jboss.cache.Cache;
+import org.jboss.cache.CacheImpl;
 import org.jboss.cache.DefaultCacheFactory;
 import org.jboss.cache.Fqn;
 import org.jboss.cache.ReplicationException;
@@ -58,10 +59,19 @@
       cache1.getConfiguration().setSyncReplTimeout(1); // 1ms.  this is *bound* to fail.
       cache2.getConfiguration().setSyncReplTimeout(1);
 
+      String jgroupsCfg = cache1.getConfiguration().getDefaultClusterConfig();
+      String delay = ":DELAY(in_delay=100;out_delay=100)";
+      String newCfg = jgroupsCfg.substring(0, jgroupsCfg.indexOf(":")) + delay + jgroupsCfg.substring(jgroupsCfg.indexOf(":"));
+
+      System.out.println("JG " + jgroupsCfg);System.out.println("NEW: " + newCfg);
+
+      cache1.getConfiguration().setClusterConfig(newCfg);
+      cache2.getConfiguration().setClusterConfig(newCfg);
+
       cache1.start();
       cache2.start();
 
-      TestingUtil.blockUntilViewsReceived(10000, cache1, cache2);
+      TestingUtil.blockUntilViewsReceived(60000, cache1, cache2);
 
       cache1.put(fqn, "k", "v");
    }




More information about the jbosscache-commits mailing list