Author: ningjiang
Date: Fri Jul 15 12:54:51 2011
New Revision: 1147131
URL: http://svn.apache.org/viewvc?rev=1147131&view=rev
Log:
CAMEL-4228 applyed the custom jre.properties on the karaf configuration
Modified:
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/cxf/CxfProxyExampleTest.java
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml
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=1147131&r1=1147130&r2=1147131&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
Fri Jul 15 12:54:51 2011
@@ -15,7 +15,7 @@
* limitations under the License.
*/
package org.apache.camel.itest.osgi;
-
+import java.net.URL;
import org.apache.camel.CamelContext;
import org.apache.camel.osgi.CamelContextFactory;
import org.apache.camel.test.junit4.CamelTestSupport;
@@ -87,13 +87,30 @@ public class OSGiIntegrationTestSupport
artifactId("standard").version(karafVersion).type(type);
}
+ private static URL getResource(String location) {
+ URL url = null;
+ if (Thread.currentThread().getContextClassLoader() != null) {
+ url =
Thread.currentThread().getContextClassLoader().getResource(location);
+ }
+ if (url == null) {
+ url = Helper.class.getResource(location);
+ }
+ if (url == null) {
+ throw new RuntimeException("Unable to find resource " + location);
+ }
+ return url;
+ }
+
public static Option[] getDefaultCamelKarafOptions() {
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")),
-
+ // Set the karaf environment with some customer configuration
+ combine(
+ Helper.getDefaultConfigOptions(
+ Helper.getDefaultSystemOptions(),
+
getResource("/org/apache/camel/itest/karaf/config.properties"),
+ // this is how you set the default log level when using
pax logging (logProfile)
+ Helper.setLogLevel("WARN")),
+ Helper.getDefaultProvisioningOptions()),
// install the spring, http features first
scanFeatures(getKarafFeatureUrl(), "spring", "spring-dm", "jetty"),
@@ -101,10 +118,10 @@ public class OSGiIntegrationTestSupport
scanFeatures(getCamelKarafFeatureUrl(),
"camel-core", "camel-spring", "camel-test"),
- workingDirectory("target/paxrunner/"),
+ workingDirectory("target/paxrunner/"));
- equinox(),
- felix());
+ //equinox(),
+ //felix());
return options;
}
Modified:
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/CxfProxyExampleTest.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/CxfProxyExampleTest.java?rev=1147131&r1=1147130&r2=1147131&view=diff
==============================================================================
---
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/CxfProxyExampleTest.java
(original)
+++
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/cxf/CxfProxyExampleTest.java
Fri Jul 15 12:54:51 2011
@@ -50,8 +50,7 @@ public class CxfProxyExampleTest extends
factory.setAddress("http://localhost:9080/camel-itest-osgi/webservices/incident");
return (ReportIncidentEndpoint) factory.create();
}
-
- @Ignore("CXF bundle can't be installed in Karaf")
+
@Test
public void testCxfProxy() throws Exception {
// create input parameter
@@ -71,6 +70,7 @@ public class CxfProxyExampleTest extends
// assert we got a OK back
assertEquals("OK;456", out.getCode());
+ LOG.warn("Finish the testing");
}
@Override
@@ -84,17 +84,11 @@ public class CxfProxyExampleTest 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")),
-
- // install the spring, http features first
- scanFeatures(getKarafFeatureUrl(), "spring", "spring-dm", "jetty"),
+ getDefaultCamelKarafOptions(),
// using the features to install the camel components
scanFeatures(getCamelKarafFeatureUrl(),
- "spring", "spring-dm", "camel-core",
"camel-spring", "camel-http", "camel-test", "camel-cxf"),
+ "camel-http", "camel-cxf"),
// need to install the generated src as the pax-exam doesn't wrap
this bundles
provision(newBundle()
@@ -103,11 +97,7 @@ public class CxfProxyExampleTest extends
.add(org.apache.camel.example.reportincident.ReportIncidentEndpoint.class)
.add(org.apache.camel.example.reportincident.ReportIncidentEndpointService.class)
.add(org.apache.camel.example.reportincident.ObjectFactory.class)
- .build(withBnd())),
-
- workingDirectory("target/paxrunner/"),
-
- felix(), equinox());
+ .build(withBnd())));
return options;
}
Modified:
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml?rev=1147131&r1=1147130&r2=1147131&view=diff
==============================================================================
---
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml
(original)
+++
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/cxf/camel-config.xml
Fri Jul 15 12:54:51 2011
@@ -27,9 +27,7 @@
<!-- needed cxf imports -->
<import resource="classpath:META-INF/cxf/cxf.xml"/>
- <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
- <import resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml"/>
-
+
<!-- use a bean to start and stop the real web service (is not Camel
specific) -->
<!-- in a real use-case the real web service would be located on another
server
but we simulate this in the same JVM -->
@@ -45,8 +43,7 @@
<!-- this is the CXF webservice we use as front end -->
<cxf:cxfEndpoint id="reportIncident"
address="http://localhost:9080/camel-itest-osgi/webservices/incident"
-
serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"
- wsdlURL="report_incident.wsdl"/>
+
serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"/>
<!-- this is the camel route which proxy the web service and forward it to
the real web service -->
<camelContext xmlns="http://camel.apache.org/schema/spring">