You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2011/11/29 10:00:45 UTC

svn commit: r1207795 - in /camel/branches/camel-2.8.x: ./ examples/camel-example-osgi-rmi/src/test/java/org/apache/camel/example/osgi/RmiTest.java

Author: ningjiang
Date: Tue Nov 29 09:00:44 2011
New Revision: 1207795

URL: http://svn.apache.org/viewvc?rev=1207795&view=rev
Log:
Merged revisions 1207784 via svnmerge from 
https://svn.apache.org/repos/asf/camel/trunk

........
  r1207784 | ningjiang | 2011-11-29 16:36:12 +0800 (Tue, 29 Nov 2011) | 1 line
  
  Do some enhancement on camel-example-osgi-rmi to run the test without start the camel router
........

Modified:
    camel/branches/camel-2.8.x/   (props changed)
    camel/branches/camel-2.8.x/examples/camel-example-osgi-rmi/src/test/java/org/apache/camel/example/osgi/RmiTest.java

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 29 09:00:44 2011
@@ -1 +1 @@
-/camel/trunk:1202148,1202167,1202204-1202206,1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372,1205412,1205429,1205431,1205713,1206116,1206414,1207743
+/camel/trunk:1202148,1202167,1202204-1202206,1202215,1202223,1202659,1202685,1203879,1203978,1204338,1205124,1205372,1205412,1205429,1205431,1205713,1206116,1206414,1207743,1207784

Propchange: camel/branches/camel-2.8.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.8.x/examples/camel-example-osgi-rmi/src/test/java/org/apache/camel/example/osgi/RmiTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/examples/camel-example-osgi-rmi/src/test/java/org/apache/camel/example/osgi/RmiTest.java?rev=1207795&r1=1207794&r2=1207795&view=diff
==============================================================================
--- camel/branches/camel-2.8.x/examples/camel-example-osgi-rmi/src/test/java/org/apache/camel/example/osgi/RmiTest.java (original)
+++ camel/branches/camel-2.8.x/examples/camel-example-osgi-rmi/src/test/java/org/apache/camel/example/osgi/RmiTest.java Tue Nov 29 09:00:44 2011
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.example.osgi;
 
+import org.apache.camel.CamelContext;
+import org.apache.camel.ProducerTemplate;
+import org.apache.camel.impl.DefaultCamelContext;
 import org.apache.camel.test.junit4.CamelSpringTestSupport;
 import org.junit.Test;
 import org.springframework.context.support.AbstractApplicationContext;
@@ -35,8 +38,20 @@ public class RmiTest extends CamelSpring
 
     @Test
     public void testRmi() throws Exception {
-        String out = template.requestBody("rmi://localhost:37541/helloServiceBean", "Camel", String.class);
-        assertEquals("Hello Camel", out);
+        // Create a new camel context to send the request so we can test the service which is deployed into a container
+        CamelContext camelContext = new DefaultCamelContext();
+        ProducerTemplate myTemplate = camelContext.createProducerTemplate();
+        myTemplate.start();
+        try {
+            String out = myTemplate.requestBody("rmi://localhost:37541/helloServiceBean", "Camel", String.class);
+            assertEquals("Hello Camel", out);
+        } finally {
+            if (myTemplate != null) {
+                template.stop();
+            }
+            camelContext.stop();
+        }
+        
     }
 
 }