cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [2/2] git commit: Skip the UDP test for REL
Date Tue, 11 Mar 2014 01:57:27 GMT
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/08e02bf2
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/08e02bf2
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/08e02bf2

Branch: refs/heads/master
Commit: 08e02bf2a0731d8460137f636426feb2025bfb2d
Parents: 635578a
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Tue Mar 11 09:56:01 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Tue Mar 11 09:56:47 2014 +0800

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


http://git-wip-us.apache.org/repos/asf/cxf/blob/08e02bf2/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 {


Mime
View raw message