Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ jobs:
sonar-run-on-java-version: 21
sonar-token: ${{ secrets.SONAR_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# clean install required for slingfeature-maven-plugin
maven-verify-args: -s ./.maven-settings.xml -Pcontinuous-integration -B -U clean install
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,36 @@
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.metatype.annotations.AttributeDefinition;
import org.osgi.service.metatype.annotations.Designate;
import org.osgi.service.metatype.annotations.ObjectClassDefinition;

import io.wcm.caravan.jaxws.consumer.JaxWsClientFactory;

/**
* Hello World SOAP Client.
*/
@Component(service = HelloWorldConsumer.class)
@Designate(ocd = HelloWorldConsumer.Config.class)
public class HelloWorldConsumer {

@ObjectClassDefinition(name = "HelloWorld Consumer",
description = "Integration Test Configuration")
@interface Config {

@AttributeDefinition(description = "Server URL")
String serverUrl() default "http://localhost:8080";

}

@Reference
private JaxWsClientFactory jaxWsClientFactory;

private Greeter greeterClient;

@Activate
private void activate() {
String url = System.getProperty("launchpad.http.server.url") + "/helloWorldService";
private void activate(Config config) {
String url = config.serverUrl() + "/helloWorldService";
greeterClient = jaxWsClientFactory.create(Greeter.class, url);
}

Expand Down
225 changes: 154 additions & 71 deletions integration-test/launchpad-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<groupId>io.wcm.caravan</groupId>
<artifactId>io.wcm.caravan.jaxws.integration-test.launchpad-test</artifactId>
<version>1-SNAPSHOT</version>
<packaging>slingstart</packaging>

<name>JAX-WS Integration Test Launchpad Test</name>
<description>
Expand All @@ -41,21 +40,15 @@
</description>

<properties>
<!-- hostname for integration tests -->
<test.host>localhost</test.host>
<!-- Java version -->
<java.version>17</java.version>

<!--
Set this to true to stop mvn once the integration test Jetty instance is
started. Useful to manually test the integration testing webapp.
-->
<launchpad.keep.running>false</launchpad.keep.running>
<!-- Sling Starter version -->
<sling.starter.version>14-SNAPSHOT</sling.starter.version>

<!--
If set to "true" this will start the launchpad with standard debug options,
or set to a string to provide custom debug settings
-->
<launchpad.debug/>

<!-- start with -DkeepITServerRunning=true to allow to rerun ITs or inspect the server after the ITs have been executed there -->
<starter.min.bundles.count>200</starter.min.bundles.count>
<it.startTimeoutSeconds>60</it.startTimeoutSeconds>
</properties>

<dependencies>
Expand All @@ -64,20 +57,55 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.teleporter</artifactId>
<version>1.0.18</version>
<version>1.1.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Dependencies for the Test Build and Run -->
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.junit.core</artifactId>
<version>1.0.26</version>
<scope>provided</scope>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.commons.testing</artifactId>
<version>2.2.0</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit-dep</artifactId>
</exclusion>
<exclusion>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
<exclusion>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.jackrabbit</groupId>
<artifactId>jackrabbit-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.testing.tools</artifactId>
<version>1.0.16</version>
<scope>provided</scope>
<groupId>jakarta.json</groupId>
<artifactId>jakarta.json-api</artifactId>
<version>2.0.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
<version>2.0.2</version>
<scope>test</scope>
</dependency>

<dependency>
Expand Down Expand Up @@ -129,13 +157,6 @@
</dependency>

<!-- actual dependencies -->
<dependency>
<groupId>io.wcm.caravan</groupId>
<artifactId>io.wcm.caravan.integration-test.minimal-launchpad</artifactId>
<version>1.2.0</version>
<type>slingfeature</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
Expand All @@ -155,74 +176,146 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<!-- Find free ports to run our server -->
<execution>
<id>reserve-network-port</id>
<goals>
<goal>reserve-network-port</goal>
</goals>
<phase>process-resources</phase>
<phase>initialize</phase>
<configuration>
<portNames>
<!-- reserved port must be stored in property because it must be passed to the feature-launcher-maven-plugin -->
<portName>http.port</portName>
<portName>sling.control.port</portName>
</portNames>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<groupId>org.apache.sling</groupId>
<artifactId>slingfeature-maven-plugin</artifactId>
<version>1.9.2</version>
<extensions>true</extensions>

<configuration>
<replacePropertyVariables>apache-cxf-version</replacePropertyVariables>
<skipAddFeatureDependencies>true</skipAddFeatureDependencies>
<aggregates>
<aggregate>
<classifier>app</classifier>
<filesInclude>*.json</filesInclude>
<variablesOverrides>
<http.port>${http.port}</http.port>
</variablesOverrides>
<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>
<phase>prepare-package</phase>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
<goal>aggregate-features</goal>
<goal>analyse-features</goal>
<goal>attach-features</goal>
</goals>
</execution>
</executions>
<configuration>
<runOrder>alphabetical</runOrder>
<systemPropertyVariables>
<launchpad.http.server.url>http://${test.host}:${http.port}</launchpad.http.server.url>
<launchpad.webdav.server.url>http://${test.host}:${http.port}/${webdav.workspace.path}</launchpad.webdav.server.url>
</systemPropertyVariables>
</configuration>
</plugin>

<!-- launch the Sling instances to test -->
<plugin>
<groupId>org.apache.sling</groupId>
<artifactId>slingstart-maven-plugin</artifactId>
<version>1.6.0</version>
<extensions>true</extensions>
<artifactId>feature-launcher-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<launches>
<launch>
<id>sling-starter-oak-tar</id>
<feature>
<groupId>io.wcm.caravan</groupId>
<artifactId>io.wcm.caravan.jaxws.integration-test.launchpad-test</artifactId>
<version>1-SNAPSHOT</version>
<classifier>app</classifier>
<type>slingosgifeature</type>
</feature>
<launcherArguments>
<vmOptions>
<value>--add-opens java.base/java.lang=ALL-UNNAMED</value>
<value>--add-opens java.base/java.net=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>start-container</id>
<goals>
<goal>start</goal>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- run the ITs -->
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<usePomDependencies>true</usePomDependencies>
<usePomVariables>true</usePomVariables>
<servers>
<server>
<port>${http.port}</port>
<controlPort>${sling.control.port}</controlPort>
<contextPath>${http.base.path}</contextPath>
<debug>${launchpad.debug}</debug>
<!-- pass through http.port as system property -->
<vmOpts>-Xmx1024m -XX:MaxPermSize=256m -Djava.awt.headless=true -Dlaunchpad.http.server.url=http://${test.host}:${http.port}</vmOpts>
</server>
</servers>
<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>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- do not deploy this pom into maven repository -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -309,16 +402,6 @@
</properties>
</profile>

<!-- Start on port 8080 and keep running -->
<profile>
<id>run8080</id>
<properties>
<launchpad.keep.running>true</launchpad.keep.running>
<launchpad.debug>true</launchpad.debug>
<http.port>8080</http.port>
</properties>
</profile>

</profiles>

</project>
Loading