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

[camel] branch main updated (dd940e52ddc -> b2c0b5c896b)

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

orpiske pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


    from dd940e52ddc CAMEL-19741: applied concurency configuration to pom file (#11105)
     new 7a470be871e CAMEL-19684: avoid running 2 containers unnecessarily
     new b2c0b5c896b CAMEL-19684: avoid a possible NPE getting the mock endpoint

The 2 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:
 .../component/rocketmq/RocketMQRouteTest.java      |  8 ++++++--
 .../infra/rocketmq/services/RocketMQContainer.java |  5 -----
 .../src/test/resources/broker2/broker2.conf        | 24 ----------------------
 3 files changed, 6 insertions(+), 31 deletions(-)
 delete mode 100644 test-infra/camel-test-infra-rocketmq/src/test/resources/broker2/broker2.conf


[camel] 02/02: CAMEL-19684: avoid a possible NPE getting the mock endpoint

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

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

commit b2c0b5c896bace1448de40d809aa98b824c523bd
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Aug 14 17:02:07 2023 +0200

    CAMEL-19684: avoid a possible NPE getting the mock endpoint
---
 .../org/apache/camel/component/rocketmq/RocketMQRouteTest.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteTest.java b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteTest.java
index ea7745fd751..78d090b336a 100644
--- a/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteTest.java
+++ b/components/camel-rocketmq/src/test/java/org/apache/camel/component/rocketmq/RocketMQRouteTest.java
@@ -18,10 +18,12 @@
 package org.apache.camel.component.rocketmq;
 
 import java.io.IOException;
+import java.time.Duration;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
+import org.awaitility.Awaitility;
 import org.junit.jupiter.api.AfterAll;
 import org.junit.jupiter.api.BeforeAll;
 import org.junit.jupiter.api.BeforeEach;
@@ -46,7 +48,7 @@ public class RocketMQRouteTest extends RocketMQTestSupport {
     @BeforeEach
     public void setUp() throws Exception {
         super.setUp();
-        resultEndpoint = (MockEndpoint) context.getEndpoint(RESULT_ENDPOINT_URI);
+
     }
 
     @Override
@@ -54,6 +56,7 @@ public class RocketMQRouteTest extends RocketMQTestSupport {
         CamelContext camelContext = super.createCamelContext();
         RocketMQComponent rocketMQComponent = new RocketMQComponent();
         rocketMQComponent.setNamesrvAddr(rocketMQService.nameserverAddress());
+
         camelContext.addComponent("rocketmq", rocketMQComponent);
         return camelContext;
     }
@@ -71,13 +74,14 @@ public class RocketMQRouteTest extends RocketMQTestSupport {
 
     @Test
     public void testSimpleRoute() throws Exception {
+        resultEndpoint = (MockEndpoint) context.getEndpoint(RESULT_ENDPOINT_URI);
         resultEndpoint.expectedBodiesReceived(EXPECTED_MESSAGE);
         resultEndpoint.message(0).header(RocketMQConstants.TOPIC).isEqualTo("START_TOPIC");
         resultEndpoint.message(0).header(RocketMQConstants.TAG).isEqualTo("startTag");
 
         template.sendBody(START_ENDPOINT_URI, EXPECTED_MESSAGE);
 
-        resultEndpoint.assertIsSatisfied();
+        Awaitility.await().atMost(Duration.ofSeconds(5)).untilAsserted(() -> resultEndpoint.assertIsSatisfied());
     }
 
     @AfterAll


[camel] 01/02: CAMEL-19684: avoid running 2 containers unnecessarily

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

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

commit 7a470be871e06669f028927ce9fd813ae574dce6
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Mon Aug 14 15:08:18 2023 +0200

    CAMEL-19684: avoid running 2 containers unnecessarily
---
 .../infra/rocketmq/services/RocketMQContainer.java |  5 -----
 .../src/test/resources/broker2/broker2.conf        | 24 ----------------------
 2 files changed, 29 deletions(-)

diff --git a/test-infra/camel-test-infra-rocketmq/src/test/java/org/apache/camel/test/infra/rocketmq/services/RocketMQContainer.java b/test-infra/camel-test-infra-rocketmq/src/test/java/org/apache/camel/test/infra/rocketmq/services/RocketMQContainer.java
index 3ce6e742d06..6fafc107247 100644
--- a/test-infra/camel-test-infra-rocketmq/src/test/java/org/apache/camel/test/infra/rocketmq/services/RocketMQContainer.java
+++ b/test-infra/camel-test-infra-rocketmq/src/test/java/org/apache/camel/test/infra/rocketmq/services/RocketMQContainer.java
@@ -22,7 +22,6 @@ import java.util.concurrent.TimeUnit;
 import org.apache.camel.test.infra.common.services.ContainerService;
 import org.apache.camel.test.infra.rocketmq.common.RocketMQProperties;
 import org.awaitility.Awaitility;
-import org.junit.jupiter.api.extension.ExtensionContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.testcontainers.containers.Container;
@@ -37,7 +36,6 @@ public class RocketMQContainer implements RocketMQService, ContainerService<Rock
 
     private final RocketMQNameserverContainer nameserverContainer;
     private final RocketMQBrokerContainer brokerContainer1;
-    private final RocketMQBrokerContainer brokerContainer2;
 
     public RocketMQContainer() {
         Network network = Network.newNetwork();
@@ -45,7 +43,6 @@ public class RocketMQContainer implements RocketMQService, ContainerService<Rock
         nameserverContainer = new RocketMQNameserverContainer(network);
 
         brokerContainer1 = new RocketMQBrokerContainer(network, "broker1");
-        brokerContainer2 = new RocketMQBrokerContainer(network, "broker2");
     }
 
     @Override
@@ -64,14 +61,12 @@ public class RocketMQContainer implements RocketMQService, ContainerService<Rock
         LOG.info("Apache RocketMQ running at address {}", nameserverAddress());
 
         brokerContainer1.start();
-        brokerContainer2.start();
     }
 
     @Override
     public void shutdown() {
         nameserverContainer.stop();
         brokerContainer1.stop();
-        brokerContainer2.stop();
     }
 
     public void createTopic(String topic) {
diff --git a/test-infra/camel-test-infra-rocketmq/src/test/resources/broker2/broker2.conf b/test-infra/camel-test-infra-rocketmq/src/test/resources/broker2/broker2.conf
deleted file mode 100644
index 66b7fde12ba..00000000000
--- a/test-infra/camel-test-infra-rocketmq/src/test/resources/broker2/broker2.conf
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements.  See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License.  You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-brokerClusterName = DefaultCluster
-brokerName = broker-b
-brokerId = 0
-deleteWhen = 04
-fileReservedTime = 48
-brokerRole = ASYNC_MASTER
-flushDiskType = ASYNC_FLUSH
\ No newline at end of file