From e3fc43dd80840b78fd03f28943f7cce07fcf68d9 Mon Sep 17 00:00:00 2001 From: David <3dgiordano@gmail.com> Date: Fri, 17 Jul 2026 22:21:53 -0300 Subject: [PATCH 1/2] Default minimum to JMeter to 5.5 --- pom.xml | 6 +++--- .../HTTP2JettyClientFileProtocolSamplingTest.java | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 7108770..7735dcb 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ UTF-8 UTF-8 - 5.4.1 + 5.5 12.1.11 1.23.0 @@ -50,11 +50,11 @@ provided - + org.apache.httpcomponents httpcore - 4.4.14 + 4.4.15 compile diff --git a/src/test/java/com/blazemeter/jmeter/http2/core/HTTP2JettyClientFileProtocolSamplingTest.java b/src/test/java/com/blazemeter/jmeter/http2/core/HTTP2JettyClientFileProtocolSamplingTest.java index 1c91e78..58188a8 100644 --- a/src/test/java/com/blazemeter/jmeter/http2/core/HTTP2JettyClientFileProtocolSamplingTest.java +++ b/src/test/java/com/blazemeter/jmeter/http2/core/HTTP2JettyClientFileProtocolSamplingTest.java @@ -9,6 +9,7 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import org.apache.commons.lang3.StringUtils; import org.apache.jmeter.protocol.http.sampler.HTTPSampleResult; import org.apache.jmeter.protocol.http.util.HTTPConstants; import org.junit.After; @@ -49,7 +50,15 @@ public void samplesLocalFileWithHardcodedGetMethodAndTextHtmlContentType() throw assertThat(sampled.isSuccessful()).isTrue(); assertThat(sampled.getResponseCode()).isEqualTo("200"); assertThat(sampled.getHTTPMethod()).isEqualTo(HTTPConstants.GET); - assertThat(sampled.getContentType()).isEqualTo("text/html"); + // HTTP2Sampler.getContentEncoding()'s default is JMeter-version-dependent: 5.6.3 added a + // hardcoded UTF-8 schema default (HTTPSamplerBaseSchema), while 5.5 (our minimum supported + // version) leaves it blank until explicitly set. Read the sampler's actual runtime default + // instead of hardcoding the literal so this test passes on both supported versions. + String defaultContentEncoding = new HTTP2Sampler().getContentEncoding(); + String expectedContentType = StringUtils.isBlank(defaultContentEncoding) + ? "text/html" + : "text/html; charset=" + defaultContentEncoding; + assertThat(sampled.getContentType()).isEqualTo(expectedContentType); assertThat(sampled.getResponseDataAsString()).isEqualTo(fileContent); } From e843f43013f3f5f3bcb5ed5dacf8ab1ba752bd0e Mon Sep 17 00:00:00 2001 From: David <3dgiordano@gmail.com> Date: Fri, 17 Jul 2026 22:22:07 -0300 Subject: [PATCH 2/2] Matrix JMeter 5.5 and 5.6.3 for compatibility tests --- .github/workflows/ci-build.yaml | 16 +++++++++++++--- .github/workflows/ci-jmeter-compatibility.yaml | 8 +++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-build.yaml b/.github/workflows/ci-build.yaml index 61391b1..f5b9386 100644 --- a/.github/workflows/ci-build.yaml +++ b/.github/workflows/ci-build.yaml @@ -10,6 +10,13 @@ concurrency: jobs: build: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + # 5.5 is the minimum supported JMeter version, 5.6.3 the latest; both are exercised + # end-to-end (unit + HTTP parity regression tests) since ApacheJMeter_* are provided-scope + # and the same compiled plugin must behave correctly against either at runtime. + jmeter_version: ["5.5", "5.6.3"] steps: - name: Checkout uses: actions/checkout@v5 @@ -21,14 +28,17 @@ jobs: java-version: "17" cache: maven - - name: Build and test - run: xvfb-run -a mvn -U --batch-mode clean install + - name: Build and test (JMeter ${{ matrix.jmeter_version }}) + run: >- + xvfb-run -a mvn -U --batch-mode + -Djmeter.version=${{ matrix.jmeter_version }} + clean install - name: Upload build artifacts if: always() uses: actions/upload-artifact@v6 with: - name: ci-build-artifacts-${{ github.run_id }} + name: ci-build-artifacts-${{ matrix.jmeter_version }}-${{ github.run_id }} path: | target/jmeter-bzm-http2-*.jar target/jmeter-test diff --git a/.github/workflows/ci-jmeter-compatibility.yaml b/.github/workflows/ci-jmeter-compatibility.yaml index b0170a7..93a7f4f 100644 --- a/.github/workflows/ci-jmeter-compatibility.yaml +++ b/.github/workflows/ci-jmeter-compatibility.yaml @@ -55,7 +55,13 @@ jobs: env: JMETER_PATH_BASE: ${{ github.workspace }}/.jmeter run: | - JMETER_VERSION=5.6.3 JMETER_PATH=$JMETER_PATH_BASE/5.6.3 sh testJMeter.sh + # Verify the built plugin jar loads and runs against every JMeter version we claim + # to support: 5.5 (minimum) through 5.6.3 (latest), regardless of which version the + # jar itself was compiled against (jmeter.version in pom.xml is provided-scope). + for JMETER_VERSION in 5.5 5.6.3; do + echo "=== Compatibility check against JMeter $JMETER_VERSION ===" + JMETER_VERSION=$JMETER_VERSION JMETER_PATH=$JMETER_PATH_BASE/$JMETER_VERSION sh testJMeter.sh + done - name: Upload compatibility artifacts on failure if: failure()