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/20 15:31:28 UTC

svn commit: r1731409 - in /webservices/axiom/branches/1.2.x: ./ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/ testing/ testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/ testing/axiom-testsuite/src/main/java/org/apache/axio...

Author: veithen
Date: Sat Feb 20 14:31:28 2016
New Revision: 1731409

URL: http://svn.apache.org/viewvc?rev=1731409&view=rev
Log:
Merge r1731406 to the 1.2 branch and fix an issue revealed by the new test case.

Modified:
    webservices/axiom/branches/1.2.x/   (props changed)
    webservices/axiom/branches/1.2.x/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java
    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/factory/TestCreateOMTextFromDataHandlerProvider.java

Propchange: webservices/axiom/branches/1.2.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Feb 20 14:31:28 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
+/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

Modified: webservices/axiom/branches/1.2.x/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/1.2.x/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java?rev=1731409&r1=1731408&r2=1731409&view=diff
==============================================================================
--- webservices/axiom/branches/1.2.x/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java (original)
+++ webservices/axiom/branches/1.2.x/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/intf/TextContent.java Sat Feb 20 14:31:28 2016
@@ -71,6 +71,7 @@ public final class TextContent implement
     public TextContent(String contentID, DataHandlerProvider dataHandlerProvider, boolean optimize) {
         this.value = null;
         mimeType = null;
+        this.contentID = contentID;
         dataHandlerObject = dataHandlerProvider;
         binary = true;
         this.optimize = optimize;

Propchange: webservices/axiom/branches/1.2.x/testing/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Feb 20 14:31:28 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
+/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

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=1731409&r1=1731408&r2=1731409&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 Sat Feb 20 14:31:28 2016
@@ -477,7 +477,8 @@ public class OMTestSuiteBuilder extends
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMNamespaceWithNullURI(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMProcessingInstructionWithoutParent(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMText(metaFactory));
-        addTest(new org.apache.axiom.ts.om.factory.TestCreateOMTextFromDataHandlerProvider(metaFactory));
+        addTest(new org.apache.axiom.ts.om.factory.TestCreateOMTextFromDataHandlerProvider(metaFactory, false));
+        addTest(new org.apache.axiom.ts.om.factory.TestCreateOMTextFromDataHandlerProvider(metaFactory, true));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMTextFromOMText(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMTextWithNullParent(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestFactoryIsSingleton(metaFactory));

Modified: webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromDataHandlerProvider.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromDataHandlerProvider.java?rev=1731409&r1=1731408&r2=1731409&view=diff
==============================================================================
--- webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromDataHandlerProvider.java (original)
+++ webservices/axiom/branches/1.2.x/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromDataHandlerProvider.java Sat Feb 20 14:31:28 2016
@@ -18,6 +18,8 @@
  */
 package org.apache.axiom.ts.om.factory;
 
+import static com.google.common.truth.Truth.assertThat;
+
 import javax.activation.DataHandler;
 
 import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
@@ -25,6 +27,7 @@ import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMText;
 import org.apache.axiom.ts.AxiomTestCase;
+import org.apache.axiom.util.UIDGenerator;
 
 public class TestCreateOMTextFromDataHandlerProvider extends AxiomTestCase {
     static class TestDataHandlerProvider implements DataHandlerProvider {
@@ -46,16 +49,26 @@ public class TestCreateOMTextFromDataHan
         }
     }
     
-    public TestCreateOMTextFromDataHandlerProvider(OMMetaFactory metaFactory) {
+    private final boolean nullContentID;
+    
+    public TestCreateOMTextFromDataHandlerProvider(OMMetaFactory metaFactory, boolean nullContentID) {
         super(metaFactory);
+        this.nullContentID = nullContentID;
+        addTestParameter("nullContentId", nullContentID);
     }
 
     protected void runTest() throws Throwable {
         TestDataHandlerProvider prov = new TestDataHandlerProvider();
         OMFactory factory = metaFactory.getOMFactory();
-        OMText text = factory.createOMText(null, prov, true);
+        String contentID = nullContentID ? null : UIDGenerator.generateContentId();
+        OMText text = factory.createOMText(contentID, prov, true);
         assertFalse(prov.isDataHandlerCreated());
         assertEquals(((DataHandler)text.getDataHandler()).getContent(), "Data");
         assertTrue(prov.isDataHandlerCreated());
+        if (contentID == null) {
+            assertThat(text.getContentID()).isNotNull();
+        } else {
+            assertThat(text.getContentID()).isEqualTo(contentID);
+        }
     }
 }