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

jbosscache-commits at lists.jboss.org jbosscache-commits at lists.jboss.org
Wed Dec 3 08:36:04 EST 2008


Author: mircea.markus
Date: 2008-12-03 08:36:04 -0500 (Wed, 03 Dec 2008)
New Revision: 7243

Modified:
   core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java
Log:
added some debug code

Modified: core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java
===================================================================
--- core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java	2008-12-02 19:31:53 UTC (rev 7242)
+++ core/trunk/src/test/java/org/jboss/cache/UnitTestCacheFactory.java	2008-12-03 13:36:04 UTC (rev 7243)
@@ -16,11 +16,15 @@
 import org.jboss.cache.util.TestingUtil;
 
 import java.io.InputStream;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicInteger;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import java.net.SocketAddress;
+import java.net.InetSocketAddress;
+import java.net.MulticastSocket;
 
 /**
  * @author <a href="mailto:dpospisi at redhat.com">Dominik Pospisil (dpospisi at redhat.com)</a>
@@ -139,12 +143,7 @@
 //      }
 
       checkCaches();
-      String useIpV4 = System.getProperty("java.net.preferIPv4Stack");
-      if (useIpV4 == null || !useIpV4.equalsIgnoreCase("tRue"))
-      {
-          System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ not using IPv4");
-          log.error("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ not using IPv4");
-      }
+      tryMCastAddress();
 
       switch (configuration.getCacheMode())
       {
@@ -176,6 +175,22 @@
 
    }
 
+   private void tryMCastAddress()
+   {
+      String useIpV4 = System.getProperty("java.net.preferIPv4Stack");
+      log.trace("++++++++++++++++++++++++++++++ useIpV4 property=" + useIpV4);
+      SocketAddress socketAddress = new InetSocketAddress("224.10.10.10", 45588);
+      try
+      {
+         MulticastSocket ms = new MulticastSocket(socketAddress);
+      } catch (IOException e)
+      {
+         System.err.println("+++++++++++++++++++++++++++ Error : " + e.getMessage());
+         log.error("+++++++++++++++++++++++++++ Error : " + e.getMessage());
+         e.printStackTrace();
+      }
+   }
+
    /**
     * Destroys all caches created by this factory in the current thread.
     *




More information about the jbosscache-commits mailing list