ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1300525 - in /webservices/commons/trunk/modules/axiom/modules: axiom-dom-testsuite/ axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/ axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/ axiom-dom-testsuite/src/main...
Date Wed, 14 Mar 2012 12:40:33 GMT
Author: veithen
Date: Wed Mar 14 12:40:32 2012
New Revision: 1300525

URL: http://svn.apache.org/viewvc?rev=1300525&view=rev
Log:
Disentangle the DOM test suite from the Axiom tests.

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/element/
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/element/attributetest.xml
      - copied unchanged from r1300320, webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/attributetest.xml
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/element/numbers.xml
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/attr/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/attr/TestGetNamespaceNormalized.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestGetNamespaceNormalized.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestRemoveChildIncomplete.java
      - copied, changed from r1300320, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/TestRemoveChildIncomplete.java
Removed:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/attributetest.xml
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/TestRemoveChildIncomplete.java
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/pom.xml
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateAttributeNSWithoutNamespace.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateElementNSWithoutNamespace.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestAttributes.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestGetElementsByTagNameRecursive.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/test/java/org/apache/axiom/ts/dom/XercesTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DOMImplementationTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/pom.xml?rev=1300525&r1=1300524&r2=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/pom.xml Wed Mar 14
12:40:32 2012
@@ -40,36 +40,15 @@
     <url>http://ws.apache.org/axiom/</url>
     <dependencies>
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
         <dependency>
-            <groupId>xmlunit</groupId>
-            <artifactId>xmlunit</artifactId>
-        </dependency>
-        <dependency>
             <groupId>${project.groupId}</groupId>
             <artifactId>axiom-testutils</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-api</artifactId>
-            <classifier>tests</classifier>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <!-- TODO: only used to get a test file; eliminate this -->
-            <groupId>${project.groupId}</groupId>
-            <artifactId>axiom-jaxen-testsuite</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
             <groupId>xerces</groupId>
             <artifactId>xercesImpl</artifactId>
             <version>2.9.1</version>

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java?rev=1300525&r1=1300524&r2=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuiteBuilder.java
Wed Mar 14 12:40:32 2012
@@ -24,11 +24,9 @@ import org.apache.axiom.testutils.suite.
 
 public class DOMTestSuiteBuilder extends TestSuiteBuilder {
     private final DocumentBuilderFactory dbf;
-    private final boolean isAxiomImpl;
     
-    public DOMTestSuiteBuilder(DocumentBuilderFactory dbf, boolean isAxiomImpl) {
+    public DOMTestSuiteBuilder(DocumentBuilderFactory dbf) {
         this.dbf = dbf;
-        this.isAxiomImpl = isAxiomImpl;
     }
     
     protected void addTests() {
@@ -41,12 +39,12 @@ public class DOMTestSuiteBuilder extends
         addTest(new org.apache.axiom.ts.dom.document.TestAllowedChildren(dbf));
         addTest(new org.apache.axiom.ts.dom.document.TestCreateAttribute(dbf));
         addTest(new org.apache.axiom.ts.dom.document.TestCreateAttributeNS(dbf));
-        addTest(new org.apache.axiom.ts.dom.document.TestCreateAttributeNSWithoutNamespace(dbf,
isAxiomImpl));
+        addTest(new org.apache.axiom.ts.dom.document.TestCreateAttributeNSWithoutNamespace(dbf));
         addTest(new org.apache.axiom.ts.dom.document.TestCreateCDATASection(dbf));
         addTest(new org.apache.axiom.ts.dom.document.TestCreateElement(dbf));
         addTest(new org.apache.axiom.ts.dom.document.TestCreateElementNS(dbf));
         addTest(new org.apache.axiom.ts.dom.document.TestCreateElementNSWithInvalidName(dbf));
-        addTest(new org.apache.axiom.ts.dom.document.TestCreateElementNSWithoutNamespace(dbf,
isAxiomImpl));
+        addTest(new org.apache.axiom.ts.dom.document.TestCreateElementNSWithoutNamespace(dbf));
         addTest(new org.apache.axiom.ts.dom.document.TestCreateText(dbf));
         addTest(new org.apache.axiom.ts.dom.document.TestDocumentSiblings(dbf));
         addTest(new org.apache.axiom.ts.dom.document.TestGetDomConfigDefaults(dbf));

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateAttributeNSWithoutNamespace.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateAttributeNSWithoutNamespace.java?rev=1300525&r1=1300524&r2=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateAttributeNSWithoutNamespace.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateAttributeNSWithoutNamespace.java
Wed Mar 14 12:40:32 2012
@@ -20,17 +20,13 @@ package org.apache.axiom.ts.dom.document
 
 import javax.xml.parsers.DocumentBuilderFactory;
 
-import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.ts.dom.DOMTestCase;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 
 public class TestCreateAttributeNSWithoutNamespace extends DOMTestCase {
-    private final boolean isAxiomImpl;
-    
-    public TestCreateAttributeNSWithoutNamespace(DocumentBuilderFactory dbf, boolean isAxiomImpl)
{
+    public TestCreateAttributeNSWithoutNamespace(DocumentBuilderFactory dbf) {
         super(dbf);
-        this.isAxiomImpl = isAxiomImpl;
     }
 
     protected void runTest() throws Throwable {
@@ -39,8 +35,5 @@ public class TestCreateAttributeNSWithou
         assertNull(attr.getPrefix());
         assertNull(attr.getNamespaceURI());
         assertEquals("attr", attr.getName());
-        if (isAxiomImpl) {
-            assertNull(((OMAttribute)attr).getNamespace());
-        }
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateElementNSWithoutNamespace.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateElementNSWithoutNamespace.java?rev=1300525&r1=1300524&r2=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateElementNSWithoutNamespace.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/document/TestCreateElementNSWithoutNamespace.java
Wed Mar 14 12:40:32 2012
@@ -20,17 +20,13 @@ package org.apache.axiom.ts.dom.document
 
 import javax.xml.parsers.DocumentBuilderFactory;
 
-import org.apache.axiom.om.OMElement;
 import org.apache.axiom.ts.dom.DOMTestCase;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
 public class TestCreateElementNSWithoutNamespace extends DOMTestCase {
-    private final boolean isAxiomImpl;
-    
-    public TestCreateElementNSWithoutNamespace(DocumentBuilderFactory dbf, boolean isAxiomImpl)
{
+    public TestCreateElementNSWithoutNamespace(DocumentBuilderFactory dbf) {
         super(dbf);
-        this.isAxiomImpl = isAxiomImpl;
     }
 
     protected void runTest() throws Throwable {
@@ -39,8 +35,5 @@ public class TestCreateElementNSWithoutN
         assertNull(element.getPrefix());
         assertNull(element.getNamespaceURI());
         assertEquals("test", element.getTagName());
-        if (isAxiomImpl) {
-            assertNull(((OMElement)element).getNamespace());
-        }
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestAttributes.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestAttributes.java?rev=1300525&r1=1300524&r2=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestAttributes.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestAttributes.java
Wed Mar 14 12:40:32 2012
@@ -20,7 +20,6 @@ package org.apache.axiom.ts.dom.element;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 
-import org.apache.axiom.om.AbstractTestCase;
 import org.apache.axiom.ts.dom.DOMTestCase;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -33,7 +32,8 @@ public class TestAttributes extends DOMT
     }
 
     protected void runTest() throws Throwable {
-        Document doc = dbf.newDocumentBuilder().parse(AbstractTestCase.getTestResource("attributetest.xml"));
+        Document doc = dbf.newDocumentBuilder().parse(
+                TestAttributes.class.getResourceAsStream("attributetest.xml"));
 
         // Check whether body has attributes
         Element bodyElement = doc.getDocumentElement();

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestGetElementsByTagNameRecursive.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestGetElementsByTagNameRecursive.java?rev=1300525&r1=1300524&r2=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestGetElementsByTagNameRecursive.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/element/TestGetElementsByTagNameRecursive.java
Wed Mar 14 12:40:32 2012
@@ -20,7 +20,6 @@ package org.apache.axiom.ts.dom.element;
 
 import javax.xml.parsers.DocumentBuilderFactory;
 
-import org.apache.axiom.om.AbstractTestCase;
 import org.apache.axiom.ts.dom.DOMTestCase;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -32,8 +31,8 @@ public class TestGetElementsByTagNameRec
     }
 
     protected void runTest() throws Throwable {
-        Document doc =
-                dbf.newDocumentBuilder().parse(AbstractTestCase.getTestResource("xml/numbers.xml"));
+        Document doc = dbf.newDocumentBuilder().parse(
+                TestGetElementsByTagNameRecursive.class.getResourceAsStream("numbers.xml"));
         Element element = doc.getDocumentElement();
         NodeList list = element.getElementsByTagName("nr");
         assertEquals(10, list.getLength());

Added: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/element/numbers.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/element/numbers.xml?rev=1300525&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/element/numbers.xml
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/element/numbers.xml
Wed Mar 14 12:40:32 2012
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+
+<numbers>
+  <set>
+    <nr>3</nr>
+    <nr>24</nr>
+    <nr>55</nr>
+    <nr>11</nr>
+    <nr>2</nr>
+    <nr>-3</nr>
+  </set>
+  <set>
+    <nr value="66"/>
+    <nr value="123"/>
+    <nr value="55"/>
+    <nr value="9999"/>
+  </set>
+</numbers>

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/resources/org/apache/axiom/ts/dom/element/numbers.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/test/java/org/apache/axiom/ts/dom/XercesTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/test/java/org/apache/axiom/ts/dom/XercesTest.java?rev=1300525&r1=1300524&r2=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/test/java/org/apache/axiom/ts/dom/XercesTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/test/java/org/apache/axiom/ts/dom/XercesTest.java
Wed Mar 14 12:40:32 2012
@@ -29,7 +29,7 @@ public class XercesTest extends TestCase
     public static TestSuite suite() {
         DocumentBuilderFactory dbf = new DocumentBuilderFactoryImpl();
         dbf.setNamespaceAware(true);
-        DOMTestSuiteBuilder builder = new DOMTestSuiteBuilder(dbf, false);
+        DOMTestSuiteBuilder builder = new DOMTestSuiteBuilder(dbf);
         return builder.build();
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DOMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DOMImplementationTest.java?rev=1300525&r1=1300524&r2=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DOMImplementationTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/DOMImplementationTest.java
Wed Mar 14 12:40:32 2012
@@ -26,7 +26,7 @@ import org.apache.axiom.ts.dom.DOMTestSu
 
 public class DOMImplementationTest extends TestCase {
     public static TestSuite suite() {
-        DOMTestSuiteBuilder builder = new DOMTestSuiteBuilder(new DOOMDocumentBuilderFactory(),
true);
+        DOMTestSuiteBuilder builder = new DOMTestSuiteBuilder(new DOOMDocumentBuilderFactory());
         return builder.build();
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java?rev=1300525&r1=1300524&r2=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java
Wed Mar 14 12:40:32 2012
@@ -35,6 +35,8 @@ public class OMDOMTestSuiteBuilder exten
     }
 
     protected void addTests() {
-        addTest(new org.apache.axiom.ts.omdom.TestRemoveChildIncomplete(metaFactory));
+        addTest(new org.apache.axiom.ts.omdom.attr.TestGetNamespaceNormalized(metaFactory));
+        addTest(new org.apache.axiom.ts.omdom.element.TestGetNamespaceNormalized(metaFactory));
+        addTest(new org.apache.axiom.ts.omdom.element.TestRemoveChildIncomplete(metaFactory));
     }
 }

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/attr/TestGetNamespaceNormalized.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/attr/TestGetNamespaceNormalized.java?rev=1300525&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/attr/TestGetNamespaceNormalized.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/attr/TestGetNamespaceNormalized.java
Wed Mar 14 12:40:32 2012
@@ -0,0 +1,43 @@
+/*
+ * 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.omdom.attr;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNamedInformationItem;
+import org.apache.axiom.om.dom.DOMMetaFactory;
+import org.apache.axiom.ts.AxiomTestCase;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+
+/**
+ * Tests that the return value of {@link OMNamedInformationItem#getNamespace()} is correctly
+ * normalized for attributes created using {@link Document#createAttributeNS(String, String)}.
+ */
+public class TestGetNamespaceNormalized extends AxiomTestCase {
+    public TestGetNamespaceNormalized(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
+
+    protected void runTest() throws Throwable {
+        Document doc = ((DOMMetaFactory)metaFactory).newDocumentBuilderFactory().newDocumentBuilder().newDocument();
+        Attr attr = doc.createAttributeNS(null, "attr");
+        assertNull(((OMAttribute)attr).getNamespace());
+    }
+}

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/attr/TestGetNamespaceNormalized.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestGetNamespaceNormalized.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestGetNamespaceNormalized.java?rev=1300525&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestGetNamespaceNormalized.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestGetNamespaceNormalized.java
Wed Mar 14 12:40:32 2012
@@ -0,0 +1,43 @@
+/*
+ * 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.omdom.element;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNamedInformationItem;
+import org.apache.axiom.om.dom.DOMMetaFactory;
+import org.apache.axiom.ts.AxiomTestCase;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Tests that the return value of {@link OMNamedInformationItem#getNamespace()} is correctly
+ * normalized for elements created using {@link Document#createElementNS(String, String)}.
+ */
+public class TestGetNamespaceNormalized extends AxiomTestCase {
+    public TestGetNamespaceNormalized(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
+
+    protected void runTest() throws Throwable {
+        Document doc = ((DOMMetaFactory)metaFactory).newDocumentBuilderFactory().newDocumentBuilder().newDocument();
+        Element element = doc.createElementNS(null, "test");
+        assertNull(((OMElement)element).getNamespace());
+    }
+}

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestGetNamespaceNormalized.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestRemoveChildIncomplete.java
(from r1300320, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/TestRemoveChildIncomplete.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestRemoveChildIncomplete.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestRemoveChildIncomplete.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/TestRemoveChildIncomplete.java&r1=1300320&r2=1300525&rev=1300525&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/TestRemoveChildIncomplete.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/element/TestRemoveChildIncomplete.java
Wed Mar 14 12:40:32 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.ts.omdom;
+package org.apache.axiom.ts.omdom.element;
 
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.util.AXIOMUtil;



Mime
View raw message