Author: veithen
Date: Sat Apr 11 20:34:47 2009
New Revision: 764250
URL: http://svn.apache.org/viewvc?rev=764250&view=rev
Log:
Avoid test failures due to WSTX-201.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/WoodstoxXMLStreamReaderWrapper.java
(with props)
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/cdata.xml
(with props)
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMStAXWrapperConformanceTestCase.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMStAXWrapperConformanceTestCase.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMStAXWrapperConformanceTestCase.java?rev=764250&r1=764249&r2=764250&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMStAXWrapperConformanceTestCase.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/OMStAXWrapperConformanceTestCase.java
Sat Apr 11 20:34:47 2009
@@ -50,7 +50,8 @@
InputStream in1 = getTestResource(file);
InputStream in2 = getTestResource(file);
try {
- XMLStreamReader expected = StAXUtils.createXMLStreamReader(in1);
+ XMLStreamReader expected = new WoodstoxXMLStreamReaderWrapper(
+ StAXUtils.createXMLStreamReader(in1));
// Skip to document element. Note that nextTag is not appropriate
here because
// there could be a DTD event.
while (expected.next() != XMLStreamReader.START_ELEMENT) {
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/WoodstoxXMLStreamReaderWrapper.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/WoodstoxXMLStreamReaderWrapper.java?rev=764250&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/WoodstoxXMLStreamReaderWrapper.java
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/WoodstoxXMLStreamReaderWrapper.java
Sat Apr 11 20:34:47 2009
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.impl;
+
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.util.StreamReaderDelegate;
+
+/**
+ * Wrapper fixing known issues in the Woodstox parser. We need this to avoid
+ * false positives in {...@link
org.apache.axiom.stax.XMLStreamReaderComparator}.
+ * Once the issues are fixed in Woodstox we can remove this class.
+ */
+public class WoodstoxXMLStreamReaderWrapper extends StreamReaderDelegate {
+ public WoodstoxXMLStreamReaderWrapper(XMLStreamReader reader) {
+ super(reader);
+ }
+
+ public boolean isCharacters() {
+ // This addresses WSTX-201:
+ return getEventType() == CHARACTERS;
+ }
+}
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/impl/WoodstoxXMLStreamReaderWrapper.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/cdata.xml
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/cdata.xml?rev=764250&view=auto
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/cdata.xml
(added)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/cdata.xml
Sat Apr 11 20:34:47 2009
@@ -0,0 +1,2 @@
+<?xml version="1.0"?>
+<root><![CDATA[some text]]></root>
Propchange:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/resources/conformance/cdata.xml
------------------------------------------------------------------------------
svn:eol-style = native