This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 61a44c04be Run JFR tests only if the JDK supports it
61a44c04be is described below
commit 61a44c04bed07acf5a630f0bd58c6783da5fec6d
Author: James Netherton <[email protected]>
AuthorDate: Fri Feb 6 08:25:33 2026 +0000
Run JFR tests only if the JDK supports it
---
.../camel/quarkus/component/jfr/it/JfrTest.java | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git
a/integration-tests/jfr/src/test/java/org/apache/camel/quarkus/component/jfr/it/JfrTest.java
b/integration-tests/jfr/src/test/java/org/apache/camel/quarkus/component/jfr/it/JfrTest.java
index d0424e45a9..154d2d7ec2 100644
---
a/integration-tests/jfr/src/test/java/org/apache/camel/quarkus/component/jfr/it/JfrTest.java
+++
b/integration-tests/jfr/src/test/java/org/apache/camel/quarkus/component/jfr/it/JfrTest.java
@@ -17,20 +17,30 @@
package org.apache.camel.quarkus.component.jfr.it;
import java.io.File;
+import java.io.IOException;
+import java.text.ParseException;
import io.quarkus.test.common.QuarkusTestResource;
import io.quarkus.test.junit.QuarkusTest;
import io.restassured.RestAssured;
+import jdk.jfr.Configuration;
+import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
@QuarkusTest
@QuarkusTestResource(JfrTestResource.class)
class JfrTest {
+ @BeforeEach
+ public void beforeEach() {
+ assumeTrue(isFlightRecorderAvailable(), "Flight recorder is not
available");
+ }
+
@Test
public void testflightRecorderRecording() {
// Make sure the flight recorder is configured on the camel context
@@ -44,4 +54,13 @@ class JfrTest {
String fileName = recordings[0];
assertTrue(fileName.matches("camel-recording[0-9]+\\.jfr"));
}
+
+ static boolean isFlightRecorderAvailable() {
+ try {
+ Configuration.getConfiguration("default");
+ return true;
+ } catch (IOException | ParseException e) {
+ return false;
+ }
+ }
}