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

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


The following commit(s) were added to refs/heads/main by this push:
     new 39925ee0244a CAMEL-23117: Add test infrastructure for PostgreSQL with 
pgvector extension (#21975)
39925ee0244a is described below

commit 39925ee0244a54b007bd9dfe383d5a028f23d7de
Author: Guillaume Nodet <[email protected]>
AuthorDate: Fri Mar 13 12:21:51 2026 +0100

    CAMEL-23117: Add test infrastructure for PostgreSQL with pgvector extension 
(#21975)
    
    Co-authored-by: Claude Opus 4.6 <[email protected]>
---
 .../apache/camel/catalog/test-infra/metadata.json  |  9 +++++
 .../src/generated/resources/META-INF/metadata.json |  9 +++++
 .../infra/postgres/common/PostgresProperties.java  |  1 +
 .../PostgresVectorLocalContainerInfraService.java  | 39 ++++++++++++++++++++++
 .../PostgresVectorLocalContainerService.java}      | 20 +++++------
 .../PostgresVectorServiceFactory.java}             | 22 ++++++------
 .../infra/postgres/services/container.properties   |  1 +
 7 files changed, 79 insertions(+), 22 deletions(-)

diff --git 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/test-infra/metadata.json
 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/test-infra/metadata.json
index 60e4a05aba7c..3bd7766bafb3 100644
--- 
a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/test-infra/metadata.json
+++ 
b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/test-infra/metadata.json
@@ -439,6 +439,15 @@
   "groupId" : "org.apache.camel",
   "artifactId" : "camel-test-infra-hivemq",
   "version" : "4.19.0-SNAPSHOT"
+}, {
+  "service" : 
"org.apache.camel.test.infra.postgres.services.PostgresInfraService",
+  "description" : "Postgres SQL Database with pgvector extension",
+  "implementation" : 
"org.apache.camel.test.infra.postgres.services.PostgresVectorLocalContainerInfraService",
+  "alias" : [ "postgres-vector", "pgvector" ],
+  "aliasImplementation" : [ ],
+  "groupId" : "org.apache.camel",
+  "artifactId" : "camel-test-infra-postgres",
+  "version" : "4.19.0-SNAPSHOT"
 }, {
   "service" : 
"org.apache.camel.test.infra.microprofile.lra.services.MicroprofileLRAInfraService",
   "description" : "Transaction Manager for microservices that is based on the 
SAGA pattern for distributed transaction.",
diff --git 
a/test-infra/camel-test-infra-all/src/generated/resources/META-INF/metadata.json
 
b/test-infra/camel-test-infra-all/src/generated/resources/META-INF/metadata.json
index 60e4a05aba7c..3bd7766bafb3 100644
--- 
a/test-infra/camel-test-infra-all/src/generated/resources/META-INF/metadata.json
+++ 
b/test-infra/camel-test-infra-all/src/generated/resources/META-INF/metadata.json
@@ -439,6 +439,15 @@
   "groupId" : "org.apache.camel",
   "artifactId" : "camel-test-infra-hivemq",
   "version" : "4.19.0-SNAPSHOT"
+}, {
+  "service" : 
"org.apache.camel.test.infra.postgres.services.PostgresInfraService",
+  "description" : "Postgres SQL Database with pgvector extension",
+  "implementation" : 
"org.apache.camel.test.infra.postgres.services.PostgresVectorLocalContainerInfraService",
+  "alias" : [ "postgres-vector", "pgvector" ],
+  "aliasImplementation" : [ ],
+  "groupId" : "org.apache.camel",
+  "artifactId" : "camel-test-infra-postgres",
+  "version" : "4.19.0-SNAPSHOT"
 }, {
   "service" : 
"org.apache.camel.test.infra.microprofile.lra.services.MicroprofileLRAInfraService",
   "description" : "Transaction Manager for microservices that is based on the 
SAGA pattern for distributed transaction.",
diff --git 
a/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
 
b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
index e44c9e897307..82ce8cd29acc 100644
--- 
a/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
+++ 
b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
@@ -24,6 +24,7 @@ public final class PostgresProperties {
     public static final String USERNAME = "postgres.user.name";
     public static final String PASSWORD = "postgres.user.password";
     public static final String POSTGRES_CONTAINER = "postgres.container";
+    public static final String POSTGRES_VECTOR_CONTAINER = 
"postgres.vector.container";
 
     public static final int DEFAULT_PORT = 5432;
 
diff --git 
a/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresVectorLocalContainerInfraService.java
 
b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresVectorLocalContainerInfraService.java
new file mode 100644
index 000000000000..860b0bd98bf6
--- /dev/null
+++ 
b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresVectorLocalContainerInfraService.java
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+package org.apache.camel.test.infra.postgres.services;
+
+import org.apache.camel.spi.annotations.InfraService;
+import org.apache.camel.test.infra.common.LocalPropertyResolver;
+import org.apache.camel.test.infra.postgres.common.PostgresProperties;
+
+@InfraService(service = PostgresInfraService.class,
+              description = "Postgres SQL Database with pgvector extension",
+              serviceAlias = { "postgres-vector", "pgvector" })
+public class PostgresVectorLocalContainerInfraService extends 
PostgresLocalContainerInfraService {
+
+    public static final String DEFAULT_POSTGRES_VECTOR_CONTAINER
+            = 
LocalPropertyResolver.getProperty(PostgresLocalContainerInfraService.class,
+                    PostgresProperties.POSTGRES_VECTOR_CONTAINER);
+
+    public PostgresVectorLocalContainerInfraService() {
+        super(DEFAULT_POSTGRES_VECTOR_CONTAINER);
+    }
+
+    public PostgresVectorLocalContainerInfraService(String imageName) {
+        super(imageName);
+    }
+}
diff --git 
a/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
 
b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresVectorLocalContainerService.java
similarity index 58%
copy from 
test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
copy to 
test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresVectorLocalContainerService.java
index e44c9e897307..dfea9d565eee 100644
--- 
a/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
+++ 
b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresVectorLocalContainerService.java
@@ -14,20 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+package org.apache.camel.test.infra.postgres.services;
 
-package org.apache.camel.test.infra.postgres.common;
+public class PostgresVectorLocalContainerService extends 
PostgresVectorLocalContainerInfraService
+        implements PostgresService {
 
-public final class PostgresProperties {
-    public static final String SERVICE_ADDRESS = "postgres.service.address";
-    public static final String HOST = "postgres.service.host";
-    public static final String PORT = "postgres.service.port";
-    public static final String USERNAME = "postgres.user.name";
-    public static final String PASSWORD = "postgres.user.password";
-    public static final String POSTGRES_CONTAINER = "postgres.container";
-
-    public static final int DEFAULT_PORT = 5432;
-
-    private PostgresProperties() {
+    public PostgresVectorLocalContainerService() {
+        super();
+    }
 
+    public PostgresVectorLocalContainerService(String imageName) {
+        super(imageName);
     }
 }
diff --git 
a/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
 
b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresVectorServiceFactory.java
similarity index 56%
copy from 
test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
copy to 
test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresVectorServiceFactory.java
index e44c9e897307..d0084ea87924 100644
--- 
a/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/common/PostgresProperties.java
+++ 
b/test-infra/camel-test-infra-postgres/src/main/java/org/apache/camel/test/infra/postgres/services/PostgresVectorServiceFactory.java
@@ -14,20 +14,22 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+package org.apache.camel.test.infra.postgres.services;
 
-package org.apache.camel.test.infra.postgres.common;
+import org.apache.camel.test.infra.common.services.SimpleTestServiceBuilder;
 
-public final class PostgresProperties {
-    public static final String SERVICE_ADDRESS = "postgres.service.address";
-    public static final String HOST = "postgres.service.host";
-    public static final String PORT = "postgres.service.port";
-    public static final String USERNAME = "postgres.user.name";
-    public static final String PASSWORD = "postgres.user.password";
-    public static final String POSTGRES_CONTAINER = "postgres.container";
+public final class PostgresVectorServiceFactory {
 
-    public static final int DEFAULT_PORT = 5432;
+    private PostgresVectorServiceFactory() {
+    }
 
-    private PostgresProperties() {
+    public static SimpleTestServiceBuilder<PostgresService> builder() {
+        return new SimpleTestServiceBuilder<>("postgres");
+    }
 
+    public static PostgresService createService() {
+        return 
builder().addLocalMapping(PostgresVectorLocalContainerService::new)
+                
.addRemoteMapping(PostgresServiceFactory.PostgresRemoteService::new)
+                .build();
     }
 }
diff --git 
a/test-infra/camel-test-infra-postgres/src/main/resources/org/apache/camel/test/infra/postgres/services/container.properties
 
b/test-infra/camel-test-infra-postgres/src/main/resources/org/apache/camel/test/infra/postgres/services/container.properties
index 3e2064435fa0..05471706ca7b 100644
--- 
a/test-infra/camel-test-infra-postgres/src/main/resources/org/apache/camel/test/infra/postgres/services/container.properties
+++ 
b/test-infra/camel-test-infra-postgres/src/main/resources/org/apache/camel/test/infra/postgres/services/container.properties
@@ -17,3 +17,4 @@
 postgres.container=mirror.gcr.io/postgres:17.9-alpine
 postgres.container.version.include=alpine
 postgres.container.version.freeze.major=true
+postgres.vector.container=pgvector/pgvector:pg17

Reply via email to