camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [6/6] camel git commit: CAMEL-8564: Add unit test
Date Sat, 28 Mar 2015 15:57:42 GMT
CAMEL-8564: Add unit test


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c5363b16
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c5363b16
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c5363b16

Branch: refs/heads/camel-2.15.x
Commit: c5363b16f08295694742cb7b10e54ef1cd92bc0d
Parents: 8516820
Author: Ramon Marco L. Navarro <ramonmaruko@gmail.com>
Authored: Sat Mar 28 23:46:40 2015 +0800
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Sat Mar 28 16:59:50 2015 +0100

----------------------------------------------------------------------
 .../dsl/DataFormatStringDataTypeRefTest.scala   | 50 ++++++++++++++++++++
 1 file changed, 50 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c5363b16/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/DataFormatStringDataTypeRefTest.scala
----------------------------------------------------------------------
diff --git a/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/DataFormatStringDataTypeRefTest.scala
b/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/DataFormatStringDataTypeRefTest.scala
new file mode 100644
index 0000000..c2ee163
--- /dev/null
+++ b/components/camel-scala/src/test/scala/org/apache/camel/scala/dsl/DataFormatStringDataTypeRefTest.scala
@@ -0,0 +1,50 @@
+/**
+ * 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.scala
+package dsl
+
+import org.junit.Test
+import builder.RouteBuilder
+import test.Adult
+
+/**
+ * Test case for working with data formats
+ */
+class DataFormatStringDataTypeRefTest extends ScalaTestSupport {
+ 
+  @Test
+  def testDataFormat() {
+    val person = new Adult("Captain Nemo")
+    "mock:a" expect { _.received(person) } 
+    test {
+      "direct:a" ! person
+    }
+  }
+    
+  val builder =
+    new RouteBuilder {
+       //START SNIPPET: dataformat
+       "direct:a" marshal("serialization") to "direct:serialwithstringref"
+       
+       "direct:serialwithstringref" ==> {
+         unmarshal("serialization")
+         to ("mock:a") 
+       }
+       //END SNIPPET: dataformat
+    }
+
+}


Mime
View raw message