camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1361211 - in /camel/branches/camel-2.9.x: ./ camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
Date Fri, 13 Jul 2012 13:35:33 GMT
Author: ningjiang
Date: Fri Jul 13 13:35:33 2012
New Revision: 1361211

URL: http://svn.apache.org/viewvc?rev=1361211&view=rev
Log:
Merged revisions 1361207 via svnmerge from 
https://svn.apache.org/repos/asf/camel/branches/camel-2.10.x

................
  r1361207 | ningjiang | 2012-07-13 21:28:31 +0800 (Fri, 13 Jul 2012) | 9 lines
  
  Merged revisions 1361116 via svnmerge from 
  https://svn.apache.org/repos/asf/camel/trunk
  
  ........
    r1361116 | ningjiang | 2012-07-13 17:11:04 +0800 (Fri, 13 Jul 2012) | 1 line
    
    CAMEL-5440 Added an unit test to show the issue
  ........
................

Modified:
    camel/branches/camel-2.9.x/   (props changed)
    camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java

Propchange: camel/branches/camel-2.9.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1361116
  Merged /camel/branches/camel-2.10.x:r1361207

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

Modified: camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java?rev=1361211&r1=1361210&r2=1361211&view=diff
==============================================================================
--- camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
(original)
+++ camel/branches/camel-2.9.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
Fri Jul 13 13:35:33 2012
@@ -16,6 +16,8 @@
  */
 package org.apache.camel.component.mock;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -624,6 +626,22 @@ public class MockEndpointTest extends Co
 
         mock.assertIsSatisfied();
     }
+    
+    public void testSetMultipleExpectedHeaders4() throws Exception {
+        // to test the header value with Stream which can only be consumed once
+        InputStream is = new ByteArrayInputStream("Test".getBytes());
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(1);
+        mock.expectedHeaderReceived("foo", 123);
+        mock.expectedHeaderReceived("bar", "Test");
+
+        Map<String, Object> map = new HashMap<String, Object>();
+        map.put("foo", 123);
+        map.put("bar", is);
+        template.sendBodyAndHeaders("direct:a", "Hello World", map);
+
+        mock.assertIsSatisfied();
+    }
 
     public void testSetMultipleExpectedHeadersShouldFail() throws Exception {
         MockEndpoint mock = getMockEndpoint("mock:result");



Mime
View raw message