camel-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=1361207&view=rev
Log:
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.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java

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

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jul 13 13:28:31 2012
@@ -1 +1 @@
-/camel/trunk:1-1358964,1359013,1359197,1359226,1359265,1359341,1359383,1360031,1360241,1360339,1360525-1360527,1360581,1360583,1360719,1361117
+/camel/trunk:1-1358964,1359013,1359197,1359226,1359265,1359341,1359383,1360031,1360241,1360339,1360525-1360527,1360581,1360583,1360719,1361116-1361117

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java?rev=1361207&r1=1361206&r2=1361207&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/component/mock/MockEndpointTest.java
Fri Jul 13 13:28:31 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;
@@ -647,6 +649,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