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 2016/02/21 18:57:16 UTC

svn commit: r1731543 - in /webservices/axiom/branches/1.2.x: ./ testing/ testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/text/TestSerialize.java

Author: veithen
Date: Sun Feb 21 17:57:16 2016
New Revision: 1731543

URL: http://svn.apache.org/viewvc?rev=1731543&view=rev
Log:
Merge r1731541 to the 1.2 branch.

Modified:
    webservices/axiom/branches/1.2.x/   (props changed)
    webservices/axiom/branches/1.2.x/testing/   (props changed)
    webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
    webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/text/TestSerialize.java

Propchange: webservices/axiom/branches/1.2.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Feb 21 17:57:16 2016
@@ -12,4 +12,4 @@
 /webservices/axiom/branches/attrs-aspects:1685218-1686663
 /webservices/axiom/branches/namespaceURIInterning:1293148-1293587
 /webservices/axiom/branches/osgi-redesign:1180368-1180596
-/webservices/axiom/trunk:1726096,1726101,1726419,1726474-1726475,1726489,1727220,1727422,1727435,1727496,1727541,1727549,1727640,1727660,1727688,1727743,1727755,1727758,1727761,1728022,1728240,1728929,1730261,1730278,1731157,1731314-1731315,1731373,1731376,1731378,1731406,1731522
+/webservices/axiom/trunk:1726096,1726101,1726419,1726474-1726475,1726489,1727220,1727422,1727435,1727496,1727541,1727549,1727640,1727660,1727688,1727743,1727755,1727758,1727761,1728022,1728240,1728929,1730261,1730278,1731157,1731314-1731315,1731373,1731376,1731378,1731406,1731522,1731541

Propchange: webservices/axiom/branches/1.2.x/testing/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Feb 21 17:57:16 2016
@@ -12,4 +12,4 @@
 /webservices/axiom/branches/attrs-aspects/testing:1685218-1686663
 /webservices/axiom/branches/namespaceURIInterning/testing:1293148-1293587
 /webservices/axiom/branches/osgi-redesign/testing:1180368-1180596
-/webservices/axiom/trunk/testing:1726096,1726101,1726474-1726475,1726489,1727220,1727422,1727435,1727496,1727513,1727529,1727549,1727660,1727688,1728022,1728240,1728929,1731373,1731376,1731378,1731406,1731522
+/webservices/axiom/trunk/testing:1726096,1726101,1726474-1726475,1726489,1727220,1727422,1727435,1727496,1727513,1727529,1727549,1727660,1727688,1728022,1728240,1728929,1731373,1731376,1731378,1731406,1731522,1731541

Modified: webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1731543&r1=1731542&r2=1731543&view=diff
==============================================================================
--- webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Sun Feb 21 17:57:16 2016
@@ -25,6 +25,7 @@ import java.lang.reflect.Method;
 import javax.xml.namespace.QName;
 
 import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
 import org.apache.axiom.testing.multiton.Multiton;
 import org.apache.axiom.testutils.suite.MatrixTestSuiteBuilder;
 import org.apache.axiom.ts.dimension.AddAttributeStrategy;
@@ -621,7 +622,9 @@ public class OMTestSuiteBuilder extends
         addTest(new org.apache.axiom.ts.om.text.TestGetNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.text.TestGetNamespaceNoNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.text.TestGetTextCharactersFromDataHandler(metaFactory));
-        addTest(new org.apache.axiom.ts.om.text.TestSerialize(metaFactory));
+        addTest(new org.apache.axiom.ts.om.text.TestSerialize(metaFactory, OMNode.TEXT_NODE));
+        addTest(new org.apache.axiom.ts.om.text.TestSerialize(metaFactory, OMNode.SPACE_NODE));
+        addTest(new org.apache.axiom.ts.om.text.TestSerialize(metaFactory, OMNode.CDATA_SECTION_NODE));
         addTest(new org.apache.axiom.ts.om.xop.TestSerialize(metaFactory, false));
         addTest(new org.apache.axiom.ts.om.xop.TestSerialize(metaFactory, true));
         addTest(new org.apache.axiom.ts.om.xop.TestSetOptimize(metaFactory, false));

Modified: webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/text/TestSerialize.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/text/TestSerialize.java?rev=1731543&r1=1731542&r2=1731543&view=diff
==============================================================================
--- webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/text/TestSerialize.java (original)
+++ webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/text/TestSerialize.java Sun Feb 21 17:57:16 2016
@@ -26,20 +26,30 @@ import static org.mockito.Mockito.verify
 import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.ts.AxiomTestCase;
+import org.apache.axiom.util.stax.XMLEventUtils;
 
 public class TestSerialize extends AxiomTestCase {
-    public TestSerialize(OMMetaFactory metaFactory) {
+    private final int type;
+    
+    public TestSerialize(OMMetaFactory metaFactory, int type) {
         super(metaFactory);
+        this.type = type;
+        addTestParameter("type", XMLEventUtils.getEventTypeString(type));
     }
 
     @Override
     protected void runTest() throws Throwable {
-        OMText text = metaFactory.getOMFactory().createOMText("test");
+        OMText text = metaFactory.getOMFactory().createOMText("test", type);
         XMLStreamWriter writer = mock(XMLStreamWriter.class);
         text.serialize(writer);
-        verify(writer).writeCharacters(text.getText());
+        if (type == OMNode.CDATA_SECTION_NODE) {
+            verify(writer).writeCData(text.getText());
+        } else {
+            verify(writer).writeCharacters(text.getText());
+        }
         verify(writer, atMost(1)).flush();
         verifyNoMoreInteractions(writer);
     }