camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1222069 - in /camel/branches/camel-2.7.x: ./ camel-core/src/main/java/org/apache/camel/converter/IOConverter.java camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java
Date Thu, 22 Dec 2011 06:52:56 GMT
Author: ningjiang
Date: Thu Dec 22 06:52:55 2011
New Revision: 1222069

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

................
  r1222020 | ningjiang | 2011-12-22 11:33:48 +0800 (Thu, 22 Dec 2011) | 9 lines
  
  Merged revisions 1222006 via svnmerge from 
  https://svn.apache.org/repos/asf/camel/trunk
  
  ........
    r1222006 | ningjiang | 2011-12-22 10:37:19 +0800 (Thu, 22 Dec 2011) | 1 line
    
    CAMEL-4813 Added  a converter to turn StringBuffer to InputStream
  ........
................

Modified:
    camel/branches/camel-2.7.x/   (props changed)
    camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
    camel/branches/camel-2.7.x/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java

Propchange: camel/branches/camel-2.7.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Dec 22 06:52:55 2011
@@ -1,2 +1,2 @@
-/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774,1211814,1213201,1213531,1214058,1214648,1220717,1221574
-/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773,1211811,1213197,1213219,1213526,1214639,1220711,1221566
+/camel/branches/camel-2.8.x:1170965,1171400,1174571,1175323,1176329,1176787,1177397,1177946,1177949,1180598,1187226,1189704,1199138,1199732,1199766,1199807,1200867,1201638-1201639,1202171,1202222,1202662,1204355,1205709,1208933,1210779,1210916,1211366,1211774,1211814,1213201,1213531,1214058,1214648,1220717,1221574,1222020
+/camel/trunk:1146608,1146903,1147216,1170956,1171396,1174565,1175321,1176274,1176781-1176782,1177394,1177945,1177948,1180597,1187221,1189693,1199137,1199703,1199739,1199804,1200861,1201623,1201637,1202167,1202215,1202659,1204338,1205412,1208930,1210771,1210830,1211363,1211773,1211811,1213197,1213219,1213526,1214639,1220711,1221566,1222006

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

Modified: camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java?rev=1222069&r1=1222068&r2=1222069&view=diff
==============================================================================
--- camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
(original)
+++ camel/branches/camel-2.7.x/camel-core/src/main/java/org/apache/camel/converter/IOConverter.java
Thu Dec 22 06:52:55 2011
@@ -142,6 +142,11 @@ public final class IOConverter {
         return toInputStream(text.getBytes(getCharsetName(exchange)));
     }
     
+    @Converter
+    public static InputStream toInputStream(StringBuffer buffer, Exchange exchange) throws
IOException {
+        return toInputStream(buffer.toString(), exchange);
+    }
+    
     @Deprecated
     public static InputStream toInputStream(BufferedReader buffer) throws IOException {
         return toInputStream(buffer, null);

Modified: camel/branches/camel-2.7.x/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.7.x/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java?rev=1222069&r1=1222068&r2=1222069&view=diff
==============================================================================
--- camel/branches/camel-2.7.x/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java
(original)
+++ camel/branches/camel-2.7.x/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java
Thu Dec 22 06:52:55 2011
@@ -105,6 +105,15 @@ public class IOConverterTest extends Con
         InputStream is = IOConverter.toInputStream("Hello World", exchange);
         assertNotNull(is);
     }
+    
+    public void testToInputStreamStringBufferExchange() throws Exception {
+        Exchange exchange = new DefaultExchange(context);
+        exchange.setProperty(Exchange.CHARSET_NAME, ObjectHelper.getDefaultCharacterSet());
+        StringBuffer buffer = new StringBuffer();
+        buffer.append("Hello World");
+        InputStream is = IOConverter.toInputStream(buffer, exchange);
+        assertNotNull(is);
+    }
 
     public void testToInputStreamBufferReader() throws Exception {
         Exchange exchange = new DefaultExchange(context);



Mime
View raw message