You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ji...@apache.org on 2022/11/25 15:12:14 UTC

[camel-quarkus] 01/02: Disabled FaultTolerance test because of issues 4298

This is an automated email from the ASF dual-hosted git repository.

jiriondrusek pushed a commit to branch camel-main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git

commit e8fe1cb99bea80fce9197f2506056c63a5677047
Author: JiriOndrusek <on...@gmail.com>
AuthorDate: Fri Nov 25 16:07:08 2022 +0100

    Disabled FaultTolerance test because of issues 4298
---
 .../foundation/core-fault-tolerance/pom.xml        | 16 ++---
 .../it/CoreFaultToleranceProducers.java            | 59 ++++++++-----------
 .../it/CoreFaultToleranceResource.java             | 68 +++++++++-------------
 .../it/CoreFaultToleranceRoutes.java               |  7 ++-
 .../faulttolerance/it/CoreFaultToleranceTest.java  |  2 +
 integration-tests/foundation-grouped/pom.xml       |  6 +-
 6 files changed, 72 insertions(+), 86 deletions(-)

diff --git a/integration-test-groups/foundation/core-fault-tolerance/pom.xml b/integration-test-groups/foundation/core-fault-tolerance/pom.xml
index 0f9c8c373c..3ef9aacd26 100644
--- a/integration-test-groups/foundation/core-fault-tolerance/pom.xml
+++ b/integration-test-groups/foundation/core-fault-tolerance/pom.xml
@@ -35,10 +35,11 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-direct</artifactId>
         </dependency>
+        <!--https://github.com/apache/camel-quarkus/issues/4298
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
-        </dependency>
+        </dependency>-->
         <dependency>
             <groupId>io.quarkus</groupId>
             <artifactId>quarkus-resteasy-jsonb</artifactId>
@@ -88,11 +89,6 @@
         </profile>
         <profile>
             <id>virtualDependencies</id>
-            <activation>
-                <property>
-                    <name>!noVirtualDependencies</name>
-                </property>
-            </activation>
             <dependencies>
                 <!-- The following dependencies guarantee that this module is built after them. You can update them by running `mvn process-resources -Pformat -N` from the source tree root directory -->
                 <dependency>
@@ -108,6 +104,7 @@
                         </exclusion>
                     </exclusions>
                 </dependency>
+                <!--https://github.com/apache/camel-quarkus/issues/4298
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
                     <artifactId>camel-quarkus-microprofile-fault-tolerance-deployment</artifactId>
@@ -120,8 +117,13 @@
                             <artifactId>*</artifactId>
                         </exclusion>
                     </exclusions>
-                </dependency>
+                </dependency>-->
             </dependencies>
+            <activation>
+                <property>
+                    <name>!noVirtualDependencies</name>
+                </property>
+            </activation>
         </profile>
     </profiles>
 
diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java
index aa9394108c..a28369c50d 100644
--- a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java
+++ b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceProducers.java
@@ -16,42 +16,31 @@
  */
 package org.apache.camel.quarkus.core.faulttolerance.it;
 
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-import javax.enterprise.context.ApplicationScoped;
-import javax.inject.Named;
-
-import io.smallrye.faulttolerance.core.FaultToleranceStrategy;
-import io.smallrye.faulttolerance.core.InvocationContext;
-import io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker;
-import io.smallrye.faulttolerance.core.stopwatch.SystemStopwatch;
-import io.smallrye.faulttolerance.core.util.ExceptionDecision;
-
 public class CoreFaultToleranceProducers {
 
-    @ApplicationScoped
-    @Named("customCircuitBreaker")
-    CircuitBreaker<Integer> produceCustomCircuitBreaker() {
-        FaultToleranceStrategy<Integer> delegate = new FaultToleranceStrategy<Integer>() {
-            @Override
-            public Integer apply(InvocationContext<Integer> ctx) {
-                return null;
-            }
-        };
-        return new CircuitBreaker<Integer>(delegate, "description", ExceptionDecision.ALWAYS_FAILURE, 10, 40, 0.1,
-                2, new SystemStopwatch()) {
-            @Override
-            public String toString() {
-                return "customCircuitBreaker";
-            }
-        };
-    }
-
-    @ApplicationScoped
-    @Named("customBulkheadExecutorService")
-    ExecutorService produceCustomBulkheadExecutorService() {
-        return Executors.newFixedThreadPool(2);
-    }
+    //    https://github.com/apache/camel-quarkus/issues/4298
+    //    @ApplicationScoped
+    //    @Named("customCircuitBreaker")
+    //    CircuitBreaker<Integer> produceCustomCircuitBreaker() {
+    //        FaultToleranceStrategy<Integer> delegate = new FaultToleranceStrategy<Integer>() {
+    //            @Override
+    //            public Integer apply(InvocationContext<Integer> ctx) {
+    //                return null;
+    //            }
+    //        };
+    //        return new CircuitBreaker<Integer>(delegate, "description", ExceptionDecision.ALWAYS_FAILURE, 10, 40, 0.1,
+    //                2, new SystemStopwatch()) {
+    //            @Override
+    //            public String toString() {
+    //                return "customCircuitBreaker";
+    //            }
+    //        };
+    //    }
+    //
+    //    @ApplicationScoped
+    //    @Named("customBulkheadExecutorService")
+    //    ExecutorService produceCustomBulkheadExecutorService() {
+    //        return Executors.newFixedThreadPool(2);
+    //    }
 
 }
diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceResource.java b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceResource.java
index 24d5fd6bbd..0b67e47552 100644
--- a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceResource.java
+++ b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceResource.java
@@ -16,22 +16,11 @@
  */
 package org.apache.camel.quarkus.core.faulttolerance.it;
 
-import java.util.concurrent.ExecutorService;
-
 import javax.enterprise.context.ApplicationScoped;
 import javax.inject.Inject;
-import javax.inject.Named;
-import javax.json.Json;
-import javax.json.JsonObject;
-import javax.json.JsonObjectBuilder;
-import javax.ws.rs.GET;
 import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
 
-import io.smallrye.faulttolerance.core.circuit.breaker.CircuitBreaker;
 import org.apache.camel.CamelContext;
-import org.apache.camel.component.microprofile.faulttolerance.FaultToleranceProcessor;
 
 @Path("/core")
 @ApplicationScoped
@@ -40,32 +29,33 @@ public class CoreFaultToleranceResource {
     @Inject
     CamelContext context;
 
-    @Named("customCircuitBreaker")
-    CircuitBreaker<Integer> customCircuitBreaker;
-
-    @Named("customBulkheadExecutorService")
-    ExecutorService customBulkheadExecutorService;
-
-    @Path("/fault-tolerance-configurations")
-    @GET
-    @Produces(MediaType.APPLICATION_JSON)
-    public JsonObject faultToleranceConfigurations() {
-        FaultToleranceProcessor ftp = context.getProcessor("ftp", FaultToleranceProcessor.class);
-
-        JsonObjectBuilder objectBuilder = Json.createObjectBuilder();
-        objectBuilder.add("isCustomCircuitBreakerRef", ftp.getCircuitBreaker() == customCircuitBreaker);
-        objectBuilder.add("delay", ftp.getDelay());
-        objectBuilder.add("successThreshold", ftp.getSuccessThreshold());
-        objectBuilder.add("requestVolumeThreshold", ftp.getRequestVolumeThreshold());
-        objectBuilder.add("failureRatio", (int) (ftp.getFailureRate() * 100));
-        objectBuilder.add("timeoutEnabled", ftp.isTimeoutEnabled());
-        objectBuilder.add("timeoutDuration", ftp.getTimeoutDuration());
-        objectBuilder.add("timeoutPoolSize", ftp.getTimeoutPoolSize());
-        objectBuilder.add("bulkheadEnabled", ftp.isBulkheadEnabled());
-        objectBuilder.add("bulkheadMaxConcurrentCalls", ftp.getBulkheadMaxConcurrentCalls());
-        objectBuilder.add("bulkheadWaitingTaskQueue", ftp.getBulkheadWaitingTaskQueue());
-        objectBuilder.add("isCustomBulkheadExecutorServiceRef", ftp.getExecutorService() == customBulkheadExecutorService);
-
-        return objectBuilder.build();
-    }
+    //    https://github.com/apache/camel-quarkus/issues/4298
+    //    @Named("customCircuitBreaker")
+    //    CircuitBreaker<Integer> customCircuitBreaker;
+    //
+    //    @Named("customBulkheadExecutorService")
+    //    ExecutorService customBulkheadExecutorService;
+
+    //    @Path("/fault-tolerance-configurations")
+    //    @GET
+    //    @Produces(MediaType.APPLICATION_JSON)
+    //    public JsonObject faultToleranceConfigurations() {
+    //        FaultToleranceProcessor ftp = context.getProcessor("ftp", FaultToleranceProcessor.class);
+    //
+    //        JsonObjectBuilder objectBuilder = Json.createObjectBuilder();
+    //        objectBuilder.add("isCustomCircuitBreakerRef", ftp.getCircuitBreaker() == customCircuitBreaker);
+    //        objectBuilder.add("delay", ftp.getDelay());
+    //        objectBuilder.add("successThreshold", ftp.getSuccessThreshold());
+    //        objectBuilder.add("requestVolumeThreshold", ftp.getRequestVolumeThreshold());
+    //        objectBuilder.add("failureRatio", (int) (ftp.getFailureRate() * 100));
+    //        objectBuilder.add("timeoutEnabled", ftp.isTimeoutEnabled());
+    //        objectBuilder.add("timeoutDuration", ftp.getTimeoutDuration());
+    //        objectBuilder.add("timeoutPoolSize", ftp.getTimeoutPoolSize());
+    //        objectBuilder.add("bulkheadEnabled", ftp.isBulkheadEnabled());
+    //        objectBuilder.add("bulkheadMaxConcurrentCalls", ftp.getBulkheadMaxConcurrentCalls());
+    //        objectBuilder.add("bulkheadWaitingTaskQueue", ftp.getBulkheadWaitingTaskQueue());
+    //        objectBuilder.add("isCustomBulkheadExecutorServiceRef", ftp.getExecutorService() == customBulkheadExecutorService);
+    //
+    //        return objectBuilder.build();
+    //    }
 }
diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceRoutes.java b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceRoutes.java
index e820865b8e..3e926e9b9f 100644
--- a/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceRoutes.java
+++ b/integration-test-groups/foundation/core-fault-tolerance/src/main/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceRoutes.java
@@ -32,8 +32,9 @@ public class CoreFaultToleranceRoutes extends RouteBuilder {
 
     @Override
     public void configure() {
-        from("direct:faultTolerance").circuitBreaker().id("ftp").process(exchange -> {
-            exchange.getMessage().setBody(RESULT);
-        }).onFallback().setBody().constant(FALLBACK_RESULT).end();
+        //        Disabled with the test https://github.com/apache/camel-quarkus/issues/4298
+        //        from("direct:faultTolerance").circuitBreaker().id("ftp").process(exchange -> {
+        //            exchange.getMessage().setBody(RESULT);
+        //        }).onFallback().setBody().constant(FALLBACK_RESULT).end();
     }
 }
diff --git a/integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceTest.java b/integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceTest.java
index 6aaa60aaf1..452eee044e 100644
--- a/integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceTest.java
+++ b/integration-test-groups/foundation/core-fault-tolerance/src/test/java/org/apache/camel/quarkus/core/faulttolerance/it/CoreFaultToleranceTest.java
@@ -17,6 +17,7 @@
 package org.apache.camel.quarkus.core.faulttolerance.it;
 
 import io.quarkus.test.junit.QuarkusTest;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 
 import static io.restassured.RestAssured.get;
@@ -26,6 +27,7 @@ import static org.hamcrest.Matchers.is;
 public class CoreFaultToleranceTest {
 
     @Test
+    @Disabled //https://github.com/apache/camel-quarkus/issues/4298
     public void testFaultTolerancePropertiesAreApplied() {
         get("/core/fault-tolerance-configurations")
                 .then()
diff --git a/integration-tests/foundation-grouped/pom.xml b/integration-tests/foundation-grouped/pom.xml
index 70cf7efb29..5c0cb91913 100644
--- a/integration-tests/foundation-grouped/pom.xml
+++ b/integration-tests/foundation-grouped/pom.xml
@@ -96,10 +96,11 @@
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-log</artifactId>
         </dependency>
+        <!-- https://github.com/apache/camel-quarkus/issues/4298
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-microprofile-fault-tolerance</artifactId>
-        </dependency>
+        </dependency>-->
         <dependency>
             <groupId>org.apache.camel.quarkus</groupId>
             <artifactId>camel-quarkus-mock</artifactId>
@@ -373,6 +374,7 @@
                         </exclusion>
                     </exclusions>
                 </dependency>
+                <!-- https://github.com/apache/camel-quarkus/issues/4298
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
                     <artifactId>camel-quarkus-microprofile-fault-tolerance-deployment</artifactId>
@@ -385,7 +387,7 @@
                             <artifactId>*</artifactId>
                         </exclusion>
                     </exclusions>
-                </dependency>
+                </dependency>-->
                 <dependency>
                     <groupId>org.apache.camel.quarkus</groupId>
                     <artifactId>camel-quarkus-mock-deployment</artifactId>