You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by fm...@apache.org on 2026/03/31 14:17:51 UTC

(camel-kafka-connector) branch fix/integration-tests-kafka-391 updated (aaae52d24b -> 1d8c5c9b56)

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

fmariani pushed a change to branch fix/integration-tests-kafka-391
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git


    omit aaae52d24b Fix CXF/CXFRS source tests: wait for endpoint readiness and remove unused dispatch-router
     new 1d8c5c9b56 Fix CXF/CXFRS source tests: wait for endpoint readiness and remove unused dispatch-router

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (aaae52d24b)
            \
             N -- N -- N   refs/heads/fix/integration-tests-kafka-391 (1d8c5c9b56)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../common/services/kafkaconnect/DefaultKafkaConnectPropertyFactory.java | 1 -
 1 file changed, 1 deletion(-)


(camel-kafka-connector) 01/01: Fix CXF/CXFRS source tests: wait for endpoint readiness and remove unused dispatch-router

Posted by fm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

fmariani pushed a commit to branch fix/integration-tests-kafka-391
in repository https://gitbox.apache.org/repos/asf/camel-kafka-connector.git

commit 1d8c5c9b564d94c6226b44330fba3b0d5ec60a1d
Author: Croway <fe...@gmail.com>
AuthorDate: Tue Mar 31 15:15:35 2026 +0200

    Fix CXF/CXFRS source tests: wait for endpoint readiness and remove unused dispatch-router
    
    The CXF source connector opens the HTTP port before the service path is
    fully registered, causing 404 responses when the test client invokes the
    service immediately after port becomes available.
    
    Use Awaitility to poll the WSDL URL (CXF) or the REST endpoint (CXFRS)
    until the service is ready before producing test data. Also increase
    CXFRS test timeout from 30s to 90s.
    
    Remove unused camel-test-infra-dispatch-router dependency from both
    modules — the retired qdrouterd image was never used in these tests.
---
 .../DefaultKafkaConnectPropertyFactory.java        |  1 -
 tests/itests-cxf/pom.xml                           | 14 +++++------
 .../cxf/source/CamelSourceCXFITCase.java           | 29 +++++++++++++++++++---
 tests/itests-cxfrs/pom.xml                         | 14 +++++------
 .../cxfrs/source/CamelSourceCXFRSITCase.java       | 29 +++++++++++-----------
 5 files changed, 53 insertions(+), 34 deletions(-)

diff --git a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/DefaultKafkaConnectPropertyFactory.java b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/DefaultKafkaConnectPropertyFactory.java
index 04fff966c5..ad88e936c4 100644
--- a/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/DefaultKafkaConnectPropertyFactory.java
+++ b/tests/itests-common/src/test/java/org/apache/camel/kafkaconnector/common/services/kafkaconnect/DefaultKafkaConnectPropertyFactory.java
@@ -20,7 +20,6 @@ package org.apache.camel.kafkaconnector.common.services.kafkaconnect;
 import java.util.Properties;
 
 import org.apache.camel.kafkaconnector.common.PluginPathHelper;
-import org.apache.camel.kafkaconnector.common.utils.NetworkUtils;
 import org.apache.kafka.connect.runtime.rest.RestServerConfig;
 import org.apache.kafka.connect.runtime.standalone.StandaloneConfig;
 import org.slf4j.Logger;
diff --git a/tests/itests-cxf/pom.xml b/tests/itests-cxf/pom.xml
index 623275ea8e..e768ea080a 100644
--- a/tests/itests-cxf/pom.xml
+++ b/tests/itests-cxf/pom.xml
@@ -43,13 +43,6 @@
             <version>${camel.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test-infra-dispatch-router</artifactId>
-            <version>${camel.version}</version>
-            <scope>test</scope>
-        </dependency>
-
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-cxf-soap</artifactId>
@@ -81,6 +74,13 @@
             <artifactId>commons-io</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <version>${awaitility-version}</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>javax.annotation</groupId>
             <artifactId>javax.annotation-api</artifactId>
diff --git a/tests/itests-cxf/src/test/java/org/apache/camel/kafkaconnector/cxf/source/CamelSourceCXFITCase.java b/tests/itests-cxf/src/test/java/org/apache/camel/kafkaconnector/cxf/source/CamelSourceCXFITCase.java
index b8ee82ad63..add50d0ce4 100644
--- a/tests/itests-cxf/src/test/java/org/apache/camel/kafkaconnector/cxf/source/CamelSourceCXFITCase.java
+++ b/tests/itests-cxf/src/test/java/org/apache/camel/kafkaconnector/cxf/source/CamelSourceCXFITCase.java
@@ -17,6 +17,10 @@
 
 package org.apache.camel.kafkaconnector.cxf.source;
 
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.time.Duration;
+
 import org.apache.camel.kafkaconnector.common.test.CamelSourceTestSupport;
 import org.apache.camel.kafkaconnector.common.test.TestMessageConsumer;
 import org.apache.camel.kafkaconnector.common.utils.NetworkUtils;
@@ -24,6 +28,7 @@ import org.apache.camel.kafkaconnector.cxf.client.CXFServiceUtil;
 import org.apache.camel.kafkaconnector.cxf.common.HelloService;
 import org.apache.camel.test.infra.common.TestUtils;
 import org.apache.kafka.clients.consumer.ConsumerRecord;
+import org.awaitility.Awaitility;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -53,16 +58,32 @@ public abstract class CamelSourceCXFITCase extends CamelSourceTestSupport {
     protected void produceTestData() {
         TestUtils.waitFor(() -> NetworkUtils.portIsOpen("localhost", PORT));
 
+        // Wait for the CXF endpoint to be fully registered (WSDL available)
+        Awaitility.await()
+                .atMost(Duration.ofSeconds(30))
+                .pollInterval(Duration.ofSeconds(1))
+                .pollDelay(Duration.ZERO)
+                .until(() -> {
+                    try {
+                        HttpURLConnection conn = (HttpURLConnection) URI.create(SIMPLE_ENDPOINT_ADDRESS + "?wsdl").toURL().openConnection();
+                        conn.setRequestMethod("GET");
+                        conn.setConnectTimeout(1000);
+                        conn.setReadTimeout(1000);
+                        int code = conn.getResponseCode();
+                        conn.disconnect();
+                        return code == 200;
+                    } catch (Exception e) {
+                        return false;
+                    }
+                });
+
         try {
             HelloService client = CXFServiceUtil.getService(SIMPLE_ENDPOINT_ADDRESS, HelloService.class);
-
             for (int i = 0; i < expect; i++) {
                 client.echo("Test message " + i);
             }
-
-
         } catch (Exception e) {
-            LOG.info("Unable to invoke service: {}", e.getMessage(), e);
+            LOG.error("Unable to invoke service: {}", e.getMessage(), e);
             fail("Unable to invoke service");
         }
     }
diff --git a/tests/itests-cxfrs/pom.xml b/tests/itests-cxfrs/pom.xml
index b32668d25c..6ce096ad91 100644
--- a/tests/itests-cxfrs/pom.xml
+++ b/tests/itests-cxfrs/pom.xml
@@ -43,13 +43,6 @@
             <version>${camel.version}</version>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>org.apache.camel</groupId>
-            <artifactId>camel-test-infra-dispatch-router</artifactId>
-            <version>${camel.version}</version>
-            <scope>test</scope>
-        </dependency>
-
         <dependency>
             <groupId>org.apache.camel</groupId>
             <artifactId>camel-cxf-rest</artifactId>
@@ -60,6 +53,13 @@
             <artifactId>javax.annotation-api</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <version>${awaitility-version}</version>
+            <scope>test</scope>
+        </dependency>
+
         <dependency>
             <groupId>org.apache.cxf</groupId>
             <artifactId>cxf-rt-transports-http-undertow</artifactId>
diff --git a/tests/itests-cxfrs/src/test/java/org/apache/camel/kafkaconnector/cxfrs/source/CamelSourceCXFRSITCase.java b/tests/itests-cxfrs/src/test/java/org/apache/camel/kafkaconnector/cxfrs/source/CamelSourceCXFRSITCase.java
index 6a4dadf460..2072dc97ca 100644
--- a/tests/itests-cxfrs/src/test/java/org/apache/camel/kafkaconnector/cxfrs/source/CamelSourceCXFRSITCase.java
+++ b/tests/itests-cxfrs/src/test/java/org/apache/camel/kafkaconnector/cxfrs/source/CamelSourceCXFRSITCase.java
@@ -17,6 +17,8 @@
 
 package org.apache.camel.kafkaconnector.cxfrs.source;
 
+import java.time.Duration;
+
 import org.apache.camel.kafkaconnector.common.ConnectorPropertyFactory;
 import org.apache.camel.kafkaconnector.common.test.CamelSourceTestSupport;
 import org.apache.camel.kafkaconnector.common.test.TestMessageConsumer;
@@ -31,6 +33,7 @@ import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.client.HttpClientBuilder;
 import org.apache.kafka.clients.consumer.ConsumerRecord;
+import org.awaitility.Awaitility;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Timeout;
@@ -72,20 +75,16 @@ public class CamelSourceCXFRSITCase extends CamelSourceTestSupport {
     @Override
     protected void produceTestData() {
         TestUtils.waitFor(() -> NetworkUtils.portIsOpen(LOCALHOST, PORT));
-        try {
-            Bus bus = BusFactory.newInstance().createBus();
-
-            bus.getInInterceptors().add(new LoggingInInterceptor());
-            bus.getOutInterceptors().add(new LoggingOutInterceptor());
-            try {
-                doTestGetCustomer("rest");
-            } catch (Exception e) {
-                LOG.info("Test Invocation Failure", e);
-            }
-        } catch (Exception e) {
-            LOG.info("Unable to invoke service: {}", e.getMessage(), e);
-            fail("Unable to invoke service");
-        }
+
+        Bus bus = BusFactory.newInstance().createBus();
+        bus.getInInterceptors().add(new LoggingInInterceptor());
+        bus.getOutInterceptors().add(new LoggingOutInterceptor());
+
+        Awaitility.await()
+                .atMost(Duration.ofSeconds(30))
+                .pollInterval(Duration.ofSeconds(1))
+                .pollDelay(Duration.ZERO)
+                .untilAsserted(() -> doTestGetCustomer("rest"));
     }
 
     @Override
@@ -103,7 +102,7 @@ public class CamelSourceCXFRSITCase extends CamelSourceTestSupport {
     }
 
     @Test
-    @Timeout(30)
+    @Timeout(90)
     public void testBasicSendReceive() {
         try {
             String topicName = getTopicForTest(this);