Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "monthly"
groups:
dependencies:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
groups:
actions:
patterns:
- "*"
62 changes: 38 additions & 24 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# This workflow is designed to build PRs for AHC. Note that it does not actually publish AHC, just builds and test it.
# This workflow builds and tests PRs for AHC.
# Docs: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Build PR
permissions:
contents: read

on:
push:
Expand All @@ -17,39 +19,51 @@ on:
default: 'Github Actions'

jobs:
RunOnLinux:
compile-and-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Grant Permission
run: sudo chmod +x ./mvnw
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '11'
- name: Run Tests (force Docker tests)
run: ./mvnw -B -ntp clean test -Ddocker.tests=true

RunOnMacOs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Grant Permission
run: sudo chmod +x ./mvnw
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '11'
- name: Run Tests (force Docker tests)
run: ./mvnw -B -ntp clean test -Ddocker.tests=true
run: chmod +x ./mvnw
- name: Compile and API compatibility check
run: ./mvnw -B -ntp clean verify -DskipTests -Dgpg.skip=true

RunOnWindows:
runs-on: windows-latest
test:
needs: compile-and-check
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
jdk: [11, 17, 21, 25]
include:
- jdk: 11
distribution: corretto
- jdk: 17
distribution: corretto
- jdk: 21
distribution: corretto
- jdk: 25
distribution: corretto
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '11'
- name: Run Tests
run: ./mvnw.cmd -B -ntp clean test
distribution: ${{ matrix.distribution }}
java-version: ${{ matrix.jdk }}
- name: Grant Permission
if: runner.os != 'Windows'
run: chmod +x ./mvnw
- name: Run Tests (Linux)
if: runner.os == 'Linux'
run: ./mvnw -B -ntp clean test -Ddocker.tests=true
- name: Run Tests (macOS)
if: runner.os == 'macOS'
run: ./mvnw -B -ntp clean test -Dno.docker.tests=true
- name: Run Tests (Windows)
if: runner.os == 'Windows'
run: ./mvnw.cmd -B -ntp clean test "-Dno.docker.tests=true"
7 changes: 7 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,13 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-pkitesting</artifactId>
<version>${netty.version}</version>
<scope>test</scope>
</dependency>

<!-- Testcontainers for Docker-based integration tests -->
<dependency>
<groupId>org.testcontainers</groupId>
Expand Down
10 changes: 7 additions & 3 deletions client/src/test/java/org/asynchttpclient/BasicHttp2Test.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
import io.netty.handler.ssl.ApplicationProtocolNames;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.util.SelfSignedCertificate;
import io.netty.pkitesting.CertificateBuilder;
import io.netty.pkitesting.X509Bundle;
import io.netty.util.concurrent.GlobalEventExecutor;
import org.asynchttpclient.test.EventCollectingHandler;
import org.junit.jupiter.api.AfterEach;
Expand Down Expand Up @@ -335,9 +336,12 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {

@BeforeEach
public void startServer() throws Exception {
SelfSignedCertificate ssc = new SelfSignedCertificate();
X509Bundle bundle = new CertificateBuilder()
.subject("CN=localhost")
.setIsCertificateAuthority(true)
.buildSelfSigned();

serverSslCtx = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey())
serverSslCtx = SslContextBuilder.forServer(bundle.toKeyManagerFactory())
.applicationProtocolConfig(new ApplicationProtocolConfig(
ApplicationProtocolConfig.Protocol.ALPN,
ApplicationProtocolConfig.SelectorFailureBehavior.NO_ADVERTISE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public AbstractHandler configureHandler() throws Exception {
}

private void expectHttpResponse(Function<BoundRequestBuilder, BoundRequestBuilder> f, int expectedResponseCode) throws Throwable {
File file = createTempFile(1024 * 1024);
File file = createTempFile(1024);

try (AsyncHttpClient client = asyncHttpClient()) {
Response response = f.apply(client.preparePut(getTargetUrl()).addBodyPart(new FilePart("test", file, APPLICATION_OCTET_STREAM.toString(), UTF_8)))
Expand Down
88 changes: 73 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -429,31 +429,89 @@
</plugin>

<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<version>0.23.1</version>
<groupId>org.revapi</groupId>
<artifactId>revapi-maven-plugin</artifactId>
<version>0.15.0</version>
<dependencies>
<dependency>
<groupId>org.revapi</groupId>
<artifactId>revapi-java</artifactId>
<version>0.28.1</version>
</dependency>
</dependencies>
<configuration>
<version>
<old>RELEASE</old>
<new>${project.version}</new>
</version>
<parameter>
<onlyModified>true</onlyModified>
<breakBuildOnBinaryIncompatibleModifications>true</breakBuildOnBinaryIncompatibleModifications>
<breakBuildOnSourceIncompatibleModifications>true</breakBuildOnSourceIncompatibleModifications>
<includeSynthetic>false</includeSynthetic>
<accessModifier>public</accessModifier>
</parameter>
<oldArtifacts>
<artifact>org.asynchttpclient:async-http-client:RELEASE</artifact>
</oldArtifacts>
<newArtifacts>
<artifact>${project.groupId}:${project.artifactId}:${project.version}</artifact>
</newArtifacts>
<analysisConfiguration>
<![CDATA[
[
{
"extension": "revapi.differences",
"configuration": {
"ignore": true,
"differences": [
{
"code": "java.class.externalClassExposedInAPI",
"justification": "Netty types are part of the public API by design"
},
{
"code": "java.class.nonPublicPartOfAPI",
"justification": "Internal classes exposed via public methods are intentional"
}
]
}
}
]
]]>
</analysisConfiguration>
</configuration>
<executions>
<execution>
<goals>
<goal>cmp</goal>
<goal>check</goal>
</goals>
<phase>verify</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>errorprone-jdk25</id>
<activation>
<jdk>[25,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs combine.children="append">
<arg>--should-stop=ifError=FLOW</arg>
</compilerArgs>
<annotationProcessorPaths combine.self="override">
<path>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.48.0</version>
</path>
<path>
<groupId>com.uber.nullaway</groupId>
<artifactId>nullaway</artifactId>
<version>0.13.1</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
Loading