camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r959571 - in /camel/trunk: ./ tests/camel-itest-osgi/ tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/ tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/ tests/camel-itest-osgi/src/test/java/org/apa...
Date Thu, 01 Jul 2010 09:42:49 GMT
Author: ningjiang
Date: Thu Jul  1 09:42:48 2010
New Revision: 959571

URL: http://svn.apache.org/viewvc?rev=959571&view=rev
Log:
CAMEL-2882 support to run the osgi test with spring2.5 and spring3

Modified:
    camel/trunk/pom.xml
    camel/trunk/tests/camel-itest-osgi/pom.xml
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/MailRouteTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterSpringTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/protobuf/ProtobufRouteTest.java
    camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletComponentTest.java

Modified: camel/trunk/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/pom.xml?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/pom.xml (original)
+++ camel/trunk/pom.xml Thu Jul  1 09:42:48 2010
@@ -319,7 +319,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-plugin</artifactId>
-          <version>2.4.3</version>
+          <version>2.5</version>
         </plugin>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>
@@ -368,7 +368,7 @@
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-surefire-report-plugin</artifactId>
-          <version>2.4.3</version>
+          <version>2.5</version>
         </plugin>
         <plugin>
           <groupId>org.codehaus.mojo</groupId>

Modified: camel/trunk/tests/camel-itest-osgi/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/pom.xml?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/pom.xml (original)
+++ camel/trunk/tests/camel-itest-osgi/pom.xml Thu Jul  1 09:42:48 2010
@@ -147,10 +147,12 @@
     <dependency>
         <groupId>org.apache.aries.blueprint</groupId>
         <artifactId>org.apache.aries.blueprint</artifactId>
+        <scope>test</scope>
     </dependency>
     <dependency>
         <groupId>org.apache.felix</groupId>
         <artifactId>org.apache.felix.configadmin</artifactId>
+        <scope>test</scope>
     </dependency>
 
   </dependencies>
@@ -174,16 +176,21 @@
       <plugin>
           <artifactId>maven-surefire-plugin</artifactId>
           <configuration>
+              <forkMode>pertest</forkMode>
               <includes>
                   <include>**/*Test.*</include>
               </includes>
               <excludes>
                   <exclude>**/JpaRouteTest.*</exclude>
-              </excludes>               
+              </excludes>
+              <systemPropertyVariables>
+                  <springVersion>${spring-version}</springVersion>
+              </systemPropertyVariables>
           </configuration>
       </plugin>      
     </plugins>
   </build>
+ 
    
   <profiles>
 	<profile>
@@ -214,12 +221,15 @@
                         </includes>
                         <excludes>
 			    <!-- TODO: temporary disable unit test to let TC not hang -->
-		                    <exclude>**/*Test.*</exclude>
+	                    <exclude>**/*Test.*</exclude>
                             <!--There are some conflicts of the JAXB OSGi bundle and Hudson
System jar
                                 so I comment out these JAXB related tests -->
                             <exclude>**/OSGiIntegrationSpringTest.*</exclude>
                             <exclude>**/JaxbFallbackConverterTest.*</exclude>
                         </excludes>               
+                        <systemPropertyVariables>
+                            <springVersion>${spring-version}</springVersion>
+                        </systemPropertyVariables>
                     </configuration>
                 </plugin>
             </plugins>

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/LanguageTest.java
Thu Jul  1 09:42:48 2010
@@ -70,8 +70,7 @@ public class LanguageTest extends OSGiIn
             org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
             
             // using the features to install the camel components             
-            scanFeatures(mavenBundle().groupId("org.apache.camel.karaf").
-                         artifactId("apache-camel").versionAsInProject().type("xml/features"),
                        
+            scanFeatures(getCamelKarafFeatureUrl(),                         
                           "camel-core", "camel-spring", "camel-test", "camel-groovy"),
             
             workingDirectory("target/paxrunner/"),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/MailRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/MailRouteTest.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/MailRouteTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/MailRouteTest.java
Thu Jul  1 09:42:48 2010
@@ -36,6 +36,7 @@ import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 
+import static org.ops4j.pax.exam.CoreOptions.equinox;
 import static org.ops4j.pax.exam.CoreOptions.felix;
 import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
 import static org.ops4j.pax.exam.CoreOptions.options;
@@ -130,8 +131,7 @@ public class MailRouteTest extends OSGiI
             org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
             
             // using the features to install the camel components             
-            scanFeatures(mavenBundle().groupId("org.apache.camel.karaf").
-                         artifactId("apache-camel").versionAsInProject().type("xml/features"),
                        
+            scanFeatures(getCamelKarafFeatureUrl(),                         
                           "camel-core", "camel-spring", "camel-test"),
             
             // using the java mail API bundle
@@ -144,7 +144,7 @@ public class MailRouteTest extends OSGiI
             
             workingDirectory("target/paxrunner/"),
 
-            felix());
+            equinox());
         
         return options;
     }

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/OSGiIntegrationTestSupport.java
Thu Jul  1 09:42:48 2010
@@ -26,6 +26,7 @@ import org.junit.Before;
 import org.ops4j.pax.exam.Inject;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.Configuration;
+import org.ops4j.pax.exam.options.UrlReference;
 import org.osgi.framework.BundleContext;
 
 import static org.ops4j.pax.exam.CoreOptions.equinox;
@@ -60,8 +61,20 @@ public class OSGiIntegrationTestSupport 
         return factory.createContext();
     }
     
+    
+    public static UrlReference getCamelKarafFeatureUrl() {
+        String springVersion = System.getProperty("springVersion");
+        System.out.println("*** The spring version is " + springVersion + " ***");
+        String type = "xml/features"; 
+        if (springVersion != null && springVersion.startsWith("3")) {
+            type = "xml/features-spring3";
+        }
+        return mavenBundle().groupId("org.apache.camel.karaf").
+            artifactId("apache-camel").versionAsInProject().type(type);
+    }
+    
     @Configuration
-    public static Option[] configure() {
+    public static Option[] configure() throws Exception {
         Option[] options = options(
             // install the spring dm profile            
             profile("spring.dm").version("1.2.0"),    
@@ -69,8 +82,7 @@ public class OSGiIntegrationTestSupport 
             org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
             
             // using the features to install the camel components             
-            scanFeatures(mavenBundle().groupId("org.apache.camel.karaf").
-                         artifactId("apache-camel").versionAsInProject().type("xml/features"),
                        
+            scanFeatures(getCamelKarafFeatureUrl(),                         
                           "camel-core", "camel-spring", "camel-test"),
             
             workingDirectory("target/paxrunner/"),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/VelocityTest.java
Thu Jul  1 09:42:48 2010
@@ -42,12 +42,8 @@ import static org.ops4j.pax.exam.contain
 public class VelocityTest extends OSGiIntegrationTestSupport {
     
     @Test
-    public void testReceivesFooResponse() throws Exception {        
+    public void testReceivesResponse() throws Exception {        
         assertRespondsWith("foo", "<hello>foo</hello>");
-    }
-
-    @Test
-    public void testReceivesBarResponse() throws Exception {
         assertRespondsWith("bar", "<hello>bar</hello>");
     }
 
@@ -82,8 +78,7 @@ public class VelocityTest extends OSGiIn
             org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
             
             // using the features to install the camel components             
-            scanFeatures(mavenBundle().groupId("org.apache.camel.karaf").
-                         artifactId("apache-camel").versionAsInProject().type("xml/features").versionAsInProject().type("xml/features"),
                        
+            scanFeatures(getCamelKarafFeatureUrl(),                         
                           "camel-core", "camel-spring", "camel-test", "camel-velocity"),
             
             workingDirectory("target/paxrunner/"),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/AbstractIntegrationTest.java
Thu Jul  1 09:42:48 2010
@@ -22,7 +22,7 @@ import java.util.Collections;
 import java.util.Dictionary;
 import java.util.Enumeration;
 
-import org.apache.camel.test.junit4.TestSupport;
+import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport;
 import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Inject;
 import org.ops4j.pax.exam.options.MavenArtifactProvisionOption;
@@ -35,7 +35,7 @@ import org.osgi.framework.InvalidSyntaxE
 import org.osgi.framework.ServiceReference;
 import org.osgi.util.tracker.ServiceTracker;
 
-public abstract class AbstractIntegrationTest extends TestSupport {
+public abstract class AbstractIntegrationTest extends OSGiIntegrationTestSupport {
 
     public static final long DEFAULT_TIMEOUT = 30000;
 

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/blueprint/OSGiBlueprintTestSupport.java
Thu Jul  1 09:42:48 2010
@@ -135,7 +135,7 @@ public class OSGiBlueprintTestSupport ex
             mavenBundle("org.ops4j.pax.swissbox", "pax-swissbox-tinybundles"),
 
             // using the features to install the camel components
-            scanFeatures(mavenBundle("org.apache.camel.karaf", "apache-camel").type("xml/features"),
+            scanFeatures(getCamelKarafFeatureUrl(),
                           "camel-core", "camel-blueprint", "camel-test", "camel-mail", "camel-jaxb"),
 
             workingDirectory("target/paxrunner/"),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterSpringTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterSpringTest.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterSpringTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterSpringTest.java
Thu Jul  1 09:42:48 2010
@@ -66,8 +66,7 @@ public class JaxbFallbackConverterSpring
             org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
             
             // using the features to install the camel components             
-            scanFeatures(mavenBundle().groupId("org.apache.camel.karaf").
-                         artifactId("apache-camel").versionAsInProject().type("xml/features"),
                        
+            scanFeatures(getCamelKarafFeatureUrl(),                         
                           "camel-core", "camel-spring", "camel-test", "camel-jaxb"),
             
             workingDirectory("target/paxrunner/"),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterTest.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jaxb/JaxbFallbackConverterTest.java
Thu Jul  1 09:42:48 2010
@@ -73,8 +73,7 @@ public class JaxbFallbackConverterTest e
             org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
             
             // using the features to install the camel components             
-            scanFeatures(mavenBundle().groupId("org.apache.camel.karaf").
-                         artifactId("apache-camel").versionAsInProject().type("xml/features"),
                        
+            scanFeatures(getCamelKarafFeatureUrl(),                         
                           "camel-core", "camel-spring", "camel-test", "camel-jaxb"),
             
             workingDirectory("target/paxrunner/"),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/jpa/JpaRouteTest.java
Thu Jul  1 09:42:48 2010
@@ -134,8 +134,7 @@ public class JpaRouteTest extends OSGiIn
             //org.ops4j.pax.exam.CoreOptions.systemProperty("org.apache.servicemix.specs.debug").value("true"),
             //mavenBundle().groupId("net.sourceforge.serp").artifactId("com.springsource.serp").version("1.13.1"),
             // using the features to install the camel components             
-            scanFeatures(mavenBundle().groupId("org.apache.camel.karaf").
-                         artifactId("apache-camel").versionAsInProject().type("xml/features"),
                        
+            scanFeatures(getCamelKarafFeatureUrl(),                         
                           "camel-core", "camel-spring", "camel-test", "camel-jpa"),
            
             /* This the camel-jpa needed bundles 

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/protobuf/ProtobufRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/protobuf/ProtobufRouteTest.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/protobuf/ProtobufRouteTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/protobuf/ProtobufRouteTest.java
Thu Jul  1 09:42:48 2010
@@ -125,8 +125,7 @@ public class ProtobufRouteTest extends O
             org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
             
             // using the features to install the camel components             
-            scanFeatures(mavenBundle().groupId("org.apache.camel.karaf").
-                         artifactId("apache-camel").versionAsInProject().type("xml/features"),
                        
+            scanFeatures(getCamelKarafFeatureUrl(),                         
                           "camel-core", "camel-spring", "camel-test", "camel-protobuf"),
             
             workingDirectory("target/paxrunner/"),

Modified: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletComponentTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletComponentTest.java?rev=959571&r1=959570&r2=959571&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletComponentTest.java
(original)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletComponentTest.java
Thu Jul  1 09:42:48 2010
@@ -58,8 +58,7 @@ public class ServletComponentTest extend
             org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
             
             // using the features to install the camel components             
-            scanFeatures(mavenBundle().groupId("org.apache.camel.karaf").
-                         artifactId("apache-camel").versionAsInProject().type("xml/features"),
                        
+            scanFeatures(getCamelKarafFeatureUrl(),                         
                           "camel-core", "camel-spring", "camel-test", "camel-http", "camel-servlet"),
           
                 



Mime
View raw message