ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1550950 - in /webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element: TestGetSAXSourceIdentityTransform.java TestGetSAXSourceIdentityTransformOnFragment.java
Date Sat, 14 Dec 2013 17:23:36 GMT
Author: veithen
Date: Sat Dec 14 17:23:35 2013
New Revision: 1550950

URL: http://svn.apache.org/r1550950
Log:
Rewrite the TestGetSAXSourceIdentityTransform test cases to use getSAXResult instead of OMResult.

Modified:
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransform.java
    webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransformOnFragment.java

Modified: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransform.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransform.java?rev=1550950&r1=1550949&r2=1550950&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransform.java
(original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransform.java
Sat Dec 14 17:23:35 2013
@@ -28,11 +28,11 @@ import javax.xml.transform.Transformer;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
+import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.impl.jaxp.OMResult;
 import org.apache.axiom.testutils.suite.XSLTImplementation;
 import org.apache.axiom.ts.AxiomTestCase;
 
@@ -57,15 +57,16 @@ public class TestGetSAXSourceIdentityTra
         
         OMFactory factory = metaFactory.getOMFactory();
         OMElement element = OMXMLBuilderFactory.createOMBuilder(factory, getInput()).getDocumentElement();
-        OMResult omResult = new OMResult(factory);
-        transformer.transform(element.getSAXSource(cache), omResult);
+        OMDocument outputDocument = factory.createOMDocument();
+        transformer.transform(element.getSAXSource(cache), outputDocument.getSAXResult());
         
         StreamSource streamSource = new StreamSource(getInput());
         StringWriter out = new StringWriter();
         StreamResult streamResult = new StreamResult(out);
         transformer.transform(streamSource, streamResult);
         
-        XMLAssert.assertXMLIdentical(XMLUnit.compareXML(out.toString(), omResult.getRootElement().toString()),
true);
+        System.out.println(outputDocument.getOMDocumentElement().toString());
+        XMLAssert.assertXMLIdentical(XMLUnit.compareXML(out.toString(), outputDocument.getOMDocumentElement().toString()),
true);
         
         element.close(false);
     }

Modified: webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransformOnFragment.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransformOnFragment.java?rev=1550950&r1=1550949&r2=1550950&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransformOnFragment.java
(original)
+++ webservices/axiom/trunk/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetSAXSourceIdentityTransformOnFragment.java
Sat Dec 14 17:23:35 2013
@@ -24,6 +24,7 @@ import javax.xml.transform.Transformer;
 import javax.xml.transform.sax.SAXSource;
 
 import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMMetaFactory;
@@ -75,10 +76,10 @@ public class TestGetSAXSourceIdentityTra
         
         OMFactory factory = metaFactory.getOMFactory();
         OMElement element = OMXMLBuilderFactory.createOMBuilder(factory, getInput()).getDocumentElement().getFirstElement();
-        OMResult omResult = new OMResult(factory);
-        transformer.transform(element.getSAXSource(cache), omResult);
+        OMDocument outputDocument = factory.createOMDocument();
+        transformer.transform(element.getSAXSource(cache), outputDocument.getSAXResult());
         
-        OMNamespace ns = omResult.getRootElement().findNamespaceURI("p");
+        OMNamespace ns = outputDocument.getOMDocumentElement().findNamespaceURI("p");
         assertNotNull(ns);
         assertEquals("urn:some:namespace", ns.getNamespaceURI());
         



Mime
View raw message