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 2013/03/02 07:58:30 UTC
svn commit: r1451844 -
/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java
Author: ningjiang
Date: Sat Mar 2 06:58:29 2013
New Revision: 1451844
URL: http://svn.apache.org/r1451844
Log:
Added an unit test to IOConverterTest
Modified:
camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java
Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java?rev=1451844&r1=1451843&r2=1451844&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/converter/IOConverterTest.java Sat Mar 2 06:58:29 2013
@@ -212,5 +212,15 @@ public class IOConverterTest extends Con
assertNotNull(data);
assertEquals("Hello World", context.getTypeConverter().convertTo(String.class, data));
}
+
+ public void testInputStreamToString() throws Exception {
+ String data = "46\u00B037'00\"N\"";
+ System.out.println(ObjectHelper.getDefaultCharacterSet());
+ ByteArrayInputStream is = new ByteArrayInputStream(data.getBytes("UTF-8"));
+ Exchange exchange = new DefaultExchange(context);
+ exchange.setProperty(Exchange.CHARSET_NAME, "UTF-8");
+ String result = IOConverter.toString(is, exchange);
+ assertEquals("Get a wrong result", data, result);
+ }
}