Skip to content

Commit 8418f56

Browse files
author
Stephane Landelle
committed
Fix test broken for Grizzly after f4ad6ad
1 parent c6d8c55 commit 8418f56

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

api/src/test/java/org/asynchttpclient/async/AsyncProvidersBasicTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,6 +679,8 @@ public Response onCompleted(Response response) throws Exception {
679679
}
680680
}
681681

682+
protected abstract String acceptEncodingHeader();
683+
682684
@Test(groups = { "standalone", "default_provider", "async" })
683685
public void asyncDoPostBasicGZIPTest() throws Exception {
684686
AsyncHttpClient client = getAsyncHttpClient(new AsyncHttpClientConfig.Builder().setCompressionEnabled(true).build());
@@ -698,13 +700,14 @@ public void asyncDoPostBasicGZIPTest() throws Exception {
698700
public Response onCompleted(Response response) throws Exception {
699701
try {
700702
assertEquals(response.getStatusCode(), 200);
701-
assertEquals(response.getHeader("X-Accept-Encoding"), "gzip,deflate");
703+
assertEquals(response.getHeader("X-Accept-Encoding"), acceptEncodingHeader());
702704
} finally {
703705
l.countDown();
704706
}
705707
return response;
706708
}
707709
}).get();
710+
708711
if (!l.await(TIMEOUT, TimeUnit.SECONDS)) {
709712
fail("Timeout out");
710713
}

providers/grizzly/src/test/java/org/asynchttpclient/providers/grizzly/GrizzlyAsyncProviderBasicTest.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717
import org.asynchttpclient.AsyncHttpClientConfig;
1818
import org.asynchttpclient.AsyncHttpProviderConfig;
1919
import org.asynchttpclient.async.AsyncProvidersBasicTest;
20-
import org.asynchttpclient.providers.grizzly.GrizzlyAsyncHttpProviderConfig;
21-
import org.asynchttpclient.providers.grizzly.TransportCustomizer;
22-
import org.glassfish.grizzly.filterchain.FilterChainBuilder;
23-
import org.glassfish.grizzly.nio.transport.TCPNIOTransport;
24-
import org.glassfish.grizzly.strategies.SameThreadIOStrategy;
25-
import org.testng.annotations.Test;
26-
27-
import static org.asynchttpclient.providers.grizzly.GrizzlyAsyncHttpProviderConfig.Property.TRANSPORT_CUSTOMIZER;
2820

2921
public class GrizzlyAsyncProviderBasicTest extends AsyncProvidersBasicTest {
3022

@@ -39,4 +31,8 @@ public AsyncHttpClient getAsyncHttpClient(AsyncHttpClientConfig config) {
3931
return config;
4032
}
4133

34+
@Override
35+
protected String acceptEncodingHeader() {
36+
return "gzip";
37+
}
4238
}

providers/netty/src/test/java/org/asynchttpclient/providers/netty/NettyAsyncProviderBasicTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,9 @@ public AsyncHttpClient getAsyncHttpClient(AsyncHttpClientConfig config) {
3030
config.addProperty("TCP_NODELAY", true);
3131
return config;
3232
}
33+
34+
@Override
35+
protected String acceptEncodingHeader() {
36+
return "gzip,deflate";
37+
}
3338
}

0 commit comments

Comments
 (0)