ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1044924 - in /webservices/commons/trunk/modules/axiom: ./ modules/axiom-dom/ modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ modules/axiom-impl/ modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/ modules/axiom-te...
Date Sun, 12 Dec 2010 20:55:39 GMT
Author: veithen
Date: Sun Dec 12 20:55:39 2010
New Revision: 1044924

URL: http://svn.apache.org/viewvc?rev=1044924&view=rev
Log:
AXIOM-311: Refactored some existing test cases into a real test suite.

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ImplementationTest.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/ImplementationTest.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/pom.xml   (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestSuiteBuilder.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix1.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix2.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix1.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix2.java
  (with props)
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java
    webservices/commons/trunk/modules/axiom/pom.xml

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml?rev=1044924&r1=1044923&r2=1044924&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/pom.xml Sun Dec 12 20:55:39
2010
@@ -76,6 +76,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axiom-testsuite</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>xalan</groupId>
             <artifactId>xalan</artifactId>
             <version>2.7.1</version>

Added: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ImplementationTest.java?rev=1044924&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ImplementationTest.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ImplementationTest.java
Sun Dec 12 20:55:39 2010
@@ -0,0 +1,31 @@
+/*
+ * 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.om.impl.dom;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
+import org.apache.axiom.ts.AxiomTestSuiteBuilder;
+
+public class ImplementationTest extends TestCase {
+    public static TestSuite suite() {
+        return AxiomTestSuiteBuilder.suite(new OMDOMMetaFactory());
+    }
+}

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ImplementationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml?rev=1044924&r1=1044923&r2=1044924&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/pom.xml Sun Dec 12 20:55:39
2010
@@ -76,6 +76,12 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axiom-testsuite</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>xalan</groupId>
             <artifactId>xalan</artifactId>
             <version>2.7.1</version>

Added: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/ImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/ImplementationTest.java?rev=1044924&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/ImplementationTest.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/ImplementationTest.java
Sun Dec 12 20:55:39 2010
@@ -0,0 +1,31 @@
+/*
+ * 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.om.impl.llom;
+
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory;
+import org.apache.axiom.ts.AxiomTestSuiteBuilder;
+
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class ImplementationTest extends TestCase {
+    public static TestSuite suite() {
+        return AxiomTestSuiteBuilder.suite(new OMLinkedListMetaFactory());
+    }
+}

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/ImplementationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java?rev=1044924&r1=1044923&r2=1044924&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java
Sun Dec 12 20:55:39 2010
@@ -19,13 +19,10 @@
 
 package org.apache.axiom.om;
 
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.util.StAXUtils;
 import org.custommonkey.xmlunit.Diff;
 import org.w3c.dom.Document;
-import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
-import java.io.ByteArrayInputStream;
 import java.io.StringReader;
 import java.util.Iterator;
 
@@ -49,52 +46,6 @@ public class AttrNsTest extends Abstract
         assertXMLEqual(diff, true);
     }
 
-
-    /**
-     * Test method to test the XML namespace
-     *
-     * @throws Exception
-     */
-    public void testAttr() throws Exception {
-        String xml = "<wsp:Policy xml:base=\"uri:thisBase\" " +
-                "xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">" +
-                "</wsp:Policy>";
-
-        ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
-        StAXOMBuilder builder = new StAXOMBuilder(bais);
-        OMElement elem = builder.getDocumentElement();
-        elem.build();
-        assertEquals("Attribute value mismatch", "uri:thisBase",
-                     elem.getAttributeValue(new QName(OMConstants.XMLNS_URI, "base")));
-
-        OMAttribute attr = elem.getAttribute(new QName(OMConstants.XMLNS_URI, "base"));
-
-        assertEquals("Attribute namespace mismatch", OMConstants.XMLNS_URI,
-                     attr.getNamespace().getNamespaceURI());
-    }
-
-    /**
-     * Test method to test the XML namespace of an attr without any other ns declarations
in the
-     * element
-     *
-     * @throws Exception
-     */
-    public void testAttrWithoutElementNS() throws Exception {
-        String xml = "<Policy xml:base=\"uri:thisBase\"></Policy>";
-
-        ByteArrayInputStream bais = new ByteArrayInputStream(xml.getBytes());
-        StAXOMBuilder builder = new StAXOMBuilder(bais);
-        OMElement elem = builder.getDocumentElement();
-        elem.build();
-        assertEquals("Attribute value mismatch", "uri:thisBase",
-                     elem.getAttributeValue(new QName(OMConstants.XMLNS_URI, "base")));
-
-        OMAttribute attr = elem.getAttribute(new QName(OMConstants.XMLNS_URI, "base"));
-
-        assertEquals("Attribute namespace mismatch", OMConstants.XMLNS_URI,
-                     attr.getNamespace().getNamespaceURI());
-    }
-
     public void testAttributesWithProgrammaticalCreation() throws Exception {
         String expectedXML =
                 "<AttributeTester xmlns=\"\" xmlns:myAttr2NS=\"http://test-attributes-2.org\"
" +

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/pom.xml?rev=1044924&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/pom.xml (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/pom.xml Sun Dec 12 20:55:39
2010
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ 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.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.ws.commons.axiom</groupId>
+        <artifactId>axiom-parent</artifactId>
+        <version>1.2.11-SNAPSHOT</version>
+        <relativePath>../axiom-parent/pom.xml</relativePath>
+    </parent>
+    <artifactId>axiom-testsuite</artifactId>
+    <name>Axiom Implementation Test Suite</name>
+    <description>
+        The Axiom implementation test suite. This test suite can be used to check conformance
of a
+        particular Axiom implementation.
+    </description>
+    <scm>
+        <connection>scm:svn:http://svn.apache.org/repos/asf/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite</connection>
+        <developerConnection>scm:svn:https://svn.apache.org/repos/asf/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite</developerConnection>
+        <url>http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite</url>
+    </scm>
+    <dependencies>
+        <dependency>
+            <groupId>${project.groupId}</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>compile</scope>
+        </dependency>
+    </dependencies>
+</project>

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java?rev=1044924&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java
Sun Dec 12 20:55:39 2010
@@ -0,0 +1,32 @@
+/*
+ * 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;
+
+import org.apache.axiom.om.OMMetaFactory;
+
+import junit.framework.TestCase;
+
+public abstract class AxiomTestCase extends TestCase {
+    protected final OMMetaFactory metaFactory;
+
+    public AxiomTestCase(OMMetaFactory metaFactory) {
+        this.metaFactory = metaFactory;
+        setName(getClass().getName());
+    }
+}

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

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestSuiteBuilder.java?rev=1044924&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestSuiteBuilder.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestSuiteBuilder.java
Sun Dec 12 20:55:39 2010
@@ -0,0 +1,34 @@
+/*
+ * 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;
+
+import org.apache.axiom.om.OMMetaFactory;
+
+import junit.framework.TestSuite;
+
+public class AxiomTestSuiteBuilder {
+    public static TestSuite suite(OMMetaFactory metaFactory) {
+        TestSuite suite = new TestSuite();
+        suite.addTest(new org.apache.axiom.ts.om.element.TestGetAttributeValueWithXmlPrefix1(metaFactory));
+        suite.addTest(new org.apache.axiom.ts.om.element.TestGetAttributeValueWithXmlPrefix2(metaFactory));
+        suite.addTest(new org.apache.axiom.ts.om.element.TestGetAttributeWithXmlPrefix1(metaFactory));
+        suite.addTest(new org.apache.axiom.ts.om.element.TestGetAttributeWithXmlPrefix2(metaFactory));
+        return suite;
+    }
+}

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

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix1.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix1.java?rev=1044924&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix1.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix1.java
Sun Dec 12 20:55:39 2010
@@ -0,0 +1,47 @@
+/*
+ * 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.element;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMConstants;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.util.AXIOMUtil;
+import org.apache.axiom.ts.AxiomTestCase;
+
+/**
+ * Test that {@link OMElement#getAttributeValue(QName)} works properly for an attribute with
the
+ * <tt>xml</tt> prefix, even if this prefix is not declared explicitly. This
is a regression test
+ * for <a href="https://issues.apache.org/jira/browse/AXIS2-329">AXIS2-329</a>.
+ */
+public class TestGetAttributeValueWithXmlPrefix1 extends AxiomTestCase {
+    public TestGetAttributeValueWithXmlPrefix1(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
+
+    protected void runTest() throws Throwable {
+        OMElement elem = AXIOMUtil.stringToOM(metaFactory.getOMFactory(),
+                "<wsp:Policy xml:base=\"uri:thisBase\" " +
+                "xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">" +
+                "</wsp:Policy>");
+        assertEquals("Attribute value mismatch", "uri:thisBase",
+                elem.getAttributeValue(new QName(OMConstants.XMLNS_URI, "base")));
+    }
+}

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

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix2.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix2.java?rev=1044924&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix2.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeValueWithXmlPrefix2.java
Sun Dec 12 20:55:39 2010
@@ -0,0 +1,45 @@
+/*
+ * 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.element;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMConstants;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.util.AXIOMUtil;
+import org.apache.axiom.ts.AxiomTestCase;
+
+/**
+ * Test that {@link OMElement#getAttributeValue(QName)} works properly for an attribute with
the
+ * <tt>xml</tt> prefix, even if this prefix is not declared explicitly. This
is a regression test
+ * for <a href="https://issues.apache.org/jira/browse/AXIS2-329">AXIS2-329</a>.
+ */
+public class TestGetAttributeValueWithXmlPrefix2 extends AxiomTestCase {
+    public TestGetAttributeValueWithXmlPrefix2(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
+
+    protected void runTest() throws Throwable {
+        OMElement elem = AXIOMUtil.stringToOM(metaFactory.getOMFactory(),
+                "<Policy xml:base=\"uri:thisBase\"></Policy>");
+        assertEquals("Attribute value mismatch", "uri:thisBase",
+                elem.getAttributeValue(new QName(OMConstants.XMLNS_URI, "base")));
+    }
+}

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

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix1.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix1.java?rev=1044924&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix1.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix1.java
Sun Dec 12 20:55:39 2010
@@ -0,0 +1,49 @@
+/*
+ * 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.element;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMConstants;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.util.AXIOMUtil;
+import org.apache.axiom.ts.AxiomTestCase;
+
+/**
+ * Test that {@link OMElement#getAttribute(QName)} works properly for an attribute with the
+ * <tt>xml</tt> prefix, even if this prefix is not declared explicitly. This
is a regression test
+ * for <a href="https://issues.apache.org/jira/browse/AXIS2-329">AXIS2-329</a>.
+ */
+public class TestGetAttributeWithXmlPrefix1 extends AxiomTestCase {
+    public TestGetAttributeWithXmlPrefix1(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
+
+    protected void runTest() throws Throwable {
+        OMElement elem = AXIOMUtil.stringToOM(metaFactory.getOMFactory(),
+                "<wsp:Policy xml:base=\"uri:thisBase\" " +
+                "xmlns:wsp=\"http://schemas.xmlsoap.org/ws/2004/09/policy\">" +
+                "</wsp:Policy>");
+        OMAttribute attr = elem.getAttribute(new QName(OMConstants.XMLNS_URI, "base"));
+        assertEquals("Attribute namespace mismatch", OMConstants.XMLNS_URI,
+                attr.getNamespace().getNamespaceURI());
+    }
+}

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

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix2.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix2.java?rev=1044924&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix2.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestGetAttributeWithXmlPrefix2.java
Sun Dec 12 20:55:39 2010
@@ -0,0 +1,47 @@
+/*
+ * 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.element;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMConstants;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.util.AXIOMUtil;
+import org.apache.axiom.ts.AxiomTestCase;
+
+/**
+ * Test that {@link OMElement#getAttribute(QName)} works properly for an attribute with the
+ * <tt>xml</tt> prefix, even if this prefix is not declared explicitly. This
is a regression test
+ * for <a href="https://issues.apache.org/jira/browse/AXIS2-329">AXIS2-329</a>.
+ */
+public class TestGetAttributeWithXmlPrefix2 extends AxiomTestCase {
+    public TestGetAttributeWithXmlPrefix2(OMMetaFactory metaFactory) {
+        super(metaFactory);
+    }
+
+    protected void runTest() throws Throwable {
+        OMElement elem = AXIOMUtil.stringToOM(metaFactory.getOMFactory(),
+                "<Policy xml:base=\"uri:thisBase\"></Policy>");
+        OMAttribute attr = elem.getAttribute(new QName(OMConstants.XMLNS_URI, "base"));
+        assertEquals("Attribute namespace mismatch", OMConstants.XMLNS_URI,
+                attr.getNamespace().getNamespaceURI());
+    }
+}

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

Modified: webservices/commons/trunk/modules/axiom/pom.xml
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/pom.xml?rev=1044924&r1=1044923&r2=1044924&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/pom.xml (original)
+++ webservices/commons/trunk/modules/axiom/pom.xml Sun Dec 12 20:55:39 2010
@@ -554,6 +554,7 @@
         <module>modules/axiom-testutils</module>
         <module>modules/axiom-jaxen-testsuite</module>
         <module>modules/axiom-api</module>
+        <module>modules/axiom-testsuite</module>
         <module>modules/axiom-impl</module>
         <module>modules/axiom-dom</module>
         <module>modules/axiom-c14n</module>



Mime
View raw message