Author: bimargulies
Date: Tue Jan 6 10:29:59 2009
New Revision: 732036
URL: http://svn.apache.org/viewvc?rev=732036&view=rev
Log:
Add (ignored) unit test for bug in DOM stax reader.
Modified:
cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java
Modified: cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java?rev=732036&r1=732035&r2=732036&view=diff
==============================================================================
--- cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java
(original)
+++ cxf/trunk/common/common/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java
Tue Jan 6 10:29:59 2009
@@ -31,7 +31,9 @@
import javax.xml.transform.dom.DOMSource;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.helpers.XMLUtils;
import org.junit.Assert;
@@ -49,7 +51,8 @@
@Test
public void testReader() throws Exception {
ByteArrayInputStream is = new ByteArrayInputStream(
- "<Test xmlns=\"http://example.org/types\"><argument>foobar</argument></Test>".getBytes());
+ "<Test xmlns=\"http://example.org/types\"><argument>foobar</argument></Test>"
+ .getBytes("utf-8"));
DocumentBuilderFactory docBuilderFactory =
DocumentBuilderFactory.newInstance();
docBuilderFactory.setNamespaceAware(true);
@@ -68,5 +71,18 @@
assertTrue(XMLUtils.toString(writer.getDocument()).endsWith(RESULT));
}
+
+ @org.junit.Ignore
+ @Test
+ public void testTopLevelText() throws Exception {
+ ByteArrayInputStream is = new ByteArrayInputStream(
+ "<t:Test xmlns:t=\"http://example.org/types\">gorilla</t:Test>"
+ .getBytes("utf-8"));
+ Document doc = DOMUtils.readXml(is);
+ Element e = doc.getDocumentElement();
+ XMLStreamReader reader = StaxUtils.createXMLStreamReader(e);
+ String value = reader.getElementText();
+ assertEquals("gorilla", value);
+ }
}
\ No newline at end of file
|