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 2012/05/28 11:30:14 UTC

svn commit: r1343172 - in /webservices/commons/trunk/modules/axiom/modules: axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/ axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/ axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/

Author: veithen
Date: Mon May 28 09:30:14 2012
New Revision: 1343172

URL: http://svn.apache.org/viewvc?rev=1343172&view=rev
Log:
Test case for AXIOM-425.

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetFirstChild.java   (with props)
Modified:
    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/src/test/java/org/apache/axiom/om/impl/dom/DOMImplementationTest.java

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=1343172&r1=1343171&r2=1343172&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 Mon May 28 09:30:14 2012
@@ -30,6 +30,7 @@ public class DOMTestSuiteBuilder extends
     }
     
     protected void addTests() {
+        addTest(new org.apache.axiom.ts.dom.attr.TestGetFirstChild(dbf));
         addTest(new org.apache.axiom.ts.dom.attr.TestSetPrefixNotNullWithNamespace(dbf));
         addTest(new org.apache.axiom.ts.dom.attr.TestSetPrefixNotNullWithoutNamespace(dbf));
         addTest(new org.apache.axiom.ts.dom.builder.TestWhitespaceAroundDocumentElement(dbf));

Added: webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetFirstChild.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetFirstChild.java?rev=1343172&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetFirstChild.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetFirstChild.java Mon May 28 09:30:14 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.dom.attr;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.axiom.ts.dom.DOMTestCase;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.Text;
+
+public class TestGetFirstChild extends DOMTestCase {
+    public TestGetFirstChild(DocumentBuilderFactory dbf) {
+        super(dbf);
+    }
+
+    protected void runTest() throws Throwable {
+        Document document = dbf.newDocumentBuilder().newDocument();
+        Attr attr = document.createAttributeNS(null, "name");
+        attr.setValue("value");
+        Node child = attr.getFirstChild();
+        assertNotNull("Expected Attr to have a child node", child);
+        assertTrue(child instanceof Text);
+        assertEquals("value", ((Text)child).getData());
+    }
+}

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

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=1343172&r1=1343171&r2=1343172&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 Mon May 28 09:30:14 2012
@@ -27,6 +27,10 @@ import org.apache.axiom.ts.dom.DOMTestSu
 public class DOMImplementationTest extends TestCase {
     public static TestSuite suite() {
         DOMTestSuiteBuilder builder = new DOMTestSuiteBuilder(new OMDOMMetaFactory().newDocumentBuilderFactory());
+        
+        // TODO: AXIOM-425
+        builder.exclude(org.apache.axiom.ts.dom.attr.TestGetFirstChild.class);
+        
         return builder.build();
     }
 }