Skip to content

Commit

Permalink
Add Windows builds to GA workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
reta committed Jul 5, 2023
1 parent bd9a418 commit f366ebf
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/pull-request-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ permissions:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
permissions:
contents: read
pull-requests: read
Expand All @@ -23,6 +26,6 @@ jobs:
distribution: 'temurin'
cache: maven
- name: Build with Apache Maven
run: mvn -U clean install -Djava.awt.headless=true -fae -B -Peverything
run: mvn -U clean install -fae -B -Peverything
env:
MAVEN_OPTS: "-Xmx1024M"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.atomic.AtomicInteger;

import jakarta.xml.ws.AsyncHandler;
Expand Down Expand Up @@ -183,7 +184,7 @@ public void testTimeoutAsync() throws Exception {
c.getClient().setReceiveTimeout(3000);
try {
Response<GreetMeLaterResponse> future = g.greetMeLaterAsync(-5000L);
future.get();
future.get(30, TimeUnit.SECONDS);
fail();
} catch (Exception ex) {
//expected!!!
Expand All @@ -202,18 +203,18 @@ public void testRetransmitAsync() throws Exception {
GreetMeResponse resp = (GreetMeResponse)g.greetMeAsync(request, new AsyncHandler<GreetMeResponse>() {
public void handleResponse(Response<GreetMeResponse> res) {
try {
res.get().getResponseType();
} catch (InterruptedException | ExecutionException e) {
res.get(30, TimeUnit.SECONDS).getResponseType();
} catch (InterruptedException | TimeoutException | ExecutionException e) {
e.printStackTrace();
}
}
}).get();
}).get(30, TimeUnit.SECONDS);
assertEquals("Hello " + request, resp.getResponseType());

g.greetMeLaterAsync(1000, new AsyncHandler<GreetMeLaterResponse>() {
public void handleResponse(Response<GreetMeLaterResponse> res) {
}
}).get();
}).get(30, TimeUnit.SECONDS);
}

@Test
Expand All @@ -223,7 +224,7 @@ public void testTimeoutAsyncWithPropertySetting() throws Exception {
"3000");
try {
Response<GreetMeLaterResponse> future = g.greetMeLaterAsync(-5000L);
future.get();
future.get(30, TimeUnit.SECONDS);
fail();
} catch (Exception ex) {
//expected!!!
Expand Down Expand Up @@ -279,18 +280,18 @@ public void testCallAsync() throws Exception {
GreetMeResponse resp = (GreetMeResponse)g.greetMeAsync(request, new AsyncHandler<GreetMeResponse>() {
public void handleResponse(Response<GreetMeResponse> res) {
try {
res.get().getResponseType();
} catch (InterruptedException | ExecutionException e) {
res.get(30, TimeUnit.SECONDS).getResponseType();
} catch (InterruptedException | TimeoutException | ExecutionException e) {
e.printStackTrace();
}
}
}).get();
}).get(30, TimeUnit.SECONDS);
assertEquals("Hello " + request, resp.getResponseType());

g.greetMeLaterAsync(1000, new AsyncHandler<GreetMeLaterResponse>() {
public void handleResponse(Response<GreetMeLaterResponse> res) {
}
}).get();
}).get(30, TimeUnit.SECONDS);
}

@Test
Expand All @@ -305,7 +306,7 @@ public void testCallAsyncCallbackInvokedOnlyOnce() throws Exception {
public void handleResponse(Response<GreetMeResponse> res) {
count.incrementAndGet();
}
}).get();
}).get(30, TimeUnit.SECONDS);
} catch (Exception e) {
}
}
Expand Down Expand Up @@ -416,12 +417,12 @@ public void testCallsAsync() throws Exception {
whandler[x] = new AsyncHandler<GreetMeLaterResponse>() {
public void handleResponse(Response<GreetMeLaterResponse> res) {
try {
String s = res.get().getResponseType();
String s = res.get(30, TimeUnit.SECONDS).getResponseType();
s = s.substring(s.lastIndexOf(' ') + 1);
if (c != Integer.parseInt(s)) {
System.out.println("Problem " + c + " != " + s);
}
} catch (InterruptedException | ExecutionException e) {
} catch (InterruptedException | TimeoutException | ExecutionException e) {
e.printStackTrace();
}
wdone[c] = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package org.apache.cxf.ws.discovery;

import static org.junit.Assume.assumeFalse;

import java.io.InputStream;
import java.net.DatagramPacket;
import java.net.InetAddress;
Expand Down Expand Up @@ -80,11 +82,15 @@ static NetworkInterface findIpv4Interface() throws Exception {
return p;
}
}

return possibles.isEmpty() ? null : possibles.get(possibles.size() - 1);
}

@Test
public void testMultiResponses() throws Exception {
assumeFalse("The multicast is disabled on Windows by default",
System.getProperty("os.name").startsWith("Windows"));

// Disable the test on Redhat Enterprise Linux which doesn't enable the UDP broadcast by default
if ("Linux".equals(System.getProperties().getProperty("os.name"))
&& System.getProperties().getProperty("os.version").indexOf("el") > 0) {
Expand Down

0 comments on commit f366ebf

Please sign in to comment.