You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2012/11/13 22:55:18 UTC

svn commit: r1408980 - in /webservices/commons/trunk/modules/axiom/modules: axiom-parent/pom.xml axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java

Author: veithen
Date: Tue Nov 13 21:55:16 2012
New Revision: 1408980

URL: http://svn.apache.org/viewvc?rev=1408980&view=rev
Log:
AXIOM-441: Added some stuff needed to run our test suites with the StAX implementation in Java 7.

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-parent/pom.xml
    webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-parent/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-parent/pom.xml?rev=1408980&r1=1408979&r2=1408980&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-parent/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-parent/pom.xml Tue Nov 13 21:55:16 2012
@@ -249,6 +249,16 @@
                                 <name>java.awt.headless</name>
                                 <value>true</value>
                             </property>
+                            <!-- Uncomment this to test with the StAX implementation in Java 7 -->
+                            <!-- property>
+                                <name>javax.xml.stream.XMLInputFactory</name>
+                                <value>com.sun.xml.internal.stream.XMLInputFactoryImpl</value>
+                            </property>
+                            <property>
+                                <name>javax.xml.stream.XMLOutputFactory</name>
+                                <value>com.sun.xml.internal.stream.XMLOutputFactoryImpl</value>
+                            </property -->
+                            <!-- Uncomment this to test with BEA's reference implementation -->
                             <!-- property>
                                 <name>javax.xml.stream.XMLInputFactory</name>
                                 <value>com.bea.xml.stream.MXParserFactory</value>

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java?rev=1408980&r1=1408979&r2=1408980&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/conformance/ConformanceTestFile.java Tue Nov 13 21:55:16 2012
@@ -33,6 +33,8 @@ import javax.xml.transform.stream.Stream
 
 import org.codehaus.stax2.DTDInfo;
 
+import com.ctc.wstx.stax.WstxInputFactory;
+
 public final class ConformanceTestFile {
     private static ConformanceTestFile[] instances;
     
@@ -91,7 +93,10 @@ public final class ConformanceTestFile {
                 BufferedReader in = new BufferedReader(new InputStreamReader(
                         ConformanceTestFile.class.getResourceAsStream("filelist")));
                 List result = new ArrayList(10);
-                XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+                // We make use of Woodstox' DTDInfo interface here, but we want to be able to use system properties
+                // to specify the StAX implementation to be used by the tests. Therefore we need to create
+                // an instance of the Woodstox InputFactory implementation directly.
+                XMLInputFactory inputFactory = new WstxInputFactory();
                 inputFactory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
                 String name;
                 while ((name = in.readLine()) != null) {