You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2014/09/16 14:44:58 UTC

git commit: [KARAF-3227] Upgrade to Spring 3.2.11.RELEASE and add corresponding Spring 31 features itests

Repository: karaf
Updated Branches:
  refs/heads/karaf-3.0.x ea35dfc9e -> 5ec5baf1f


[KARAF-3227] Upgrade to Spring 3.2.11.RELEASE and add corresponding Spring 31 features itests


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/5ec5baf1
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/5ec5baf1
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/5ec5baf1

Branch: refs/heads/karaf-3.0.x
Commit: 5ec5baf1fb9fbc30913beeed46d662006c2a6036
Parents: ea35dfc
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Tue Sep 16 14:44:11 2014 +0200
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Tue Sep 16 14:44:11 2014 +0200

----------------------------------------------------------------------
 itests/pom.xml                                  |  2 +
 .../apache/karaf/itests/KarafTestSupport.java   | 28 ++++++++-
 .../itests/features/SpringFeaturesTest.java     | 65 +++++++++++++++++++-
 pom.xml                                         |  2 +-
 4 files changed, 94 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/5ec5baf1/itests/pom.xml
----------------------------------------------------------------------
diff --git a/itests/pom.xml b/itests/pom.xml
index dd7370d..2625dc7 100644
--- a/itests/pom.xml
+++ b/itests/pom.xml
@@ -111,6 +111,7 @@
 				<configuration>
 					<systemPropertyVariables>
 						<org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
+                        <spring31.version>${spring31.version}</spring31.version>
 					</systemPropertyVariables>
 				</configuration>
 			</plugin>
@@ -135,6 +136,7 @@
                             <argLine>-Dorg.ops4j.pax.url.mvn.localRepository=${maven.repo.local}</argLine>
                             <systemPropertyVariables>
 		                        <org.ops4j.pax.logging.DefaultServiceLog.level>INFO</org.ops4j.pax.logging.DefaultServiceLog.level>
+                                <spring31.version>${spring31.version}</spring31.version>
                     		</systemPropertyVariables>
                         </configuration>
                     </plugin>

http://git-wip-us.apache.org/repos/asf/karaf/blob/5ec5baf1/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java
----------------------------------------------------------------------
diff --git a/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java b/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java
index 1fb9b20..fee5e19 100644
--- a/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java
+++ b/itests/src/test/java/org/apache/karaf/itests/KarafTestSupport.java
@@ -132,7 +132,8 @@ public class KarafTestSupport {
             editConfigurationFilePut("etc/org.apache.karaf.features.cfg", "featuresBoot", "config,standard,region,package,kar,management"),
             editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", "org.osgi.service.http.port", HTTP_PORT),
             editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiRegistryPort", RMI_REG_PORT),
-            editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", RMI_SERVER_PORT)
+            editConfigurationFilePut("etc/org.apache.karaf.management.cfg", "rmiServerPort", RMI_SERVER_PORT),
+            editConfigurationFilePut("etc/system.properties", "spring31.version", System.getProperty("spring31.version"))
         };
     }
 
@@ -355,6 +356,16 @@ public class KarafTestSupport {
         Assert.fail("Feature " + featureName + " should be installed but is not");
     }
 
+    public void assertFeatureInstalled(String featureName, String featureVersion) {
+        Feature[] features = featureService.listInstalledFeatures();
+        for (Feature feature : features) {
+            if (featureName.equals(feature.getName()) && featureVersion.equals(feature.getVersion())) {
+                return;
+            }
+        }
+        Assert.fail("Feature " + featureName + "/" + featureVersion + " should be installed but is not");
+    }
+
     public void assertFeatureNotInstalled(String featureName) {
         Feature[] features = featureService.listInstalledFeatures();
         for (Feature feature : features) {
@@ -406,6 +417,11 @@ public class KarafTestSupport {
         assertFeatureInstalled(feature);
     }
 
+    protected void installAndAssertFeature(String feature, String version) throws Exception {
+        featureService.installFeature(feature, version);
+        assertFeatureInstalled(feature, version);
+    }
+
     protected void installAssertAndUninstallFeature(String... feature) throws Exception {
     	Set<Feature> featuresBefore = new HashSet<Feature>(Arrays.asList(featureService.listInstalledFeatures()));
     	try {
@@ -418,6 +434,16 @@ public class KarafTestSupport {
 		}
     }
 
+    protected void installAssertAndUninstallFeature(String feature, String version) throws Exception {
+        Set<Feature> featuresBefore = new HashSet<Feature>(Arrays.asList(featureService.listInstalledFeatures()));
+        try {
+            featureService.installFeature(feature, version);
+            assertFeatureInstalled(feature, version);
+        } finally {
+            uninstallNewFeatures(featuresBefore);
+        }
+    }
+
     /**
      * The feature service does not uninstall feature dependencies when uninstalling a single feature.
      * So we need to make sure we uninstall all features that were newly installed.

http://git-wip-us.apache.org/repos/asf/karaf/blob/5ec5baf1/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java
----------------------------------------------------------------------
diff --git a/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java b/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java
index d9eea8e..f6f4653 100644
--- a/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java
+++ b/itests/src/test/java/org/apache/karaf/itests/features/SpringFeaturesTest.java
@@ -14,7 +14,6 @@
 package org.apache.karaf.itests.features;
 
 import org.apache.karaf.itests.KarafTestSupport;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.junit.PaxExam;
@@ -25,6 +24,70 @@ import org.ops4j.pax.exam.spi.reactors.PerClass;
 @ExamReactorStrategy(PerClass.class)
 public class SpringFeaturesTest extends KarafTestSupport {
 
+    // Spring 3.1.x features test
+
+    @Test
+    public void installSpring31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringAspects31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-aspects", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringInstrument31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-instrument", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringJdbc31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-jdbc", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringJms31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-jms", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringStruts31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-struts", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringTest31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-test", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringOrm31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-orm", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringOxm31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-oxm", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringTx31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-tx", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringWeb31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-web", System.getProperty("spring31.version"));
+    }
+
+    @Test
+    public void installSpringWebPortlet31Feature() throws Exception {
+        installAssertAndUninstallFeature("spring-web-portlet", System.getProperty("spring31.version"));
+    }
+
+    // Spring 4.0.x features test
+
     @Test
     public void installSpringFeature() throws Exception {
         installAssertAndUninstallFeature("spring");

http://git-wip-us.apache.org/repos/asf/karaf/blob/5ec5baf1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 5d3ad36..19d344e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -235,7 +235,7 @@
 
         <spring.osgi.version>1.2.1</spring.osgi.version>
         <spring31.version>3.1.4.RELEASE</spring31.version>
-        <spring32.version>3.2.9.RELEASE_1</spring32.version>
+        <spring32.version>3.2.11.RELEASE_1</spring32.version>
         <spring40.version>4.0.5.RELEASE_1</spring40.version>
         <spring.security31.version>3.1.4.RELEASE</spring.security31.version>