You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2020/06/29 15:36:08 UTC
[sling-feature-launcher-maven-plugin] 09/12: SLING-9526 - Allow
launching feature model applications in external processes, non-blocking
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-feature-launcher-maven-plugin.git
commit 2683dbad4322b5eb142ca728f770b235eef70f0b
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Jun 25 16:49:57 2020 +0200
SLING-9526 - Allow launching feature model applications in external processes, non-blocking
Switch to a local application for ITs instead of the Sling Starter. It seems that resolution from repository.apache.org did not work on Jenkins ( it's coming from the Sling parent pom ) and it's slowing down testing anyway.
---
pom.xml | 2 --
src/it/simple-it/pom.xml | 33 ++++++++++++++++++----
src/it/simple-it/src/main/features/model.json | 14 +++++++++
.../it/{SlingRunningIT.java => AppRunningIT.java} | 14 ++++-----
4 files changed, 49 insertions(+), 14 deletions(-)
diff --git a/pom.xml b/pom.xml
index 582ed80..7e744bd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -142,9 +142,7 @@
<pomInclude>*/pom.xml</pomInclude>
</pomIncludes>
<postBuildHookScript>verify</postBuildHookScript>
- <!--
<localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
- -->
<settingsFile>src/it/settings.xml</settingsFile>
<goals>
<goal>clean</goal>
diff --git a/src/it/simple-it/pom.xml b/src/it/simple-it/pom.xml
index c99cc47..862df63 100644
--- a/src/it/simple-it/pom.xml
+++ b/src/it/simple-it/pom.xml
@@ -79,18 +79,41 @@
</executions>
</plugin>
<plugin>
+ <groupId>org.apache.sling</groupId>
+ <artifactId>slingfeature-maven-plugin</artifactId>
+ <version>1.3.6</version>
+ <extensions>true</extensions>
+ <!-- TODO - seems we can't attach non-aggregates -->
+ <configuration>
+ <aggregates>
+ <aggregate>
+ <classifier>main</classifier>
+ <filesInclude>model.json</filesInclude>
+ </aggregate>
+ </aggregates>
+ </configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>attach-features</goal>
+ <goal>aggregate-features</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
<groupId>@project.groupId@</groupId>
<artifactId>@project.artifactId@</artifactId>
<version>@project.version@</version>
<configuration>
<launches>
<launch>
- <id>sling-12-oak-tar</id>
+ <id>model</id>
<feature>
<groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.starter</artifactId>
- <version>12-SNAPSHOT</version>
- <classifier>oak_tar</classifier>
+ <artifactId>simple-it</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <classifier>main</classifier>
<type>slingosgifeature</type>
</feature>
<launcherArguments>
@@ -118,7 +141,7 @@
<version>2.22.2</version>
<configuration>
<systemPropertyVariables>
- <SLING_HTTP_PORT>${http.port}</SLING_HTTP_PORT>
+ <HTTP_PORT>${http.port}</HTTP_PORT>
</systemPropertyVariables>
</configuration>
<executions>
diff --git a/src/it/simple-it/src/main/features/model.json b/src/it/simple-it/src/main/features/model.json
new file mode 100644
index 0000000..ee05e71
--- /dev/null
+++ b/src/it/simple-it/src/main/features/model.json
@@ -0,0 +1,14 @@
+{
+ "id":"${project.groupId}:${project.artifactId}:model:${project.version}",
+ "bundles": [
+ "org.apache.felix/org.apache.felix.scr/2.1.20",
+ "org.apache.felix/org.apache.felix.log/1.2.2",
+ "org.apache.felix/org.apache.felix.configadmin/1.9.16",
+ "org.osgi/org.osgi.util.promise/1.1.1",
+ "org.osgi/org.osgi.util.function/1.1.0",
+ "org.osgi/org.osgi.util.converter/1.0.1",
+ "org.apache.commons/commons-lang3/3.9",
+ "org.apache.felix/org.apache.felix.http.jetty/4.0.16",
+ "org.apache.felix/org.apache.felix.http.servlet-api/1.1.2"
+ ]
+}
\ No newline at end of file
diff --git a/src/it/simple-it/src/test/java/org/apache/sling/it/SlingRunningIT.java b/src/it/simple-it/src/test/java/org/apache/sling/it/AppRunningIT.java
similarity index 78%
rename from src/it/simple-it/src/test/java/org/apache/sling/it/SlingRunningIT.java
rename to src/it/simple-it/src/test/java/org/apache/sling/it/AppRunningIT.java
index 4e0cb22..5aa6e34 100644
--- a/src/it/simple-it/src/test/java/org/apache/sling/it/SlingRunningIT.java
+++ b/src/it/simple-it/src/test/java/org/apache/sling/it/AppRunningIT.java
@@ -16,18 +16,18 @@
*/
package org.apache.sling.it;
-import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
import org.apache.http.impl.client.*;
import org.apache.http.client.methods.*;
-public class SlingRunningIT {
+public class AppRunningIT {
@Test
- public void slingIsUp() throws Exception {
+ public void slinappIsUp() throws Exception {
- int port = Integer.getInteger("SLING_HTTP_PORT", 8080);
+ int port = Integer.getInteger("HTTP_PORT", 8080);
try ( CloseableHttpClient httpclient = HttpClients.createDefault() ) {
HttpGet get = new HttpGet("http://localhost:" + port + "/");
@@ -35,15 +35,15 @@ public class SlingRunningIT {
try ( CloseableHttpResponse response = httpclient.execute(get) ) {
System.out.println("Status line = " + response.getStatusLine().toString());
int statusCode = response.getStatusLine().getStatusCode();
- if ( (statusCode / 100 == 2) || (statusCode / 100 == 3) ) {
- System.out.println("Sling is ready");
+ if ( (statusCode / 100 < 5 ) ) {
+ System.out.println("App is ready");
return;
}
Thread.sleep(1000l);
}
}
- throw new RuntimeException("Sling is not yet ready, failing");
+ fail("App is not yet ready, failing");
}
}
}
\ No newline at end of file