Author: davsclaus
Date: Sun Jun 3 14:44:03 2012
New Revision: 1345681
URL: http://svn.apache.org/viewvc?rev=1345681&view=rev
Log:
CAMEL-52520: Added osgi unit test.
Added:
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.java
- copied, changed from r1345680,
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvTest.java
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/MyRoutes.java
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.xml
- copied, changed from r1345680,
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvTest.xml
Copied:
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.java
(from r1345680,
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvTest.java)
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.java?p2=camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.java&p1=camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvTest.java&r1=1345680&r2=1345681&rev=1345681&view=diff
==============================================================================
---
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvTest.java
(original)
+++
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.java
Sun Jun 3 14:44:03 2012
@@ -36,7 +36,7 @@ import static org.ops4j.pax.exam.OptionU
*
*/
@RunWith(JUnit4TestRunner.class)
-public class BindySpringDataFormatCsvTest extends
OSGiIntegrationSpringTestSupport {
+public class BindySpringDataFormatCsvJavaRouteTest extends
OSGiIntegrationSpringTestSupport {
private static final String FIXED_DATA =
"Joe,Smith,Developer,75000,10012009" + "\n"
+ "Jane,Doe,Architect,80000,01152008" + "\n"
Added:
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/MyRoutes.java
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/MyRoutes.java?rev=1345681&view=auto
==============================================================================
---
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/MyRoutes.java
(added)
+++
camel/trunk/tests/camel-itest-osgi/src/test/java/org/apache/camel/itest/osgi/bindy/MyRoutes.java
Sun Jun 3 14:44:03 2012
@@ -0,0 +1,34 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.itest.osgi.bindy;
+
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ *
+ */
+public class MyRoutes extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ from("direct:unmarshal").unmarshal("myBindy")
+ .split(simple("body")).to("mock:bindy-unmarshal");
+
+ from("direct:marshal").marshal("myBindy")
+ .to("mock:bindy-marshal");
+ }
+}
Copied:
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.xml
(from r1345680,
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvTest.xml)
URL:
http://svn.apache.org/viewvc/camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.xml?p2=camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.xml&p1=camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvTest.xml&r1=1345680&r2=1345681&rev=1345681&view=diff
==============================================================================
---
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvTest.xml
(original)
+++
camel/trunk/tests/camel-itest-osgi/src/test/resources/org/apache/camel/itest/osgi/bindy/BindySpringDataFormatCsvJavaRouteTest.xml
Sun Jun 3 14:44:03 2012
@@ -23,26 +23,16 @@
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd">
+ <bean id="myRoutes" class="org.apache.camel.itest.osgi.bindy.MyRoutes"/>
+
<camelContext xmlns="http://camel.apache.org/schema/spring">
+ <routeBuilder ref="myRoutes"/>
+
<dataFormats>
<bindy id="myBindy" type="Csv"
classType="org.apache.camel.itest.osgi.bindy.Employee"/>
</dataFormats>
- <route>
- <from uri="direct:unmarshal"/>
- <unmarshal ref="myBindy"/>
- <split>
- <simple>${body}</simple>
- <to uri="mock:bindy-unmarshal"/>
- </split>
- </route>
-
- <route>
- <from uri="direct:marshal"/>
- <marshal ref="myBindy"/>
- <to uri="mock:bindy-marshal"/>
- </route>
</camelContext>
</beans>