Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes c729193dd -> 9a8a73d6a
  refs/heads/master 635578a9d -> 08e02bf2a


Skip the UDP test for REL


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/9a8a73d6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/9a8a73d6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/9a8a73d6

Branch: refs/heads/2.7.x-fixes
Commit: 9a8a73d6aadf05f2be44841c06701807e6283911
Parents: c729193
Author: Willem Jiang <[email protected]>
Authored: Tue Mar 11 09:56:01 2014 +0800
Committer: Willem Jiang <[email protected]>
Committed: Tue Mar 11 09:56:01 2014 +0800

----------------------------------------------------------------------
 .../cxf/ws/discovery/WSDiscoveryClientTest.java | 24 ++++++++++++++++++++
 1 file changed, 24 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/9a8a73d6/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
----------------------------------------------------------------------
diff --git 
a/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
 
b/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
index b0f2b71..f404dbe 100644
--- 
a/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
+++ 
b/services/ws-discovery/ws-discovery-api/src/test/java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java
@@ -23,7 +23,9 @@ import java.io.InputStream;
 import java.net.DatagramPacket;
 import java.net.InetAddress;
 import java.net.MulticastSocket;
+import java.net.NetworkInterface;
 import java.net.SocketAddress;
+import java.util.Enumeration;
 
 import javax.jws.WebMethod;
 import javax.jws.WebService;
@@ -56,6 +58,28 @@ public final class WSDiscoveryClientTest {
     
     @Test
     public void testMultiResponses() throws Exception {
+        // Disable the test on Redhat Enterprise Linux which doesn't enable 
the UDP broadcast by default
+        if (System.getProperties().getProperty("os.name").equals("Linux") 
+            && System.getProperties().getProperty("os.version").indexOf("el") 
> 0) {
+            System.out.println("Skipping MultiResponse test for REL");
+            return;
+        }
+        
+        Enumeration<NetworkInterface> interfaces = 
NetworkInterface.getNetworkInterfaces();
+        int count = 0;
+        while (interfaces.hasMoreElements()) {
+            NetworkInterface networkInterface = interfaces.nextElement();
+            if (!networkInterface.isUp() || networkInterface.isLoopback()) {
+                continue;  
+            }
+            count++;
+        }
+        if (count == 0) {
+            //no non-loopbacks, cannot do broadcasts
+            System.out.println("Skipping MultiResponse test");
+            return;
+        }
+        
         new Thread(new Runnable() {
             public void run() {
                 try {

Reply via email to