ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1337832 - in /webservices/axiom/branches/CLONE: ./ modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/ ...
Date Sun, 13 May 2012 10:32:36 GMT
Author: veithen
Date: Sun May 13 10:32:35 2012
New Revision: 1337832

URL: http://svn.apache.org/viewvc?rev=1337832&view=rev
Log:
Merged latest changes from trunk.

Added:
    webservices/axiom/branches/CLONE/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope1.java
      - copied unchanged from r1337831, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope1.java
    webservices/axiom/branches/CLONE/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope2.java
      - copied unchanged from r1337831, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope2.java
    webservices/axiom/branches/CLONE/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope3.java
      - copied unchanged from r1337831, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope3.java
Removed:
    webservices/axiom/branches/CLONE/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope.java
Modified:
    webservices/axiom/branches/CLONE/   (props changed)
    webservices/axiom/branches/CLONE/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
    webservices/axiom/branches/CLONE/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
    webservices/axiom/branches/CLONE/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
    webservices/axiom/branches/CLONE/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/CopyUtilsTest.java
    webservices/axiom/branches/CLONE/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java

Propchange: webservices/axiom/branches/CLONE/
------------------------------------------------------------------------------
  Merged /webservices/commons/trunk/modules/axiom:r1337822-1337831

Modified: webservices/axiom/branches/CLONE/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CLONE/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java?rev=1337832&r1=1337831&r2=1337832&view=diff
==============================================================================
--- webservices/axiom/branches/CLONE/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
(original)
+++ webservices/axiom/branches/CLONE/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
Sun May 13 10:32:35 2012
@@ -185,7 +185,7 @@ public class ElementImpl extends ParentN
             return null;
         } else {
             OMNamespace namespace = findNamespace(namespaceURI, prefix);
-            if (namespace == null) {
+            if (namespace == null || (prefix != null && !namespace.getPrefix().equals(prefix)))
{
                 namespace = declareNamespace(ns);
             }
             return namespace;

Modified: webservices/axiom/branches/CLONE/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CLONE/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java?rev=1337832&r1=1337831&r2=1337832&view=diff
==============================================================================
--- webservices/axiom/branches/CLONE/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
(original)
+++ webservices/axiom/branches/CLONE/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
Sun May 13 10:32:35 2012
@@ -28,7 +28,7 @@ import org.apache.axiom.ts.om.container.
 import org.apache.axiom.ts.om.document.TestDigest;
 import org.apache.axiom.ts.om.element.TestGetChildrenWithName4;
 import org.apache.axiom.ts.om.factory.TestCreateOMElementWithGeneratedPrefix;
-import org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope;
+import org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope1;
 import org.apache.axiom.ts.om.node.TestInsertSiblingAfterOnChild;
 import org.apache.axiom.ts.om.node.TestInsertSiblingBeforeOnChild;
 
@@ -42,8 +42,8 @@ public class OMImplementationTest extend
         
         // TODO: DOOM's behavior differs from LLOM's behavior in this case
         builder.exclude(TestCreateOMElementWithGeneratedPrefix.class, "(variant=QName*)");
-        builder.exclude(TestCreateOMElementWithNamespaceInScope.class, "(variant=QName,OMContainer)");
-        builder.exclude(TestCreateOMElementWithNamespaceInScope.class, "(variant=String,OMNamespace,OMContainer)");
+        builder.exclude(TestCreateOMElementWithNamespaceInScope1.class, "(variant=QName,OMContainer)");
+        builder.exclude(TestCreateOMElementWithNamespaceInScope1.class, "(variant=String,OMNamespace,OMContainer)");
         
         // TODO: this case is not working because Axiom generates an XML declaration
         //       but uses another charset encoding to serialize the document

Modified: webservices/axiom/branches/CLONE/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CLONE/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=1337832&r1=1337831&r2=1337832&view=diff
==============================================================================
--- webservices/axiom/branches/CLONE/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/axiom/branches/CLONE/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
Sun May 13 10:32:35 2012
@@ -213,7 +213,7 @@ public class OMElementImpl extends OMNod
             return null;
         } else {
             OMNamespace namespace = findNamespace(namespaceURI, prefix);
-            if (namespace == null) {
+            if (namespace == null || (prefix != null && !namespace.getPrefix().equals(prefix)))
{
                 namespace = declareNamespace(ns);
             }
             return namespace;

Modified: webservices/axiom/branches/CLONE/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/CopyUtilsTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CLONE/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/CopyUtilsTest.java?rev=1337832&r1=1337831&r2=1337832&view=diff
==============================================================================
--- webservices/axiom/branches/CLONE/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/CopyUtilsTest.java
(original)
+++ webservices/axiom/branches/CLONE/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/CopyUtilsTest.java
Sun May 13 10:32:35 2012
@@ -115,7 +115,7 @@ public class CopyUtilsTest extends Abstr
         copyAndCheck(sourceEnv, true);
         
         // The source SOAPHeaderBlock should not be expanded in the process
-        assertTrue(shb.isExpanded() == false);
+        assertFalse(shb.isExpanded());
         
     }
     
@@ -150,9 +150,7 @@ public class CopyUtilsTest extends Abstr
         // In some cases the serialization code or internal hashmaps cause
         // attributes or namespaces to be in a different order...accept this for now.
         if (checkText) {
-            assertTrue("\nSource=" + sourceText +
-                   "\nTarget=" + targetText,
-                   sourceText.equals(targetText));
+            assertEquals(sourceText, targetText);
         }
         
         sourceEnv.close(false);
@@ -172,10 +170,7 @@ public class CopyUtilsTest extends Abstr
                 assertTrue("Source = " + source.getClass().getName() + 
                            "Target = " + target.getClass().getName(),
                            target instanceof OMSourcedElement);
-                assertTrue("Source Expansion = " +((OMSourcedElement)source).isExpanded()
+
-                           "Target Expansion = " + ((OMSourcedElement)target).isExpanded(),
-                           ((OMSourcedElement)source).isExpanded() ==
-                               ((OMSourcedElement)target).isExpanded());
+                assertEquals(((OMSourcedElement)source).isExpanded(), ((OMSourcedElement)target).isExpanded());
                 if (((OMSourcedElement)source).isExpanded()) {
                     Iterator i = ((OMElement) source).getChildren();
                     Iterator j = ((OMElement) target).getChildren();
@@ -184,14 +179,11 @@ public class CopyUtilsTest extends Abstr
                         OMNode targetChild = (OMNode) j.next();
                         identityCheck(sourceChild, targetChild, depth + "  ");
                     }
-                    assertTrue("Source and Target have different number of children",
-                               i.hasNext() == j.hasNext());
+                    assertEquals("Source and Target have different number of children",
+                               i.hasNext(), j.hasNext());
                 }
             } else {
-                assertTrue("Source = " + source.getClass().getName() + 
-                           "Target = " + target.getClass().getName(),
-                           source.getClass().getName().equals(
-                           target.getClass().getName()));
+                assertEquals(source.getClass(), target.getClass());
                 Iterator i = ((OMElement) source).getChildren();
                 Iterator j = ((OMElement) target).getChildren();
                 while(i.hasNext() && j.hasNext()) {
@@ -199,14 +191,11 @@ public class CopyUtilsTest extends Abstr
                     OMNode targetChild = (OMNode) j.next();
                     identityCheck(sourceChild, targetChild, depth + "  ");
                 }
-                assertTrue("Source and Target have different number of children",
-                           i.hasNext() == j.hasNext());
+                assertEquals("Source and Target have different number of children",
+                           i.hasNext(), j.hasNext());
             }
         } else {
-            assertTrue("Source = " + source.getClass().getName() + 
-                   "Target = " + target.getClass().getName(),
-                   source.getClass().getName().equals(
-                   target.getClass().getName()));
+            assertEquals(source.getClass(), target.getClass());
         }
     }
 }

Modified: webservices/axiom/branches/CLONE/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/CLONE/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1337832&r1=1337831&r2=1337832&view=diff
==============================================================================
--- webservices/axiom/branches/CLONE/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
(original)
+++ webservices/axiom/branches/CLONE/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
Sun May 13 10:32:35 2012
@@ -288,9 +288,11 @@ public class OMTestSuiteBuilder extends 
                 }
             }
             if (variant.isSupportsContainer()) {
-                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope(metaFactory,
variant));
+                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope1(metaFactory,
variant));
+                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope2(metaFactory,
variant));
             }
             if (variant.isSupportsContainer() && variant.isSupportsDefaultNamespace())
{
+                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope3(metaFactory,
variant));
                 addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace2(metaFactory,
variant));
                 addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace3(metaFactory,
variant));
             }



Mime
View raw message