Author: ron.sigal(a)jboss.com
Date: 2008-04-24 04:08:02 -0400 (Thu, 24 Apr 2008)
New Revision: 4061
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/ipv6/ObjectNameWithIPv6AddressTestCase.java
Log:
JBREM-930: Skips tests if IPv6 is unavailable.
Modified:
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/ipv6/ObjectNameWithIPv6AddressTestCase.java
===================================================================
---
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/ipv6/ObjectNameWithIPv6AddressTestCase.java 2008-04-24
07:59:35 UTC (rev 4060)
+++
remoting2/branches/2.x/src/tests/org/jboss/test/remoting/ipv6/ObjectNameWithIPv6AddressTestCase.java 2008-04-24
08:08:02 UTC (rev 4061)
@@ -22,6 +22,7 @@
package org.jboss.test.remoting.ipv6;
import java.net.InetAddress;
+import java.net.ServerSocket;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;
@@ -59,6 +60,7 @@
private static Logger log =
Logger.getLogger(ObjectNameWithIPv6AddressTestCase.class);
private static boolean firstTime = true;
+ private static boolean ipv6IsAvailable = true;
protected String host;
protected int port;
@@ -80,6 +82,21 @@
ConsoleAppender consoleAppender = new ConsoleAppender(layout);
Logger.getRootLogger().addAppender(consoleAppender);
log.info("java.version: " +
System.getProperty("java.version"));
+
+ try
+ {
+ InetAddress addr = InetAddress.getByName("[::1]");
+ new ServerSocket(3333, 200, addr);
+ }
+ catch (Exception e)
+ {
+ if ("Protocol family unavailable".equalsIgnoreCase(e.getMessage())
||
+ "Protocol family not
supported".equalsIgnoreCase(e.getMessage()))
+ {
+ ipv6IsAvailable = false;
+ log.info("ipV6 is not available");
+ }
+ }
}
}
@@ -115,6 +132,8 @@
protected void doTest(String host) throws Throwable
{
+ if (!ipv6IsAvailable) return;
+
MBeanServer server = null;
try
{
Show replies by date