ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1337940 - in /webservices/commons/trunk/modules/axiom/modules: axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/ axiom-testsuite/src/main/java/org/apache/axiom/ts/om/ axiom-...
Date Sun, 13 May 2012 17:18:46 GMT
Author: veithen
Date: Sun May 13 17:18:45 2012
New Revision: 1337940

URL: http://svn.apache.org/viewvc?rev=1337940&view=rev
Log:
Fixed an issue in DOOM's implementation of OMFactory#createOMText(OMContainer, OMText).

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromOMText.java
  (with props)
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java?rev=1337940&r1=1337939&r2=1337940&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
Sun May 13 17:18:45 2012
@@ -71,8 +71,8 @@ public class TextImpl extends TextNodeIm
         super(parent, text, factory);
     }
 
-    public TextImpl(OMContainer parent, TextNodeImpl source, OMFactory factory) {
-        super(parent, source, factory);
+    public TextImpl(DocumentImpl ownerNode, TextNodeImpl source, OMFactory factory) {
+        super(ownerNode, source, factory);
     }
 
     public TextImpl(String contentID, OMContainer parent, OMXMLParserWrapper builder,

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java?rev=1337940&r1=1337939&r2=1337940&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
Sun May 13 17:18:45 2012
@@ -100,8 +100,8 @@ public abstract class TextNodeImpl exten
      * @param source  TextImpl
      * @param factory
      */
-    public TextNodeImpl(OMContainer parent, TextNodeImpl source, OMFactory factory) {
-        super((DocumentImpl) ((ParentNode) parent).getOwnerDocument(), factory);
+    public TextNodeImpl(DocumentImpl ownerNode, TextNodeImpl source, OMFactory factory) {
+        super(ownerNode, factory);
         this.done = true;
 
         // Copy the value of the text

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java?rev=1337940&r1=1337939&r2=1337940&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
Sun May 13 17:18:45 2012
@@ -214,7 +214,9 @@ public class OMDOMFactory implements OMF
     
     
     public OMText createOMText(OMContainer parent, OMText source) {
-        return new TextImpl(parent, (TextImpl) source, this);
+        TextImpl text = new TextImpl(null, (TextImpl) source, this);
+        parent.addChild(text);
+        return text;
     }
 
     public OMText createOMText(OMContainer parent, char[] charArary, int type) {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1337940&r1=1337939&r2=1337940&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
Sun May 13 17:18:45 2012
@@ -308,6 +308,7 @@ public class OMTestSuiteBuilder extends 
         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.TestCreateOMTextFromOMText(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMTextWithNullParent(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestFactoryIsSingleton(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestGetMetaFactory(metaFactory));

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromOMText.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromOMText.java?rev=1337940&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromOMText.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromOMText.java
Sun May 13 17:18:45 2012
@@ -0,0 +1,44 @@
+/*
+ * 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.ts.om.factory;
+
+import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMText;
+import org.apache.axiom.ts.AxiomTestCase;
+
+/**
+ * Tests {@link OMFactory#createOMText(OMContainer, OMText)}.
+ */
+public class TestCreateOMTextFromOMText extends AxiomTestCase {
+    public TestCreateOMTextFromOMText(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
+
+    protected void runTest() throws Throwable {
+        OMFactory factory = metaFactory.getOMFactory();
+        OMText orgText = factory.createOMText("text");
+        OMElement parent = factory.createOMElement("test", null);
+        OMText text = factory.createOMText(parent, orgText);
+        assertEquals("text", text.getText());
+        assertSame(parent, text.getParent());
+    }
+}

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromOMText.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message