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 2022/08/04 14:19:01 UTC

[camel] branch main updated (7a2dd724e10 -> dc41f16e72b)

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 7a2dd724e10 (chores) camel-kafka: skip health tests when using Strimzi
     new 9daa7f606df CAMEL-18347: fix ArangoDB services in test infra not being singleton
     new 3efb6d15759 CAMEL-18347: fix HBase services in test infra not being singleton
     new efd464b1f2e CAMEL-18347: fix MongoDB services in test infra not being singleton
     new dc41f16e72b CAMEL-18347: ArangoDB tests do not work well with singleton services

The 4 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:
 .../arangodb/integration/BaseArangoDb.java          |  2 +-
 .../arangodb/services/ArangoDBServiceFactory.java   | 21 +++++++++++++++++----
 .../infra/hbase/services/HBaseServiceFactory.java   | 17 ++++++++++++++---
 .../mongodb/services/MongoDBServiceFactory.java     | 18 ++++++++++++++----
 4 files changed, 46 insertions(+), 12 deletions(-)


[camel] 04/04: CAMEL-18347: ArangoDB tests do not work well with singleton services

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 dc41f16e72ba05c2bc3d177bfa25821072d8a14d
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Aug 4 15:26:06 2022 +0200

    CAMEL-18347: ArangoDB tests do not work well with singleton services
---
 .../org/apache/camel/component/arangodb/integration/BaseArangoDb.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/components/camel-arangodb/src/test/java/org/apache/camel/component/arangodb/integration/BaseArangoDb.java b/components/camel-arangodb/src/test/java/org/apache/camel/component/arangodb/integration/BaseArangoDb.java
index f9dec8ef815..01f295469d7 100644
--- a/components/camel-arangodb/src/test/java/org/apache/camel/component/arangodb/integration/BaseArangoDb.java
+++ b/components/camel-arangodb/src/test/java/org/apache/camel/component/arangodb/integration/BaseArangoDb.java
@@ -30,7 +30,7 @@ import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class BaseArangoDb extends CamelTestSupport {
     @RegisterExtension
-    public static ArangoDBService service = ArangoDBServiceFactory.createSingletonService();
+    public static ArangoDBService service = ArangoDBServiceFactory.createService();
 
     protected static final String DATABASE_NAME = "dbTest";
     protected static final String COLLECTION_NAME = "camelTest";


[camel] 01/04: CAMEL-18347: fix ArangoDB services in test infra not being singleton

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 9daa7f606df6249fd1ac86c5cca857fe5f31355e
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Aug 4 14:56:34 2022 +0200

    CAMEL-18347: fix ArangoDB services in test infra not being singleton
---
 .../arangodb/services/ArangoDBServiceFactory.java   | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/test-infra/camel-test-infra-arangodb/src/test/java/org/apache/camel/test/infra/arangodb/services/ArangoDBServiceFactory.java b/test-infra/camel-test-infra-arangodb/src/test/java/org/apache/camel/test/infra/arangodb/services/ArangoDBServiceFactory.java
index 2233912f73a..38fba488ee2 100644
--- a/test-infra/camel-test-infra-arangodb/src/test/java/org/apache/camel/test/infra/arangodb/services/ArangoDBServiceFactory.java
+++ b/test-infra/camel-test-infra-arangodb/src/test/java/org/apache/camel/test/infra/arangodb/services/ArangoDBServiceFactory.java
@@ -47,6 +47,9 @@ public final class ArangoDBServiceFactory {
         }
     }
 
+    private static SimpleTestServiceBuilder<ArangoDBService> instance;
+    private static ArangoDBService arangoDBService;
+
     private ArangoDBServiceFactory() {
 
     }
@@ -63,9 +66,19 @@ public final class ArangoDBServiceFactory {
     }
 
     public static ArangoDBService createSingletonService() {
-        return builder()
-                .addLocalMapping(() -> new SingletonArangoDBService(new ArangoDBLocalContainerService(), "arangoDB"))
-                .addRemoteMapping(ArangoDBRemoteService::new)
-                .build();
+        if (arangoDBService == null) {
+
+            if (instance == null) {
+                instance = builder();
+
+                instance.addLocalMapping(() -> new SingletonArangoDBService(new ArangoDBLocalContainerService(), "arangoDB"))
+                        .addRemoteMapping(ArangoDBRemoteService::new)
+                        .build();
+            }
+
+            arangoDBService = instance.build();
+        }
+
+        return arangoDBService;
     }
 }


[camel] 03/04: CAMEL-18347: fix MongoDB services in test infra not being singleton

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 efd464b1f2e414cddadafac040046728e7ff41e3
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Aug 4 14:57:16 2022 +0200

    CAMEL-18347: fix MongoDB services in test infra not being singleton
---
 .../infra/mongodb/services/MongoDBServiceFactory.java  | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/test-infra/camel-test-infra-mongodb/src/test/java/org/apache/camel/test/infra/mongodb/services/MongoDBServiceFactory.java b/test-infra/camel-test-infra-mongodb/src/test/java/org/apache/camel/test/infra/mongodb/services/MongoDBServiceFactory.java
index 52762a95ac2..dfd97aece4e 100644
--- a/test-infra/camel-test-infra-mongodb/src/test/java/org/apache/camel/test/infra/mongodb/services/MongoDBServiceFactory.java
+++ b/test-infra/camel-test-infra-mongodb/src/test/java/org/apache/camel/test/infra/mongodb/services/MongoDBServiceFactory.java
@@ -48,6 +48,9 @@ public final class MongoDBServiceFactory {
         }
     }
 
+    private static SimpleTestServiceBuilder<MongoDBService> instance;
+    private static MongoDBService service;
+
     private MongoDBServiceFactory() {
 
     }
@@ -64,9 +67,16 @@ public final class MongoDBServiceFactory {
     }
 
     public static MongoDBService createSingletonService() {
-        return builder()
-                .addLocalMapping(() -> new SingletonMongoDBService(new MongoDBLocalContainerService(), "mongo-db"))
-                .addRemoteMapping(MongoDBRemoteService::new)
-                .build();
+        if (service == null) {
+            if (instance == null) {
+                instance = builder();
+                instance.addLocalMapping(() -> new SingletonMongoDBService(new MongoDBLocalContainerService(), "mongo-db"))
+                        .addRemoteMapping(MongoDBRemoteService::new);
+            }
+
+            service = instance.build();
+        }
+
+        return service;
     }
 }


[camel] 02/04: CAMEL-18347: fix HBase services in test infra not being singleton

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 3efb6d1575913a92b354199a49400cc60bea9041
Author: Otavio Rodolfo Piske <an...@gmail.com>
AuthorDate: Thu Aug 4 14:56:41 2022 +0200

    CAMEL-18347: fix HBase services in test infra not being singleton
---
 .../test/infra/hbase/services/HBaseServiceFactory.java  | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseServiceFactory.java b/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseServiceFactory.java
index 0a9a6edfff4..eac5f30b921 100644
--- a/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseServiceFactory.java
+++ b/test-infra/camel-test-infra-hbase/src/test/java/org/apache/camel/test/infra/hbase/services/HBaseServiceFactory.java
@@ -43,6 +43,9 @@ public final class HBaseServiceFactory {
         }
     }
 
+    private static SimpleTestServiceBuilder<HBaseService> instance;
+    private static HBaseService service;
+
     private HBaseServiceFactory() {
 
     }
@@ -58,8 +61,16 @@ public final class HBaseServiceFactory {
     }
 
     public static HBaseService createSingletonService() {
-        return builder()
-                .addLocalMapping(() -> new SingletonHBaseService(new HBaseLocalContainerService(), "hbase"))
-                .build();
+        if (service == null) {
+            if (instance == null) {
+                instance = builder();
+
+                instance.addLocalMapping(() -> new SingletonHBaseService(new HBaseLocalContainerService(), "hbase"));
+            }
+
+            service = instance.build();
+        }
+
+        return service;
     }
 }