camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhira...@apache.org
Subject [11/35] git commit: Added test for invoking a derived proxy class
Date Tue, 10 Jun 2014 19:51:39 GMT
Added test for invoking a derived proxy class


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

Branch: refs/heads/master
Commit: ec5a57ee16cceb34d54febccb162efd32d8bd2dc
Parents: ace29c8
Author: Dhiraj Bokde <dhirajsb@yahoo.com>
Authored: Wed May 28 14:19:35 2014 -0700
Committer: Dhiraj Bokde <dhirajsb@yahoo.com>
Committed: Tue Jun 10 12:48:31 2014 -0700

----------------------------------------------------------------------
 .../camel/util/component/ApiMethodHelperTest.java    | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/ec5a57ee/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
----------------------------------------------------------------------
diff --git a/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
b/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
index f41bc76..12bc877 100644
--- a/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
+++ b/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
@@ -132,6 +132,21 @@ public class ApiMethodHelperTest {
         properties.put("name1", "Dave");
         properties.put("name2", "Frank");
         assertEquals("greetUs(name1, name2)", "Greetings Dave, Frank", apiMethodHelper.invokeMethod(proxy,
TestMethod.GREETUS, properties));
+
+        properties.clear();
+        properties.put("names", new String[] { "Dave", "Frank" });
+        assertEquals("greetAll(names)", "Greetings Dave, Frank", apiMethodHelper.invokeMethod(proxy,
TestMethod.GREETALL, properties));
+
+        // test with a derived proxy
+        proxy = new TestProxy() {
+            @Override
+            public String sayHi(String name) {
+                return "Howdy " + name;
+            }
+        };
+        properties.clear();
+        properties.put("name", "Dave");
+        assertEquals("Derived sayHi(name)", "Howdy Dave", apiMethodHelper.invokeMethod(proxy,
TestMethod.SAYHI_1, properties));
     }
 
     static enum TestMethod implements ApiMethod {


Mime
View raw message