Author: veithen
Date: Sat Mar 30 20:24:45 2013
New Revision: 1462852

URL: http://svn.apache.org/r1462852
Log:
AXIOM-374: Make the behavior of DOOM's implementation of 
OMFactory#createOMElement(QName [, OMContainer]) consistent with that of LLOM.

Modified:
    
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
    
webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java

Modified: 
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java?rev=1462852&r1=1462851&r2=1462852&view=diff
==============================================================================
--- 
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
 (original)
+++ 
webservices/axiom/trunk/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
 Sat Mar 30 20:24:45 2013
@@ -153,7 +153,7 @@ public class OMDOMFactory implements OMF
                 throw new IllegalArgumentException("Cannot create a prefixed 
element with an empty namespace name");
             }
             ns = null;
-        } else if (qname.getPrefix() != null) {
+        } else if (qname.getPrefix().length() != 0) {
             ns = new OMNamespaceImpl(qname.getNamespaceURI(), 
qname.getPrefix());
         } else {
             ns = new OMNamespaceImpl(qname.getNamespaceURI(), null);

Modified: 
webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
URL: 
http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java?rev=1462852&r1=1462851&r2=1462852&view=diff
==============================================================================
--- 
webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
 (original)
+++ 
webservices/axiom/trunk/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
 Sat Mar 30 20:24:45 2013
@@ -30,8 +30,6 @@ import org.apache.axiom.ts.om.document.T
 import org.apache.axiom.ts.om.element.TestGetChildrenWithName4;
 import 
org.apache.axiom.ts.om.element.TestGetXMLStreamReaderWithIncompleteDescendant;
 import 
org.apache.axiom.ts.om.element.TestSerializationWithTwoNonBuiltOMElements;
-import org.apache.axiom.ts.om.factory.TestCreateOMElementWithGeneratedPrefix;
-import org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope1;
 import org.apache.axiom.ts.om.node.TestInsertSiblingAfterOnChild;
 import org.apache.axiom.ts.om.node.TestInsertSiblingBeforeOnChild;
 import 
org.apache.axiom.ts.om.sourcedelement.TestGetSAXSourceWithPushOMDataSource;
@@ -44,11 +42,6 @@ public class OMImplementationTest extend
         builder.exclude(TestInsertSiblingAfterOnChild.class);
         builder.exclude(TestInsertSiblingBeforeOnChild.class);
         
-        // TODO: DOOM's behavior differs from LLOM's behavior in this case
-        builder.exclude(TestCreateOMElementWithGeneratedPrefix.class, 
"(variant=QName*)");
-        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
         builder.exclude(TestSerialize.class, 
"(&(file=iso-8859-1.xml)(container=document))");


Reply via email to