This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 3.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 7a27a29fe884ea1ccae79022f95c0bcbf88f8cda
Author: Colm O hEigeartaigh <[email protected]>
AuthorDate: Tue Sep 27 16:14:36 2022 +0100

    Revert "Fix ws-discovery-api test on MacOS on M1"
    
    This reverts commit 6b7c35a538d3e15ea7ce2bf8b623105801ae9ba4.
---
 .../java/org/apache/cxf/ws/discovery/WSDiscoveryClientTest.java   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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 836f72bc7c..b8a313802c 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
@@ -85,6 +85,7 @@ public final class WSDiscoveryClientTest {
             System.out.println("Skipping MultiResponse test for REL");
             return;
         }
+
         Enumeration<NetworkInterface> interfaces = 
NetworkInterface.getNetworkInterfaces();
         int count = 0;
         if (interfaces != null) {
@@ -108,10 +109,8 @@ public final class WSDiscoveryClientTest {
                     //fake a discovery server to send back some canned 
messages.
                     InetAddress address = 
InetAddress.getByName("239.255.255.250");
                     MulticastSocket s = new 
MulticastSocket(Integer.parseInt(PORT));
-                    if (!"Mac OS 
X".equals(System.getProperties().getProperty("os.name"))) {
-                        s.setNetworkInterface(findIpv4Interface());
-                    }
                     s.setBroadcast(true);
+                    s.setNetworkInterface(findIpv4Interface());
                     s.setLoopbackMode(false);
                     s.setReuseAddress(true);
                     s.joinGroup(address);
@@ -122,7 +121,8 @@ public final class WSDiscoveryClientTest {
                     s.receive(p);
                     SocketAddress sa = p.getSocketAddress();
                     String incoming = new String(p.getData(), 0, 
p.getLength(), StandardCharsets.UTF_8);
-                    int idx = incoming.indexOf('>', 
incoming.indexOf("MessageID"));
+                    int idx = incoming.indexOf("MessageID");
+                    idx = incoming.indexOf('>', idx);
                     incoming = incoming.substring(idx + 1);
                     idx = incoming.indexOf("</");
                     incoming = incoming.substring(0, idx);

Reply via email to