From b7f4acd2699ecef38754cc6baea9f311740e68ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Pupier?= Date: Tue, 21 Jul 2026 14:06:25 +0200 Subject: [PATCH] CAMEL-24026 - avoid system property leak to other tests from ZXsltTotalOpsTest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit due to https://issues.apache.org/jira/browse/CAMEL-24216 , a system property is leaking to other tests. it can impact other tests to fail when they are played after it. For instance when XsltFromFileExceptionTest is flaky, the 2nd and 3rd run are launched after it and are failing. Signed-off-by: Aurélien Pupier --- .../org/apache/camel/component/xslt/ZXsltTotalOpsTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/camel-core/src/test/java/org/apache/camel/component/xslt/ZXsltTotalOpsTest.java b/core/camel-core/src/test/java/org/apache/camel/component/xslt/ZXsltTotalOpsTest.java index 5d0ad455237a3..b13cc0c7fde4a 100644 --- a/core/camel-core/src/test/java/org/apache/camel/component/xslt/ZXsltTotalOpsTest.java +++ b/core/camel-core/src/test/java/org/apache/camel/component/xslt/ZXsltTotalOpsTest.java @@ -20,6 +20,7 @@ import org.apache.camel.ContextTestSupport; import org.apache.camel.builder.RouteBuilder; +import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.parallel.Isolated; @@ -34,6 +35,12 @@ public boolean isUseRouteBuilder() { return false; } + @AfterEach + void clearXpathLimit() { + // Workaround to https://issues.apache.org/jira/browse/CAMEL-24216 + System.clearProperty("jdk.xml.xpathTotalOpLimit"); + } + @Test public void testXsltTotalOps() throws Exception { context.addRoutes(new RouteBuilder() {