This is an automated email from the ASF dual-hosted git repository. sseifert pushed a commit to branch feature/SLING-13050-integration-tests in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-impl.git
commit cb84b5925d58ca53c5fb1c52db187fe367b18aee Author: Stefan Seifert <[email protected]> AuthorDate: Fri Jan 9 16:57:48 2026 +0100 switch to feature launcher --- impl/pom.xml | 2 - it/pom.xml | 167 ++++++++++++++++++++- it/src/main/features/launcher-repoinit.txt | 23 +++ it/src/main/features/launcher.json | 24 +++ .../customizers/SM_TeleporterCustomizer.java | 8 +- .../sling/models/testing/exporter/ExporterIT.java | 5 +- parent/pom.xml | 2 +- 7 files changed, 216 insertions(+), 15 deletions(-) diff --git a/impl/pom.xml b/impl/pom.xml index 2ca44be..a338e03 100644 --- a/impl/pom.xml +++ b/impl/pom.xml @@ -83,13 +83,11 @@ <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> - <version>4.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>jakarta.servlet</groupId> <artifactId>jakarta.servlet-api</artifactId> - <version>6.0.0</version> <scope>provided</scope> </dependency> <dependency> diff --git a/it/pom.xml b/it/pom.xml index 319eade..c30ec8e 100644 --- a/it/pom.xml +++ b/it/pom.xml @@ -78,19 +78,19 @@ <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.junit.core</artifactId> - <version>1.0.28</version> + <version>1.2.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.testing.rules</artifactId> - <version>1.0.8</version> + <version>2.0.2</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.testing.clients</artifactId> - <version>2.0.12</version> + <version>3.1.0</version> <scope>test</scope> <exclusions> <exclusion> @@ -102,13 +102,13 @@ <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.junit.teleporter</artifactId> - <version>1.0.20</version> + <version>1.1.0</version> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.engine</artifactId> - <version>2.6.14</version> + <version>3.0.0</version> <scope>provided</scope> </dependency> <dependency> @@ -135,6 +135,11 @@ <artifactId>javax.servlet-api</artifactId> <scope>provided</scope> </dependency> + <dependency> + <groupId>jakarta.servlet</groupId> + <artifactId>jakarta.servlet-api</artifactId> + <scope>provided</scope> + </dependency> <dependency> <groupId>javax.jcr</groupId> <artifactId>jcr</artifactId> @@ -174,6 +179,12 @@ <artifactId>annotations</artifactId> <scope>provided</scope> </dependency> + <dependency> + <groupId>org.apache.sling</groupId> + <artifactId>org.apache.sling.commons.johnzon</artifactId> + <version>2.0.0</version> + <scope>provided</scope> + </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-simple</artifactId> @@ -195,6 +206,7 @@ <build> <plugins> + <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-maven-plugin</artifactId> @@ -206,6 +218,7 @@ </dependency> </dependencies> </plugin> + <plugin> <groupId>biz.aQute.bnd</groupId> <artifactId>bnd-baseline-maven-plugin</artifactId> @@ -213,6 +226,7 @@ <skip>true</skip> </configuration> </plugin> + <plugin> <groupId>org.apache.rat</groupId> <artifactId>apache-rat-plugin</artifactId> @@ -222,6 +236,149 @@ </excludes> </configuration> </plugin> + + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>initialize</phase> + <configuration> + <portNames> + <portName>http.port</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.sling</groupId> + <artifactId>slingfeature-maven-plugin</artifactId> + <version>1.9.2</version> + <extensions>true</extensions> + + <configuration> + <replacePropertyVariables>models.api.version</replacePropertyVariables> + <skipAddFeatureDependencies>true</skipAddFeatureDependencies> + <aggregates> + <aggregate> + <classifier>app</classifier> + <filesInclude>*.json</filesInclude> + <variablesOverrides> + <http.port>${http.port}</http.port> + </variablesOverrides> + <artifactsOverrides> + <artifactsOverride>org.apache.sling:org.apache.sling.models.api:HIGHEST</artifactsOverride> + <artifactsOverride>org.apache.sling:org.apache.sling.models.impl:HIGHEST</artifactsOverride> + </artifactsOverrides> + <includeArtifact> + <groupId>org.apache.sling</groupId> + <artifactId>org.apache.sling.starter</artifactId> + <classifier>nosample_base</classifier> + <version>${sling.starter.version}</version> + <type>slingosgifeature</type> + </includeArtifact> + <includeArtifact> + <groupId>org.apache.sling</groupId> + <artifactId>org.apache.sling.starter</artifactId> + <classifier>oak_persistence_sns</classifier> + <version>${sling.starter.version}</version> + <type>slingosgifeature</type> + </includeArtifact> + <includeArtifact> + <groupId>org.apache.sling</groupId> + <artifactId>org.apache.sling.starter</artifactId> + <classifier>junit</classifier> + <version>${sling.starter.version}</version> + <type>slingosgifeature</type> + </includeArtifact> + </aggregate> + </aggregates> + <scans> + <scan> + <includeClassifier>app</includeClassifier> + </scan> + </scans> + </configuration> + <executions> + <execution> + <id>prepare-features</id> + <goals> + <goal>aggregate-features</goal> + <goal>analyse-features</goal> + <goal>attach-features</goal> + </goals> + <phase>prepare-package</phase> + </execution> + </executions> + </plugin> + + <plugin> + <groupId>org.apache.sling</groupId> + <artifactId>feature-launcher-maven-plugin</artifactId> + <version>1.0.1-SNAPSHOT</version> + <configuration> + <launches> + <launch> + <id>sling-starter-oak-tar</id> + <feature> + <groupId>org.apache.sling</groupId> + <artifactId>org.apache.sling.models.impl.it</artifactId> + <version>${project.version}</version> + <classifier>app</classifier> + <type>slingosgifeature</type> + </feature> + <launcherArguments> + <vmOptions> + <value>--add-opens java.base/java.lang=ALL-UNNAMED</value> + </vmOptions> + <frameworkProperties> + <org.osgi.service.http.port>${http.port}</org.osgi.service.http.port> + <org.apache.felix.http.jetty.responseBufferSize>5000000</org.apache.felix.http.jetty.responseBufferSize> + </frameworkProperties> + </launcherArguments> + <startTimeoutSeconds>${it.startTimeoutSeconds}</startTimeoutSeconds> + </launch> + </launches> + </configuration> + <executions> + <execution> + <id>launcher-start</id> + <goals> + <goal>start</goal> + <goal>stop</goal> + </goals> + </execution> + </executions> + </plugin> + + <plugin> + <artifactId>maven-failsafe-plugin</artifactId> + <configuration> + <systemPropertyVariables> + <launchpad.http.server.url>http://localhost:${http.port}</launchpad.http.server.url> + <starter.http.test.ports>false:${http.port}</starter.http.test.ports> + <starter.min.bundles.count>${starter.min.bundles.count}</starter.min.bundles.count> + <!-- Comma-separated list of paths to check for 200 status --> + <starter.check.paths>/system/console/bundles,</starter.check.paths> + </systemPropertyVariables> + </configuration> + <executions> + <execution> + <id>integration-test</id> + <goals> + <goal>integration-test</goal> + <goal>verify</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> </build> </project> diff --git a/it/src/main/features/launcher-repoinit.txt b/it/src/main/features/launcher-repoinit.txt new file mode 100644 index 0000000..7d36118 --- /dev/null +++ b/it/src/main/features/launcher-repoinit.txt @@ -0,0 +1,23 @@ +# +# 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. +# + +create service user models-it +set ACL for models-it + allow jcr:all on / +end \ No newline at end of file diff --git a/it/src/main/features/launcher.json b/it/src/main/features/launcher.json new file mode 100644 index 0000000..1bc8d0f --- /dev/null +++ b/it/src/main/features/launcher.json @@ -0,0 +1,24 @@ +{ + "bundles": [ + { + "id": "org.apache.sling/org.apache.sling.models.api/${models.api.version}", + "start-order": 20 + }, + { + "id": "org.apache.sling/org.apache.sling.models.impl/${project.version}", + "start-order": 20 + }, + { + "id": "org.apache.sling/org.apache.sling.models.impl.it/${project.version}", + "start-order": 20 + } + ], + "configurations": { + "org.apache.sling.serviceusermapping.impl.ServiceUserMapperImpl.amended~junit": { + "user.mapping": [ + "org.apache.sling.junit.core=models-it" + ] + } + }, + "repoinit:TEXT|true": "@file" +} \ No newline at end of file diff --git a/it/src/test/java/org/apache/sling/junit/teleporter/customizers/SM_TeleporterCustomizer.java b/it/src/test/java/org/apache/sling/junit/teleporter/customizers/SM_TeleporterCustomizer.java index 22efc01..6cf082a 100644 --- a/it/src/test/java/org/apache/sling/junit/teleporter/customizers/SM_TeleporterCustomizer.java +++ b/it/src/test/java/org/apache/sling/junit/teleporter/customizers/SM_TeleporterCustomizer.java @@ -18,6 +18,7 @@ */ package org.apache.sling.junit.teleporter.customizers; +import java.io.IOException; import java.net.URI; import java.util.concurrent.TimeoutException; @@ -48,13 +49,12 @@ public class SM_TeleporterCustomizer implements TeleporterRule.Customizer { cst.includeDependencyPrefix("org.apache.sling.models.testing"); // additionally check for the registration of mandatory sling models components - try { - OsgiConsoleClient osgiClient = new OsgiConsoleClient( - URI.create(S.getServerBaseUrl()), S.getServerUsername(), S.getServerPassword()); + try (OsgiConsoleClient osgiClient = + new OsgiConsoleClient(URI.create(S.getServerBaseUrl()), S.getServerUsername(), S.getServerPassword())) { for (Class clazz : EXPECTED_COMPONENTS) { osgiClient.waitComponentRegistered(clazz.getName(), 20000, 200); } - } catch (ClientException | TimeoutException | InterruptedException ex) { + } catch (ClientException | TimeoutException | InterruptedException | IOException ex) { throw new RuntimeException("Error waiting for expected components.", ex); } } diff --git a/it/src/test/java/org/apache/sling/models/testing/exporter/ExporterIT.java b/it/src/test/java/org/apache/sling/models/testing/exporter/ExporterIT.java index 4dae276..beb0ae9 100644 --- a/it/src/test/java/org/apache/sling/models/testing/exporter/ExporterIT.java +++ b/it/src/test/java/org/apache/sling/models/testing/exporter/ExporterIT.java @@ -18,9 +18,6 @@ */ package org.apache.sling.models.testing.exporter; -import javax.json.Json; -import javax.json.JsonObject; - import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.StringReader; @@ -31,6 +28,8 @@ import java.util.HashMap; import java.util.Map; import java.util.TimeZone; +import jakarta.json.Json; +import jakarta.json.JsonObject; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.FastDateFormat; import org.apache.sling.api.SlingConstants; diff --git a/parent/pom.xml b/parent/pom.xml index 5500b58..b2bf6aa 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -23,7 +23,7 @@ <parent> <groupId>org.apache.sling</groupId> <artifactId>sling-bundle-parent</artifactId> - <version>62</version> + <version>65</version> <relativePath /> </parent>
