You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by am...@apache.org on 2011/01/14 03:32:31 UTC
svn commit: r1058841 - in /camel/trunk/tests/camel-itest-osgi: pom.xml
src/test/java/org/apache/camel/itest/osgi/script/
src/test/java/org/apache/camel/itest/osgi/script/RubyOsgiTest.java
Author: ammulder
Date: Fri Jan 14 02:32:31 2011
New Revision: 1058841
URL: http://svn.apache.org/viewvc?rev=1058841&view=rev
Log:
Test showing that camel-script doesn't work in OSGi
However, it won't pass even when that is fixed unless you get an OSGi-ified
version of JRuby (or some other scripting language and change the route)
So it's @Ignored for now
Added:
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/script/
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/script/RubyOsgiTest.java (with props)
Modified:
camel/trunk/tests/camel-itest-osgi/pom.xml
Modified: camel/trunk/tests/camel-itest-osgi/pom.xml
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/pom.xml?rev=1058841&r1=1058840&r2=1058841&view=diff
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/pom.xml (original)
+++ camel/trunk/tests/camel-itest-osgi/pom.xml Fri Jan 14 02:32:31 2011
@@ -222,6 +222,16 @@
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
+ <artifactId>camel-script</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-ruby</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
</dependency>
Added: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/script/RubyOsgiTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/script/RubyOsgiTest.java?rev=1058841&view=auto
==============================================================================
--- camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/script/RubyOsgiTest.java (added)
+++ camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/script/RubyOsgiTest.java Fri Jan 14 02:32:31 2011
@@ -0,0 +1,63 @@
+package org.apache.camel.itest.osgi.script;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.itest.osgi.OSGiIntegrationTestSupport;
+import org.junit.Ignore;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+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.options;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.profile;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.scanFeatures;
+import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.workingDirectory;
+
+/**
+ * Test camel-script for Ruby expressions in OSGi
+ */
+@RunWith(JUnit4TestRunner.class)
+public class RubyOsgiTest extends OSGiIntegrationTestSupport {
+ protected RouteBuilder createRouteBuilder() throws Exception {
+ return new RouteBuilder() {
+ public void configure() {
+ from("direct:start").setBody().ruby("$request.body + $request.body").to("mock:finish");
+ }
+ };
+ }
+
+ @Ignore("You need an OSGi-ified version of JRuby for this to pass")
+ @Test
+ public void testSendMessage() throws Exception {
+ MockEndpoint mock = getMandatoryEndpoint("mock:finish", MockEndpoint.class);
+ assertNotNull("The mock endpoint should not be null", mock);
+
+ mock.expectedBodiesReceived("HelloHello");
+ template.sendBody("direct:start", "Hello");
+ assertMockEndpointsSatisfied();
+ }
+
+ @Configuration
+ public static Option[] configure() {
+ System.out.println("URL: " + getCamelKarafFeatureUrl());
+ Option[] options = options(
+
+ // install the spring dm profile
+ profile("spring.dm").version("1.2.0"),
+ // this is how you set the default log level when using pax logging (logProfile)
+ org.ops4j.pax.exam.CoreOptions.systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("INFO"),
+
+ // using the features to install the camel components
+ scanFeatures(getCamelKarafFeatureUrl(),
+ "camel-core", "camel-spring", "camel-test", "camel-script", "camel-ruby"),
+
+ workingDirectory("target/paxrunner/"),
+
+ felix(), equinox());
+
+ return options;
+ }
+}
Propchange: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/script/RubyOsgiTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/script/RubyOsgiTest.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/script/RubyOsgiTest.java
------------------------------------------------------------------------------
svn:mime-type = text/plain