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 0d64112714aba35df135f6ce76cc08c4e04864c0 Author: JiriOndrusek <ondrusek.j...@gmail.com> AuthorDate: Wed May 3 08:38:54 2023 +0200 Remove camel-quarkus-solr permanently because it was removed from Camel in CAMEL-19290 --- extensions/pom.xml | 1 - extensions/solr/deployment/pom.xml | 73 ------ .../component/solr/deployment/SolrProcessor.java | 86 ------- extensions/solr/pom.xml | 37 --- extensions/solr/runtime/pom.xml | 114 --------- .../main/resources/META-INF/quarkus-extension.yaml | 32 --- integration-tests/pom.xml | 1 - integration-tests/solr/pom.xml | 205 ---------------- .../component/solr/it/SolrCloudResource.java | 45 ---- .../component/solr/it/SolrCommonResource.java | 185 --------------- .../quarkus/component/solr/it/SolrSslResource.java | 42 ---- .../component/solr/it/SolrStandaloneResource.java | 41 ---- .../camel/quarkus/component/solr/it/bean/Item.java | 47 ---- .../solr/src/main/resources/application.properties | 21 -- .../camel/quarkus/component/solr/it/SolrIT.java | 23 -- .../camel/quarkus/component/solr/it/SolrTest.java | 263 --------------------- .../component/solr/it/SolrTestResource.java | 154 ------------ .../src/test/resources/cloud-docker-compose.yml | 54 ----- .../resources/cloud-docker-compose_nonlinux.yml | 58 ----- .../solr/src/test/resources/ssl/README.adoc | 6 - .../solr/src/test/resources/ssl/solr-ssl.der | 22 -- .../src/test/resources/ssl/solr-ssl.keystore.jks | Bin 2659 -> 0 bytes tooling/scripts/test-categories.yaml | 1 - 23 files changed, 1511 deletions(-) diff --git a/extensions/pom.xml b/extensions/pom.xml index e9701c4225..26208f8d9d 100644 --- a/extensions/pom.xml +++ b/extensions/pom.xml @@ -218,7 +218,6 @@ <!--<module>smallrye-reactive-messaging</module> https://github.com/apache/camel-quarkus/issues/4464 --> <module>snakeyaml</module> <module>soap</module> - <module>solr</module> <module>splunk</module> <module>spring-rabbitmq</module> <module>sql</module> diff --git a/extensions/solr/deployment/pom.xml b/extensions/solr/deployment/pom.xml deleted file mode 100644 index ee048683a3..0000000000 --- a/extensions/solr/deployment/pom.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-solr-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-solr-deployment</artifactId> - <name>Camel Quarkus :: Solr :: Deployment</name> - - <dependencies> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-core-deployment</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-solr</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-support-httpclient-deployment</artifactId> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-netty-deployment</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-support-commons-logging-deployment</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths> - <path> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-extension-processor</artifactId> - <version>${quarkus.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/extensions/solr/deployment/src/main/java/org/apache/camel/quarkus/component/solr/deployment/SolrProcessor.java b/extensions/solr/deployment/src/main/java/org/apache/camel/quarkus/component/solr/deployment/SolrProcessor.java deleted file mode 100644 index 250a56e1eb..0000000000 --- a/extensions/solr/deployment/src/main/java/org/apache/camel/quarkus/component/solr/deployment/SolrProcessor.java +++ /dev/null @@ -1,86 +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. - */ -package org.apache.camel.quarkus.component.solr.deployment; - -import java.util.stream.Stream; - -import io.quarkus.deployment.annotations.BuildProducer; -import io.quarkus.deployment.annotations.BuildStep; -import io.quarkus.deployment.builditem.CombinedIndexBuildItem; -import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem; -import io.quarkus.deployment.builditem.FeatureBuildItem; -import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem; -import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; -import org.apache.zookeeper.ClientCnxnSocketNIO; -import org.jboss.jandex.AnnotationTarget; -import org.jboss.jandex.ClassInfo; -import org.jboss.jandex.DotName; - -class SolrProcessor { - - private static final String FEATURE = "camel-solr"; - private static final DotName FIELD_DOT_NAME = DotName.createSimple("org.apache.solr.client.solrj.beans.Field"); - - @BuildStep - FeatureBuildItem feature() { - return new FeatureBuildItem(FEATURE); - } - - @BuildStep - ExtensionSslNativeSupportBuildItem activateSslNativeSupport() { - return new ExtensionSslNativeSupportBuildItem(FEATURE); - } - - @BuildStep - void registerForReflection(BuildProducer<ReflectiveClassBuildItem> reflectiveClass, CombinedIndexBuildItem combinedIndex) { - // Register any classes within the application archive that contain the Solr Field annotation - combinedIndex.getIndex() - .getAnnotations(FIELD_DOT_NAME) - .stream() - .map(annotationInstance -> { - AnnotationTarget target = annotationInstance.target(); - AnnotationTarget.Kind kind = target.kind(); - if (kind.equals(AnnotationTarget.Kind.FIELD)) { - ClassInfo classInfo = target.asField().declaringClass(); - return ReflectiveClassBuildItem.builder(classInfo.name().toString()).fields() - .build(); - } else if (kind.equals(AnnotationTarget.Kind.METHOD)) { - ClassInfo classInfo = target.asMethod().declaringClass(); - return ReflectiveClassBuildItem.builder(classInfo.name().toString()).methods() - .build(); - } else { - throw new RuntimeException( - FIELD_DOT_NAME.toString() + " cannot be applied to " + target.kind().toString()); - } - }) - .forEach(reflectiveClass::produce); - - reflectiveClass.produce( - ReflectiveClassBuildItem.builder(ClientCnxnSocketNIO.class.getName()).build()); - } - - @BuildStep - void runtimeInitializedClasses(BuildProducer<RuntimeInitializedClassBuildItem> runtimeInitializedClasses) { - Stream.of( - "org.apache.solr.client.solrj.routing.RequestReplicaListTransformerGenerator", - "org.apache.zookeeper.Login" // Move this to a separate support extension if it turns out to be needed in multiple top level extensions - ) - .map(RuntimeInitializedClassBuildItem::new) - .forEach(runtimeInitializedClasses::produce); - } - -} diff --git a/extensions/solr/pom.xml b/extensions/solr/pom.xml deleted file mode 100644 index 07fd50c503..0000000000 --- a/extensions/solr/pom.xml +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-extensions</artifactId> - <version>3.0.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-solr-parent</artifactId> - <name>Camel Quarkus :: Solr</name> - <packaging>pom</packaging> - - <modules> - <module>deployment</module> - <module>runtime</module> - </modules> -</project> diff --git a/extensions/solr/runtime/pom.xml b/extensions/solr/runtime/pom.xml deleted file mode 100644 index 6e0787f668..0000000000 --- a/extensions/solr/runtime/pom.xml +++ /dev/null @@ -1,114 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-solr-parent</artifactId> - <version>3.0.0-SNAPSHOT</version> - <relativePath>../pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-solr</artifactId> - <name>Camel Quarkus :: Solr :: Runtime</name> - <description>Perform operations against Apache Lucene Solr.</description> - - <properties> - <camel.quarkus.jvmSince>1.1.0</camel.quarkus.jvmSince> - <camel.quarkus.nativeSince>1.5.0</camel.quarkus.nativeSince> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-core</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel</groupId> - <artifactId>camel-solr</artifactId> - </dependency> - <dependency> - <groupId>org.eclipse.angus</groupId> - <artifactId>angus-activation</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-support-httpclient</artifactId> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-netty</artifactId> - </dependency> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-support-commons-logging</artifactId> - </dependency> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-extension-maven-plugin</artifactId> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <annotationProcessorPaths> - <path> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-extension-processor</artifactId> - <version>${quarkus.version}</version> - </path> - </annotationProcessorPaths> - </configuration> - </plugin> - </plugins> - </build> - - <profiles> - <profile> - <id>full</id> - <activation> - <property> - <name>!quickly</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-maven-plugin</artifactId> - <executions> - <execution> - <id>update-extension-doc-page</id> - <goals> - <goal>update-extension-doc-page</goal> - </goals> - <phase>process-classes</phase> - </execution> - </executions> - </plugin> - </plugins> - </build> - </profile> - </profiles> -</project> diff --git a/extensions/solr/runtime/src/main/resources/META-INF/quarkus-extension.yaml b/extensions/solr/runtime/src/main/resources/META-INF/quarkus-extension.yaml deleted file mode 100644 index 4cc8e67a95..0000000000 --- a/extensions/solr/runtime/src/main/resources/META-INF/quarkus-extension.yaml +++ /dev/null @@ -1,32 +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. -# - -# This is a generated file. Do not edit directly! -# To re-generate, run the following command from the top level directory: -# -# mvn -N cq:update-quarkus-metadata -# ---- -name: "Camel Solr" -description: "Perform operations against Apache Lucene Solr" -icon-url: "https://camel.apache.org/_/img/logo-d-f21b25ba38.svg" -metadata: - guide: "https://camel.apache.org/camel-quarkus/latest/reference/extensions/solr.html" - categories: - - "integration" - status: - - "stable" diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml index fd5092906b..1baa5b4450 100644 --- a/integration-tests/pom.xml +++ b/integration-tests/pom.xml @@ -205,7 +205,6 @@ <module>slack</module> <!--<module>smallrye-reactive-messaging</module>--> <module>soap</module> - <module>solr</module> <module>splunk</module> <module>spring-rabbitmq</module> <module>sql</module> diff --git a/integration-tests/solr/pom.xml b/integration-tests/solr/pom.xml deleted file mode 100644 index 480cabbb31..0000000000 --- a/integration-tests/solr/pom.xml +++ /dev/null @@ -1,205 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - 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. - ---> -<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> - <modelVersion>4.0.0</modelVersion> - <parent> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-build-parent-it</artifactId> - <version>3.0.0-SNAPSHOT</version> - <relativePath>../../poms/build-parent-it/pom.xml</relativePath> - </parent> - - <artifactId>camel-quarkus-integration-test-solr</artifactId> - <name>Camel Quarkus :: Integration Tests :: Solr</name> - <description>Integration tests for Camel Quarkus Solr extension</description> - - <properties> - <camel-quarkus.version>3.0.0-SNAPSHOT</camel-quarkus.version> - <solr.trust-store>${project.basedir}/target/ssl/trust-store.jks</solr.trust-store> - </properties> - - <dependencies> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-solr</artifactId> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-resteasy</artifactId> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-resteasy-jackson</artifactId> - </dependency> - - <!-- test dependencies --> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-junit5</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>io.rest-assured</groupId> - <artifactId>rest-assured</artifactId> - <scope>test</scope> - </dependency> - <dependency> - <groupId>org.testcontainers</groupId> - <artifactId>solr</artifactId> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - </exclusion> - </exclusions> - </dependency> - <dependency> - <groupId>io.quarkus</groupId> - <artifactId>quarkus-junit4-mock</artifactId> - <scope>test</scope> - </dependency> - </dependencies> - - <build> - <resources> - <resource> - <directory>src/main/resources</directory> - <filtering>true</filtering> - </resource> - </resources> - </build> - - <profiles> - <profile> - <id>full</id> - <activation> - <property> - <name>!quickly</name> - </property> - </activation> - <build> - <plugins> - <plugin> - <groupId>org.codehaus.mojo</groupId> - <artifactId>exec-maven-plugin</artifactId> - <executions> - <execution> - <id>extend-default-trust-store-extension</id> - <phase>test-compile</phase> - <goals> - <goal>java</goal> - </goals> - <configuration> - <additionalClasspathElements>${basedir}/target/test-classes</additionalClasspathElements> - <mainClass>org.apache.camel.quarkus.test.ExtendDefaultTrustStore</mainClass> - <arguments> - <argument>${solr.trust-store}</argument> - <argument>ssl/solr-ssl.der</argument> - </arguments> - <includePluginDependencies>true</includePluginDependencies> - </configuration> - </execution> - </executions> - <dependencies> - <dependency> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-integration-test-support</artifactId> - <version>${camel-quarkus.version}</version> - </dependency> - </dependencies> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <systemPropertyVariables> - <javax.net.ssl.trustStore>${solr.trust-store}</javax.net.ssl.trustStore> - </systemPropertyVariables> - </configuration> - </plugin> - </plugins> - </build> - </profile> - <profile> - <id>native</id> - <activation> - <property> - <name>native</name> - </property> - </activation> - <properties> - <quarkus.package.type>native</quarkus.package.type> - </properties> - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <executions> - <execution> - <goals> - <goal>integration-test</goal> - <goal>verify</goal> - </goals> - </execution> - </executions> - </plugin> - </plugins> - </build> - </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> - <groupId>org.apache.camel.quarkus</groupId> - <artifactId>camel-quarkus-solr-deployment</artifactId> - <version>${project.version}</version> - <type>pom</type> - <scope>test</scope> - <exclusions> - <exclusion> - <groupId>*</groupId> - <artifactId>*</artifactId> - </exclusion> - </exclusions> - </dependency> - </dependencies> - </profile> - <profile> - <id>skip-testcontainers-tests</id> - <activation> - <property> - <name>skip-testcontainers-tests</name> - </property> - </activation> - <properties> - <skipTests>true</skipTests> - </properties> - </profile> - </profiles> - -</project> diff --git a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrCloudResource.java b/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrCloudResource.java deleted file mode 100644 index bd4d90f785..0000000000 --- a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrCloudResource.java +++ /dev/null @@ -1,45 +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. - */ -package org.apache.camel.quarkus.component.solr.it; - -import io.quarkus.runtime.StartupEvent; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import org.apache.solr.client.solrj.impl.HttpSolrClient; -import org.eclipse.microprofile.config.inject.ConfigProperty; - -@ApplicationScoped -@Path("/solr/cloud") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class SolrCloudResource extends SolrCommonResource { - - @ConfigProperty(name = "solr.cloud.component.url", defaultValue = "localhost:8981/solr?zkHost=localhost:1281&collection=collection1&username=solr&password=SolrRocks") - String solrComponentUrl; - - @ConfigProperty(name = "solr.cloud.url", defaultValue = "localhost:8981/solr/collection1") - String solrUrl; - - public void init(@Observes StartupEvent startupEvent) { - solrComponentURI = String.format("solrCloud://%s", solrComponentUrl); - solrClient = new HttpSolrClient.Builder(String.format("http://%s", solrUrl)).build(); - } -} diff --git a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrCommonResource.java b/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrCommonResource.java deleted file mode 100644 index 13c0898ba0..0000000000 --- a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrCommonResource.java +++ /dev/null @@ -1,185 +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. - */ -package org.apache.camel.quarkus.component.solr.it; - -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; - -import io.quarkus.runtime.StartupEvent; -import jakarta.inject.Inject; -import jakarta.ws.rs.DELETE; -import jakarta.ws.rs.GET; -import jakarta.ws.rs.PUT; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.PathParam; -import jakarta.ws.rs.core.Response; -import org.apache.camel.ProducerTemplate; -import org.apache.camel.component.solr.SolrConstants; -import org.apache.camel.quarkus.component.solr.it.bean.Item; -import org.apache.solr.client.solrj.SolrQuery; -import org.apache.solr.client.solrj.SolrServerException; -import org.apache.solr.client.solrj.impl.HttpSolrClient; -import org.apache.solr.client.solrj.request.QueryRequest; -import org.apache.solr.client.solrj.response.QueryResponse; -import org.apache.solr.client.solrj.util.ClientUtils; -import org.apache.solr.common.SolrInputDocument; - -public abstract class SolrCommonResource { - - @Inject - ProducerTemplate producerTemplate; - - /** - * solr camel component URI - */ - String solrComponentURI; - - /** - * used to check data - */ - HttpSolrClient solrClient; - - /** - * inits the params solrComponentURI and solrClient - * - * @param startupEvent - */ - public abstract void init(StartupEvent startupEvent); - - @PUT - @Path("bean") - public Response addBean(String name) { - Item bean = createItem(name); - producerTemplate.sendBodyAndHeader(solrComponentURI, bean, SolrConstants.OPERATION, SolrConstants.OPERATION_ADD_BEAN); - solrCommit(); - return Response.accepted().build(); - } - - @PUT - @Path("beans") - public Response addBeans(List<String> names) { - List<Item> beans = names.stream().map(this::createItem).collect(Collectors.toList()); - producerTemplate.sendBodyAndHeader(solrComponentURI, beans, SolrConstants.OPERATION, SolrConstants.OPERATION_ADD_BEANS); - solrCommit(); - return Response.accepted().build(); - } - - @DELETE - @Path("bean") - public Response deleteBeanById(String id) { - producerTemplate.sendBodyAndHeader(solrComponentURI, id, SolrConstants.OPERATION, SolrConstants.OPERATION_DELETE_BY_ID); - solrCommit(); - return Response.accepted().build(); - } - - @DELETE - @Path("beans") - public Response deleteByIdPrefix(String idPrefix) { - producerTemplate.sendBodyAndHeader(solrComponentURI, String.format("id:%s*", idPrefix), SolrConstants.OPERATION, - SolrConstants.OPERATION_DELETE_BY_QUERY); - solrCommit(); - return Response.accepted().build(); - } - - @PUT - @Path("document/commit") - public Response insertAndCommit(Map<String, Object> fields) { - solrInsert(fields); - solrCommit(); - return Response.accepted().build(); - } - - @PUT - @Path("document") - public Response insertDocument(Map<String, Object> fields) { - solrInsert(fields); - return Response.accepted().build(); - } - - private void solrInsert(Map<String, Object> fields) { - String docAsXml = createDocument(fields); - producerTemplate.sendBodyAndHeader(solrComponentURI, docAsXml, SolrConstants.OPERATION, SolrConstants.OPERATION_INSERT); - } - - private String createDocument(Map<String, Object> fields) { - SolrInputDocument doc = new SolrInputDocument(); - fields.forEach((key, value) -> doc.addField(key, value)); - return ClientUtils.toXML(doc); - } - - @GET - @Path("optimize") - public Response optimize() { - producerTemplate.sendBodyAndHeader(solrComponentURI, null, SolrConstants.OPERATION, SolrConstants.OPERATION_OPTIMIZE); - return Response.accepted().build(); - } - - @GET - @Path("rollback") - public Response rollback() { - producerTemplate.sendBodyAndHeader(solrComponentURI, null, SolrConstants.OPERATION, SolrConstants.OPERATION_ROLLBACK); - return Response.accepted().build(); - } - - @GET - @Path("commit") - public Response commit() { - solrCommit(); - return Response.accepted().build(); - } - - @GET - @Path("softcommit") - public Response softcommit() { - producerTemplate.sendBodyAndHeader(solrComponentURI, null, SolrConstants.OPERATION, - SolrConstants.OPERATION_SOFT_COMMIT); - return Response.accepted().build(); - } - - @PUT - @Path("streaming") - public Response insertStreaming(Map<String, Object> fields) { - String docAsXml = createDocument(fields); - producerTemplate.sendBodyAndHeader(solrComponentURI, docAsXml, SolrConstants.OPERATION, - SolrConstants.OPERATION_INSERT_STREAMING); - return Response.accepted().build(); - } - - private void solrCommit() { - producerTemplate.sendBodyAndHeader(solrComponentURI, null, SolrConstants.OPERATION, SolrConstants.OPERATION_COMMIT); - } - - @GET - @Path("bean/{id}") - public String getBeanById(@PathParam("id") String id) throws IOException, SolrServerException { - SolrQuery solrQuery = new SolrQuery(); - solrQuery.set("q", "id:" + id); - QueryRequest queryRequest = new QueryRequest(solrQuery); - QueryResponse response = queryRequest.process(solrClient); - List<Item> responses = response.getBeans(Item.class); - return responses.size() != 0 ? responses.get(0).getId() : ""; - } - - private Item createItem(String id) { - Item item = new Item(); - item.setId(id); - item.setCategories(new String[] { "aaa", "bbb", "ccc" }); - return item; - } -} diff --git a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrSslResource.java b/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrSslResource.java deleted file mode 100644 index b165435e0c..0000000000 --- a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrSslResource.java +++ /dev/null @@ -1,42 +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. - */ -package org.apache.camel.quarkus.component.solr.it; - -import io.quarkus.runtime.StartupEvent; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import org.apache.solr.client.solrj.impl.HttpSolrClient; -import org.eclipse.microprofile.config.inject.ConfigProperty; - -@Path("/solr/ssl") -@ApplicationScoped -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class SolrSslResource extends SolrCommonResource { - @ConfigProperty(name = "solr.ssl.url", defaultValue = "localhost:8984/solr/collection1") - String solrUrl; - - public void init(@Observes StartupEvent startupEvent) { - solrComponentURI = String.format("solrs://%s", solrUrl); - solrClient = new HttpSolrClient.Builder(String.format("https://%s", solrUrl)).build(); - } - -} diff --git a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrStandaloneResource.java b/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrStandaloneResource.java deleted file mode 100644 index eea659b9b2..0000000000 --- a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/SolrStandaloneResource.java +++ /dev/null @@ -1,41 +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. - */ -package org.apache.camel.quarkus.component.solr.it; - -import io.quarkus.runtime.StartupEvent; -import jakarta.enterprise.context.ApplicationScoped; -import jakarta.enterprise.event.Observes; -import jakarta.ws.rs.Consumes; -import jakarta.ws.rs.Path; -import jakarta.ws.rs.Produces; -import jakarta.ws.rs.core.MediaType; -import org.apache.solr.client.solrj.impl.HttpSolrClient; -import org.eclipse.microprofile.config.inject.ConfigProperty; - -@Path("/solr/standalone") -@ApplicationScoped -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) -public class SolrStandaloneResource extends SolrCommonResource { - @ConfigProperty(name = "solr.standalone.url", defaultValue = "localhost:8983/solr/collection1") - String solrUrl; - - public void init(@Observes StartupEvent startupEvent) { - solrComponentURI = String.format("solr://%s", solrUrl); - solrClient = new HttpSolrClient.Builder(String.format("http://%s", solrUrl)).build(); - } -} diff --git a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/bean/Item.java b/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/bean/Item.java deleted file mode 100644 index 114b96b0ff..0000000000 --- a/integration-tests/solr/src/main/java/org/apache/camel/quarkus/component/solr/it/bean/Item.java +++ /dev/null @@ -1,47 +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. - */ -package org.apache.camel.quarkus.component.solr.it.bean; - -import org.apache.solr.client.solrj.beans.Field; - -public class Item { - - String id; - - @Field("cat") - String[] categories; - - public Item() { - } - - public String getId() { - return id; - } - - @Field - public void setId(String id) { - this.id = id; - } - - public String[] getCategories() { - return categories; - } - - public void setCategories(String[] categories) { - this.categories = categories; - } -} diff --git a/integration-tests/solr/src/main/resources/application.properties b/integration-tests/solr/src/main/resources/application.properties deleted file mode 100644 index 8969816093..0000000000 --- a/integration-tests/solr/src/main/resources/application.properties +++ /dev/null @@ -1,21 +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. -## --------------------------------------------------------------------------- -quarkus.native.resources.includes = ssl/** - -# target/ssl/trust-store.jks can be created by executing ExtendDefaultTrustStore.main(). That must happen -# before running the build mojo of Quarkus Maven plugin -quarkus.native.additional-build-args = -J-Djavax.net.ssl.trustStore=${project.basedir}/target/ssl/trust-store.jks \ No newline at end of file diff --git a/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrIT.java b/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrIT.java deleted file mode 100644 index 948b9de6c0..0000000000 --- a/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrIT.java +++ /dev/null @@ -1,23 +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. - */ -package org.apache.camel.quarkus.component.solr.it; - -import io.quarkus.test.junit.QuarkusIntegrationTest; - -@QuarkusIntegrationTest -public class SolrIT extends SolrTest { -} diff --git a/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTest.java b/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTest.java deleted file mode 100644 index e317ac1a27..0000000000 --- a/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTest.java +++ /dev/null @@ -1,263 +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. - */ -package org.apache.camel.quarkus.component.solr.it; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.stream.Stream; - -import io.quarkus.test.common.QuarkusTestResource; -import io.quarkus.test.junit.QuarkusTest; -import io.restassured.http.ContentType; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; -import org.junit.jupiter.params.provider.ValueSource; - -import static io.restassured.RestAssured.given; -import static org.hamcrest.Matchers.emptyOrNullString; -import static org.hamcrest.Matchers.equalTo; - -@QuarkusTest -@QuarkusTestResource(SolrTestResource.class) -public class SolrTest { - /** - * Quarkus resources to test - * - * @return - */ - private static Stream<String> resources() { - return Stream.of("/solr/standalone", "/solr/ssl", "/solr/cloud"); - } - - @ParameterizedTest - @MethodSource("resources") - public void testSingleBean(String resource) { - // create a bean item - given() - .contentType(ContentType.JSON) - .body("test1") - .put(resource + "/bean") - .then() - .statusCode(202); - // verify existing bean - given() - .get(resource + "/bean/test1") - .then() - .body(equalTo("test1")); - - // delete bean by id - given() - .contentType(ContentType.JSON) - .body("test1") - .delete(resource + "/bean") - .then() - .statusCode(202); - // verify non existing bean - given() - .get(resource + "/bean/test1") - .then() - .body(emptyOrNullString()); - } - - @ParameterizedTest - @MethodSource("resources") - public void testMultipleBeans(String resource) { - // create list of beans - List<String> beanNames = new ArrayList<>(); - beanNames.add("bean1"); - beanNames.add("bean2"); - - // add beans with camel - given() - .contentType(ContentType.JSON) - .body(beanNames) - .put(resource + "/beans") - .then() - .statusCode(202); - - // verify existing beans - given() - .get(resource + "/bean/bean1") - .then() - .body(equalTo("bean1")); - given() - .get(resource + "/bean/bean2") - .then() - .body(equalTo("bean2")); - - // delete all beans that has id begins with bean - given() - .contentType(ContentType.JSON) - .body("bean") - .delete(resource + "/beans") - .then() - .statusCode(202); - - // verify non existing beans - given() - .get(resource + "/bean/bean1") - .then() - .body(emptyOrNullString()); - given() - .get(resource + "/bean/bean2") - .then() - .body(emptyOrNullString()); - } - - @ParameterizedTest - @MethodSource("resources") - public void testInsertId(String resource) { - Map<String, Object> fields = new HashMap<>(); - fields.put("id", "id1"); - - //insert and commit document - given() - .contentType(ContentType.JSON) - .body(fields) - .put(resource + "/document/commit") - .then() - .statusCode(202); - - // verify existing document - given() - .get(resource + "/bean/id1") - .then() - .body(equalTo("id1")); - - } - - @ParameterizedTest - @MethodSource("resources") - public void testOptimize(String resource) { - Map<String, Object> fields = new HashMap<>(); - fields.put("id", "opt1"); - // insert without commit - given() - .contentType(ContentType.JSON) - .body(fields) - .put(resource + "/document") - .then() - .statusCode(202); - // verify non existing document - given() - .get(resource + "/bean/opt1") - .then() - .body(emptyOrNullString()); - // optimize - given() - .get(resource + "/optimize") - .then() - .statusCode(202); - // verify existing document - given() - .get(resource + "/bean/opt1") - .then() - .body(equalTo("opt1")); - - } - - // Rollback is currently not supported in SolrCloud mode (SOLR-4895). So limiting this test to standalone and standalone with SSL modes - @ParameterizedTest - @ValueSource(strings = { "/solr/standalone", "/solr/ssl" }) - public void testRollback(String resource) { - Map<String, Object> fields = new HashMap<>(); - fields.put("id", "roll1"); - // insert without commit - given() - .contentType(ContentType.JSON) - .body(fields) - .put(resource + "/document") - .then() - .statusCode(202); - // verify non existing document - given() - .get(resource + "/bean/roll1") - .then() - .body(emptyOrNullString()); - // rollback - given() - .get(resource + "/rollback") - .then() - .statusCode(202); - //then commit - given() - .get(resource + "/commit") - .then() - .statusCode(202); - // verify non existing document - given() - .get(resource + "/bean/roll1") - .then() - .body(emptyOrNullString()); - } - - @ParameterizedTest - @MethodSource("resources") - public void testSoftCommit(String resource) { - Map<String, Object> fields = new HashMap<>(); - fields.put("id", "com1"); - // insert without commit - given() - .contentType(ContentType.JSON) - .body(fields) - .put(resource + "/document") - .then() - .statusCode(202); - // verify non existing document - given() - .get(resource + "/bean/com1") - .then() - .body(emptyOrNullString()); - // soft commit - given() - .get(resource + "/softcommit") - .then() - .statusCode(202); - // verify existing document - given() - .get(resource + "/bean/com1") - .then() - .body(equalTo("com1")); - } - - @ParameterizedTest - @MethodSource("resources") - public void testInsertStreaming(String resource) throws InterruptedException { - Map<String, Object> fields = new HashMap<>(); - fields.put("id", "stream1"); - // insert with streaming mode - given() - .contentType(ContentType.JSON) - .body(fields) - .put(resource + "/streaming") - .then() - .statusCode(202); - // wait before commit - Thread.sleep(500); - given() - .get(resource + "/commit") - .then() - .statusCode(202); - // verify existing document - given() - .get(resource + "/bean/stream1") - .then() - .body(equalTo("stream1")); - } -} diff --git a/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTestResource.java b/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTestResource.java deleted file mode 100644 index a335f48976..0000000000 --- a/integration-tests/solr/src/test/java/org/apache/camel/quarkus/component/solr/it/SolrTestResource.java +++ /dev/null @@ -1,154 +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. - */ -package org.apache.camel.quarkus.component.solr.it; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.file.Files; -import java.nio.file.StandardCopyOption; -import java.util.Map; - -import io.quarkus.test.common.QuarkusTestResourceLifecycleManager; -import org.apache.camel.util.CollectionHelper; -import org.apache.commons.lang3.SystemUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.testcontainers.containers.BindMode; -import org.testcontainers.containers.DockerComposeContainer; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.containers.SolrContainer; -import org.testcontainers.containers.output.Slf4jLogConsumer; -import org.testcontainers.containers.wait.strategy.Wait; -import org.testcontainers.utility.DockerImageName; - -public class SolrTestResource implements QuarkusTestResourceLifecycleManager { - - private static final Logger LOGGER = LoggerFactory.getLogger(SolrTestResource.class); - - private static final DockerImageName SOLR_IMAGE = DockerImageName.parse("solr:8.7.0"); - private static final String COLLECTION_NAME = "collection1"; - private static final String URL_FORMAT = "localhost:%s/solr/collection1"; - private static final String CLOUD_COMPONENT_URL_FORMAT = "localhost:%s/solr?zkHost=localhost:%s&collection=collection1&username=solr&password=SolrRocks"; - private static final int ZOOKEEPER_PORT = 2181; - private static final int SOLR_PORT = 8983; - - private SolrContainer standaloneContainer; - private SolrContainer sslContainer; - private DockerComposeContainer cloudContainer; - - @Override - public Map<String, String> start() { - // creates 3 containers for 3 different modes of using SOLR - createContainers(); - // start containers - startContainers(cloudContainer, standaloneContainer, sslContainer); - // return custom URLs - return CollectionHelper.mapOf("solr.standalone.url", String.format(URL_FORMAT, standaloneContainer.getSolrPort()), - "solr.ssl.url", String.format(URL_FORMAT, sslContainer.getSolrPort()), - "solr.cloud.url", String.format(URL_FORMAT, cloudContainer.getServicePort("solr1", SOLR_PORT)), - "solr.cloud.component.url", String.format(CLOUD_COMPONENT_URL_FORMAT, - cloudContainer.getServicePort("solr1", SOLR_PORT), - cloudContainer.getServicePort("zoo1", ZOOKEEPER_PORT))); - } - - private void createContainers() { - createStandaloneContainer(); - createSslContainer(); - createCloudContainer(); - } - - private void startContainers(DockerComposeContainer dc, GenericContainer... containers) { - for (GenericContainer container : containers) { - container.start(); - } - - dc.start(); - } - - /** - * creates a standalone container - */ - private void createStandaloneContainer() { - standaloneContainer = new SolrContainer(SOLR_IMAGE) - .withCollection(COLLECTION_NAME) - .withZookeeper(false) - .withLogConsumer(new Slf4jLogConsumer(LOGGER)); - } - - /** - * creates a standalone container with SSL - */ - private void createSslContainer() { - sslContainer = new SolrContainer(SOLR_IMAGE) - .withCollection(COLLECTION_NAME) - .withZookeeper(false) - .withClasspathResourceMapping("ssl", "/ssl", BindMode.READ_ONLY) - .withEnv("SOLR_SSL_ENABLED", "true") - .withEnv("SOLR_SSL_KEY_STORE", "/ssl/solr-ssl.keystore.jks") - .withEnv("SOLR_SSL_KEY_STORE_PASSWORD", "secret") - .withEnv("SOLR_SSL_TRUST_STORE", "/ssl/solr-ssl.keystore.jks") - .withEnv("SOLR_SSL_TRUST_STORE_PASSWORD", "secret") - .withEnv("SOLR_SSL_NEED_CLIENT_AUTH", "false") - .withEnv("SOLR_SSL_WANT_CLIENT_AUTH", "false") - .withEnv("SOLR_SSL_CHECK_PEER_NAME", "true") - .withEnv("SOLR_SSL_KEY_STORE_TYPE", "JKS") - .withEnv("SOLR_SSL_TRUST_STORE_TYPE", "JKS") - .withLogConsumer(new Slf4jLogConsumer(LOGGER)); - - } - - /** - * creates a cloud container with zookeeper - */ - private void createCloudContainer() { - final String resource = SystemUtils.IS_OS_LINUX ? "cloud-docker-compose.yml" : "cloud-docker-compose_nonlinux.yml"; - try { - final File file = File.createTempFile(SolrTestResource.class.getSimpleName() + "-", resource); - file.deleteOnExit(); - try (InputStream in = this.getClass().getClassLoader().getResourceAsStream(resource)) { - Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING); - } catch (IOException e) { - throw new RuntimeException("Could not copy class path resource " + resource + " to " + file, e); - } - cloudContainer = new DockerComposeContainer(file) - .withExposedService("solr1", SOLR_PORT) - .withExposedService("zoo1", ZOOKEEPER_PORT) - .waitingFor("create-collection", Wait.forLogMessage(".*Created collection 'collection1'.*", 1)); - } catch (IOException e) { - throw new RuntimeException("Could not create temporary file", e); - } - - } - - @Override - public void stop() { - stopContainers(cloudContainer, standaloneContainer, sslContainer); - } - - private void stopContainers(DockerComposeContainer dc, GenericContainer... containers) { - for (GenericContainer container : containers) { - if (container != null) { - container.stop(); - } - } - - if (dc != null) { - dc.stop(); - } - } -} diff --git a/integration-tests/solr/src/test/resources/cloud-docker-compose.yml b/integration-tests/solr/src/test/resources/cloud-docker-compose.yml deleted file mode 100644 index e5d820319f..0000000000 --- a/integration-tests/solr/src/test/resources/cloud-docker-compose.yml +++ /dev/null @@ -1,54 +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. -# - -# based on https://raw.githubusercontent.com/docker-solr/docker-solr-examples/master/docker-compose/docker-compose.yml -version: '3.7' -services: - solr1: - image: solr:8.7.0 - environment: - - ZK_HOST=zoo1:2181 - networks: - - solr - depends_on: - - zoo1 - - zoo1: - image: zookeeper:3.6.2 - restart: always - hostname: zoo1 - environment: - ZOO_MY_ID: 1 - ZOO_SERVERS: server.1=zoo1:2888:3888;2181 - networks: - - solr - - create-collection: - image: solr:8.7.0 - environment: - - SOLR_HOST=solr1 - networks: - - solr - command: - - bash - - "-e" - - "-x" - - "-c" - - "wait-for-solr.sh --max-attempts 10 --wait-seconds 5 --solr-url http://$$SOLR_HOST:8983/; solr create_collection -c collection1 -p 8983" - -networks: - solr: diff --git a/integration-tests/solr/src/test/resources/cloud-docker-compose_nonlinux.yml b/integration-tests/solr/src/test/resources/cloud-docker-compose_nonlinux.yml deleted file mode 100644 index 7fa239a770..0000000000 --- a/integration-tests/solr/src/test/resources/cloud-docker-compose_nonlinux.yml +++ /dev/null @@ -1,58 +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. -# - -# based on https://raw.githubusercontent.com/docker-solr/docker-solr-examples/master/docker-compose/docker-compose.yml -version: '3.7' -services: - solr1: - image: solr:8.7.0 - ports: - - "8983:8983" - environment: - - ZK_HOST=zoo1:2181 - - SOLR_PORT=8983 - - SOLR_HOST=localhost - networks: - - solr - depends_on: - - zoo1 - - zoo1: - image: zookeeper:3.6.2 - restart: always - hostname: zoo1 - environment: - ZOO_MY_ID: 1 - ZOO_SERVERS: server.1=zoo1:2888:3888;2181 - networks: - - solr - - create-collection: - image: solr:8.7.0 - environment: - - SOLR_HOST=solr1 - networks: - - solr - command: - - bash - - "-e" - - "-x" - - "-c" - - "wait-for-solr.sh --max-attempts 10 --wait-seconds 5 --solr-url http://$$SOLR_HOST:8983/; solr create_collection -c collection1 -p 8983" - -networks: - solr: diff --git a/integration-tests/solr/src/test/resources/ssl/README.adoc b/integration-tests/solr/src/test/resources/ssl/README.adoc deleted file mode 100644 index a61d349f19..0000000000 --- a/integration-tests/solr/src/test/resources/ssl/README.adoc +++ /dev/null @@ -1,6 +0,0 @@ -== Purpose and content of the individual files in this directory - -* `solr-ssl.keystore.jks` the keystore containing the server certificate and private key to use when starting - Solr container with SSL enbled. The password for both the store and the private key is `secret`. -* `solr-ssl.der` the same server certificate as in `solr-ssl.keystore.jks`, stored separately so that it is - easier to add it to the JVM's trust store via `ExtendDefaultTrustStore.main()` diff --git a/integration-tests/solr/src/test/resources/ssl/solr-ssl.der b/integration-tests/solr/src/test/resources/ssl/solr-ssl.der deleted file mode 100644 index f04dffee61..0000000000 --- a/integration-tests/solr/src/test/resources/ssl/solr-ssl.der +++ /dev/null @@ -1,22 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDtzCCAp+gAwIBAgIEM3jJlzANBgkqhkiG9w0BAQsFADB+MRAwDgYDVQQGEwdD -b3VudHJ5MQ4wDAYDVQQIEwVTdGF0ZTERMA8GA1UEBxMITG9jYXRpb24xFTATBgNV -BAoTDE9yZ2FuaXphdGlvbjEcMBoGA1UECxMTT3JnYW5pemF0aW9uYWwgVW5pdDES -MBAGA1UEAxMJbG9jYWxob3N0MB4XDTIwMTExODEzNTcxMFoXDTQ4MDQwNDEzNTcx -MFowfjEQMA4GA1UEBhMHQ291bnRyeTEOMAwGA1UECBMFU3RhdGUxETAPBgNVBAcT -CExvY2F0aW9uMRUwEwYDVQQKEwxPcmdhbml6YXRpb24xHDAaBgNVBAsTE09yZ2Fu -aXphdGlvbmFsIFVuaXQxEjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcN -AQEBBQADggEPADCCAQoCggEBAOwmcDqlyOwC8vv3j7NrC1Y24sBmgAyfuLy0Y4KF -yakZIVJQSWLm2NyjmK3a3ZN2gjsv8dcLdg+8KJvvwUDhMxMeS+xXS4UjHX27crL2 -AouKI/ueAC+thhfvdPIgR/opnrLXueK6kRgLiHOq4Ao18QJ0VCYhpfQx73ZXAMPN -g4XdktmdZURCx96noYB6oG5SQ/SL2LT+g5GDPbJHGDIvMSe6j1no5Sqn11Q46Azf -DZfhP6+OzT7zWOGCvi/Tn7qPQ6hX27esin93zlKA9fY/hIbq2o5u6ARS0SV3xNhd -8MlHC7s4ML0SD7ecZMbK6Xb4ECFvVkiNa0SScEpJ21eEL5sCAwEAAaM9MDswHQYD -VR0OBBYEFBNQ3LdaHZHA44JakfiUWV9pm7RbMBoGA1UdEQQTMBGCCWxvY2FsaG9z -dIcEfwAAATANBgkqhkiG9w0BAQsFAAOCAQEAHTGU1JEjwDOongGlRC+e+zJVLymJ -6x+npvmrIwjpGL/FoSfEtk8UH4TU02hzXPrq+mKlYIXVgvh2Ip7LSPSBNH1dPksi -qhKXxNsnqdED9svQ8wjoIC/4PNJ1+cRUwOeC5rmEZlJaBmL7qgAmf/UsgPs5/zM9 -a+OEOyCoiA+I8hQYBhrbeDoJGhLsIxePMQVTPjoKHk10j+o7h7MpOmeCe4Sy3pT4 -yN+Z3esa9wlJoRiJVqlYoYq2ZI4NedTWksVu+B2sdNb8jWMT4V6gCF8Se/rNKifr -kR0KR/InP19Ioz6t7IMYFyVDaoUsRK8DmUlTwXiWV+5sCiJZYYUOLGIbTg== ------END CERTIFICATE----- diff --git a/integration-tests/solr/src/test/resources/ssl/solr-ssl.keystore.jks b/integration-tests/solr/src/test/resources/ssl/solr-ssl.keystore.jks deleted file mode 100644 index 2cbbee52a8..0000000000 Binary files a/integration-tests/solr/src/test/resources/ssl/solr-ssl.keystore.jks and /dev/null differ diff --git a/tooling/scripts/test-categories.yaml b/tooling/scripts/test-categories.yaml index fa82d318cb..6b3cab14c4 100644 --- a/tooling/scripts/test-categories.yaml +++ b/tooling/scripts/test-categories.yaml @@ -41,7 +41,6 @@ group-02: - oaipmh - pubnub - protobuf - - solr - sql group-03: - bean-validator