You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by gn...@apache.org on 2017/12/05 10:06:06 UTC

[karaf] 01/01: [KARAF-5447] Fix integration tests

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

gnodet pushed a commit to branch KARAF-5447
in repository https://gitbox.apache.org/repos/asf/karaf.git

commit 267eae47108be119f6462eb8c5d4755a66e8118d
Author: Guillaume Nodet <gn...@gmail.com>
AuthorDate: Tue Dec 5 09:10:58 2017 +0100

    [KARAF-5447] Fix integration tests
---
 itests/pom.xml                                     |  1 +
 .../itests/features/Spring43FeaturesTest.java      | 24 ++++++++++++++-
 ...FeaturesTest.java => Spring50FeaturesTest.java} | 36 +++++++++++++---------
 3 files changed, 46 insertions(+), 15 deletions(-)

diff --git a/itests/pom.xml b/itests/pom.xml
index cfe3e5e..1927440 100644
--- a/itests/pom.xml
+++ b/itests/pom.xml
@@ -266,6 +266,7 @@
                         <spring41.version>${spring41.version}</spring41.version>
                         <spring42.version>${spring42.version}</spring42.version>
                         <spring43.version>${spring43.version}</spring43.version>
+                        <spring50.version>${spring50.version}</spring50.version>
                         <activemq.version>${activemq.version}</activemq.version>
                     </systemPropertyVariables>
                 </configuration>
diff --git a/itests/src/test/java/org/apache/karaf/itests/features/Spring43FeaturesTest.java b/itests/src/test/java/org/apache/karaf/itests/features/Spring43FeaturesTest.java
index 5d5f7a5..d5d4339 100644
--- a/itests/src/test/java/org/apache/karaf/itests/features/Spring43FeaturesTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/features/Spring43FeaturesTest.java
@@ -16,14 +16,36 @@ package org.apache.karaf.itests.features;
 import org.apache.karaf.itests.KarafTestSupport;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.MavenUtils;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
 
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerClass.class)
 public class Spring43FeaturesTest extends KarafTestSupport {
-    
+
+    @Configuration
+    public Option[] config() {
+        String version = MavenUtils.getArtifactVersion("org.apache.karaf", "apache-karaf");
+        List<Option> result = new LinkedList<>(Arrays.asList(super.config()));
+        result.add(editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "featuresRepositories",
+                "mvn:org.apache.karaf.features/framework/" + version + "/xml/features, " +
+                        "mvn:org.apache.karaf.features/spring/" + version + "/xml/features, " +
+                        "mvn:org.apache.karaf.features/spring-legacy/" + version + "/xml/features, " +
+                        "mvn:org.apache.karaf.features/enterprise/" + version + "/xml/features, " +
+                        "mvn:org.apache.karaf.features/enterprise-legacy/" + version + "/xml/features, " +
+                        "mvn:org.apache.karaf.features/standard/" + version + "/xml/features"));
+        return result.toArray(new Option[result.size()]);
+    }
 
     @Test
     public void installSpringFeature() throws Exception {
diff --git a/itests/src/test/java/org/apache/karaf/itests/features/Spring43FeaturesTest.java b/itests/src/test/java/org/apache/karaf/itests/features/Spring50FeaturesTest.java
similarity index 77%
copy from itests/src/test/java/org/apache/karaf/itests/features/Spring43FeaturesTest.java
copy to itests/src/test/java/org/apache/karaf/itests/features/Spring50FeaturesTest.java
index 5d5f7a5..3b6cb00 100644
--- a/itests/src/test/java/org/apache/karaf/itests/features/Spring43FeaturesTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/features/Spring50FeaturesTest.java
@@ -16,73 +16,81 @@ package org.apache.karaf.itests.features;
 import org.apache.karaf.itests.KarafTestSupport;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.MavenUtils;
+import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
 
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.List;
+
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
 @RunWith(PaxExam.class)
 @ExamReactorStrategy(PerClass.class)
-public class Spring43FeaturesTest extends KarafTestSupport {
-    
+public class Spring50FeaturesTest extends KarafTestSupport {
 
     @Test
     public void installSpringFeature() throws Exception {
-        installAssertAndUninstallFeature("spring", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringAspectsFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-aspects", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-aspects", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringInstrumentFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-instrument", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-instrument", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringJdbcFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-jdbc", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-jdbc", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringJmsFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-jms", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-jms", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringTestFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-test", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-test", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringOrmFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-orm", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-orm", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringOxmFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-oxm", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-oxm", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringTxFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-tx", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-tx", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringWebFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-web", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-web", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringWebPortletFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-web-portlet", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-web-portlet", System.getProperty("spring50.version"));
     }
 
     @Test
     public void installSpringWebSocketFeature() throws Exception {
-        installAssertAndUninstallFeature("spring-websocket", System.getProperty("spring43.version"));
+        installAssertAndUninstallFeature("spring-websocket", System.getProperty("spring50.version"));
     }
 
 }

-- 
To stop receiving notification emails like this one, please contact
"commits@karaf.apache.org" <co...@karaf.apache.org>.