Author: ningjiang
Date: Mon Jul 25 13:03:23 2011
New Revision: 1150678

URL: http://svn.apache.org/viewvc?rev=1150678&view=rev
Log:
Clean up the OSGi test of serlvet component

Modified:
    
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletComponentTest.java
    
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletServicesTest.java

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=1150678&r1=1150677&r2=1150678&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
 Mon Jul 25 13:03:23 2011
@@ -17,7 +17,6 @@
 package org.apache.camel.itest.osgi.servlet;
 
 import org.apache.camel.itest.osgi.OSGiIntegrationSpringTestSupport;
-import org.apache.karaf.testing.Helper;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Option;
@@ -25,11 +24,8 @@ import org.ops4j.pax.exam.junit.Configur
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import 
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
 
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
 import static org.ops4j.pax.exam.OptionUtils.combine;
 import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures;
-import static 
org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory;
 
 @RunWith(JUnit4TestRunner.class)
 public class ServletComponentTest extends OSGiIntegrationSpringTestSupport {
@@ -46,23 +42,17 @@ public class ServletComponentTest extend
     @Configuration
     public static Option[] configure() throws Exception {
         Option[] options = combine(
-            // Default karaf environment
-            Helper.getDefaultOptions(
-            // this is how you set the default log level when using pax 
logging (logProfile)
-                Helper.setLogLevel("WARN")),
-            Helper.loadKarafStandardFeatures("spring", "jetty", "http", "war"),
+            getDefaultCamelKarafOptions(),
+            // install the war features first
+            scanFeatures(getKarafFeatureUrl(),  "war"),
             // set the system property for pax web
             
org.ops4j.pax.exam.CoreOptions.systemProperty("org.osgi.service.http.port").value("9080"),
-            
-            // using the features to install the camel components             
-            scanFeatures(getCamelKarafFeatureUrl(),                         
-                          "camel-core", "camel-spring", "camel-test", 
"camel-http", "camel-servlet"),
-
-            workingDirectory("target/paxrunner/"),
-
-            felix(),
-            equinox());
-        
+
+            // using the features to install the camel components
+            scanFeatures(getCamelKarafFeatureUrl(),
+                "camel-blueprint", "camel-http", "camel-servlet")
+
+        );
         return options;
     }
     

Modified: 
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletServicesTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletServicesTest.java?rev=1150678&r1=1150677&r2=1150678&view=diff
==============================================================================
--- 
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletServicesTest.java
 (original)
+++ 
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/servlet/ServletServicesTest.java
 Mon Jul 25 13:03:23 2011
@@ -17,20 +17,15 @@
 package org.apache.camel.itest.osgi.servlet;
 
 import org.apache.camel.itest.osgi.OSGiIntegrationSpringTestSupport;
-import org.apache.karaf.testing.Helper;
 import org.junit.Test;
 import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.CoreOptions;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import 
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext;
 
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
 import static org.ops4j.pax.exam.OptionUtils.combine;
 import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures;
-import static 
org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory;
 
 @RunWith(JUnit4TestRunner.class)
 public class ServletServicesTest extends OSGiIntegrationSpringTestSupport {
@@ -45,23 +40,16 @@ public class ServletServicesTest extends
     @Configuration
     public static Option[] configure() throws Exception {
         Option[] options = combine(
-            // Default karaf environment
-            Helper.getDefaultOptions(
-            // this is how you set the default log level when using pax 
logging (logProfile)
-                Helper.setLogLevel("WARN")),
-            Helper.loadKarafStandardFeatures("spring", "http", "war"),  
+            getDefaultCamelKarafOptions(),
+            // install the war features first
+            scanFeatures(getKarafFeatureUrl(),  "war"),
             // set the system property for pax web
             
org.ops4j.pax.exam.CoreOptions.systemProperty("org.osgi.service.http.port").value("9080"),
   
             // using the features to install the camel components             
             scanFeatures(getCamelKarafFeatureUrl(),                         
-                "camel-core", "camel-blueprint", "camel-spring", "camel-test", 
"camel-http", "camel-servlet"),
- 
-            workingDirectory("target/paxrunner/"),
-            
//PaxRunnerOptions.vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"),
+                "camel-blueprint", "camel-http", "camel-servlet")
 
-            felix(),
-            equinox()
         );
         
         return options;


Reply via email to