camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r618719 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/JaxpTest.java
Date Tue, 05 Feb 2008 17:46:41 GMT
Author: jstrachan
Date: Tue Feb  5 09:46:36 2008
New Revision: 618719

URL: http://svn.apache.org/viewvc?rev=618719&view=rev
Log:
added test case to show this is now fixed : http://issues.apache.org/activemq/browse/CAMEL-318

Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/JaxpTest.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/JaxpTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/JaxpTest.java?rev=618719&r1=618718&r2=618719&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/JaxpTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/JaxpTest.java
Tue Feb  5 09:46:36 2008
@@ -17,6 +17,7 @@
 package org.apache.camel.converter;
 
 import java.io.StringReader;
+import java.io.InputStream;
 
 import javax.xml.transform.Source;
 import javax.xml.transform.dom.DOMSource;
@@ -69,12 +70,19 @@
         LOG.debug("Found document: " + domSource);
     }
 
-    public void testNodeToSource() throws Exception {
+    public void testNodeToSourceThenToInputStream() throws Exception {
         Document document = converter.convertTo(Document.class, "<?xml version=\"1.0\"?><hello>world!</hello>");
         Element element = document.getDocumentElement();
         Source source = converter.convertTo(Source.class, element);
         assertNotNull("Could not convert from Node to Source!", source);
 
         LOG.debug("Found source: " + source);
+
+        InputStream in = converter.convertTo(InputStream.class, source);
+        assertNotNull("Could not convert from Source to InputStream!", in);
+
+        String actualText = IOConverter.toString(in);
+        assertEquals("Text", "<hello>world!</hello>", actualText);
+
     }
 }



Mime
View raw message