Return-Path: Delivered-To: apmail-ws-commits-archive@minotaur.apache.org Received: (qmail 50002 invoked from network); 18 Jan 2011 22:32:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Jan 2011 22:32:00 -0000 Received: (qmail 93335 invoked by uid 500); 18 Jan 2011 22:32:00 -0000 Delivered-To: apmail-ws-commits-archive@ws.apache.org Received: (qmail 93299 invoked by uid 500); 18 Jan 2011 22:32:00 -0000 Mailing-List: contact commits-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ws.apache.org Delivered-To: mailing list commits@ws.apache.org Received: (qmail 93292 invoked by uid 99); 18 Jan 2011 22:32:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jan 2011 22:32:00 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Jan 2011 22:31:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 76E9F23888D2; Tue, 18 Jan 2011 22:31:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1060600 - in /webservices/commons/trunk/modules/axiom/modules: axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/ axiom-testsuite/src/main/java/org/apache/axiom/ts/ axiom-testsuite... Date: Tue, 18 Jan 2011 22:31:38 -0000 To: commits@ws.apache.org From: veithen@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110118223138.76E9F23888D2@eris.apache.org> Author: veithen Date: Tue Jan 18 22:31:37 2011 New Revision: 1060600 URL: http://svn.apache.org/viewvc?rev=1060600&view=rev Log: Added test cases for OMElement#resolveQName. Note that two of them are actually failing and therefore excluded in the LLOM and DOOM tests. I believe there is an issue with the current resolveQName implementation (for QNames without prefixes)." Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithDefaultNamespace.java (with props) webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithNonDefaultNamespace.java (with props) webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithoutNamespace.java (with props) Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java?rev=1060600&r1=1060599&r2=1060600&view=diff ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java (original) +++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java Tue Jan 18 22:31:37 2011 @@ -23,6 +23,8 @@ import junit.framework.TestSuite; import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory; import org.apache.axiom.ts.OMTestSuiteBuilder; +import org.apache.axiom.ts.om.element.TestResolveQNameWithDefaultNamespace; +import org.apache.axiom.ts.om.element.TestResolveQNameWithoutNamespace; import org.apache.axiom.ts.om.element.TestSetTextQName; public class OMImplementationTest extends TestCase { @@ -39,6 +41,10 @@ public class OMImplementationTest extend builder.exclude(org.apache.axiom.ts.om.document.TestSerializeAndConsumeWithIncompleteDescendant.class); builder.exclude(org.apache.axiom.ts.om.element.TestSerializeAndConsumeWithIncompleteDescendant.class); + // TODO: resolveQName appears to have issues resolving QNames without prefixes; needs further investigation + builder.exclude(TestResolveQNameWithDefaultNamespace.class); + builder.exclude(TestResolveQNameWithoutNamespace.class); + return builder.build(); } } Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java?rev=1060600&r1=1060599&r2=1060600&view=diff ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java (original) +++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java Tue Jan 18 22:31:37 2011 @@ -23,12 +23,19 @@ import junit.framework.TestSuite; import org.apache.axiom.om.impl.llom.factory.OMLinkedListMetaFactory; import org.apache.axiom.ts.OMTestSuiteBuilder; +import org.apache.axiom.ts.om.element.TestResolveQNameWithDefaultNamespace; +import org.apache.axiom.ts.om.element.TestResolveQNameWithoutNamespace; public class OMImplementationTest extends TestCase { public static TestSuite suite() { OMTestSuiteBuilder builder = new OMTestSuiteBuilder(new OMLinkedListMetaFactory()); // TODO: this looks like a bug builder.exclude(org.apache.axiom.ts.om.document.TestIsCompleteAfterAddingIncompleteChild.class); + + // TODO: resolveQName appears to have issues resolving QNames without prefixes; needs further investigation + builder.exclude(TestResolveQNameWithDefaultNamespace.class); + builder.exclude(TestResolveQNameWithoutNamespace.class); + return builder.build(); } } Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java?rev=1060600&r1=1060599&r2=1060600&view=diff ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java (original) +++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/OMTestSuiteBuilder.java Tue Jan 18 22:31:37 2011 @@ -64,6 +64,9 @@ public class OMTestSuiteBuilder extends addTest(new org.apache.axiom.ts.om.element.TestGetFirstChildWithName(metaFactory)); addTest(new org.apache.axiom.ts.om.element.TestGetFirstChildWithNameOnIncompleteElement(metaFactory)); addTest(new org.apache.axiom.ts.om.element.TestIsCompleteAfterAddingIncompleteChild(metaFactory)); + addTest(new org.apache.axiom.ts.om.element.TestResolveQNameWithDefaultNamespace(metaFactory)); + addTest(new org.apache.axiom.ts.om.element.TestResolveQNameWithNonDefaultNamespace(metaFactory)); + addTest(new org.apache.axiom.ts.om.element.TestResolveQNameWithoutNamespace(metaFactory)); addTest(new org.apache.axiom.ts.om.element.TestSerialization(metaFactory, "D", "D", "John3450")); addTest(new org.apache.axiom.ts.om.element.TestSerialization(metaFactory, "D", "U", Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithDefaultNamespace.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithDefaultNamespace.java?rev=1060600&view=auto ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithDefaultNamespace.java (added) +++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithDefaultNamespace.java Tue Jan 18 22:31:37 2011 @@ -0,0 +1,40 @@ +/* + * 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.OMElement; +import org.apache.axiom.om.OMMetaFactory; +import org.apache.axiom.om.util.AXIOMUtil; +import org.apache.axiom.ts.AxiomTestCase; + +public class TestResolveQNameWithDefaultNamespace extends AxiomTestCase { + public TestResolveQNameWithDefaultNamespace(OMMetaFactory metaFactory) { + super(metaFactory); + } + + protected void runTest() throws Throwable { + OMElement element = AXIOMUtil.stringToOM(metaFactory.getOMFactory(), ""); + QName qname = element.resolveQName("test"); + assertEquals("", qname.getPrefix()); + assertEquals("urn:ns2", qname.getNamespaceURI()); + assertEquals("test", qname.getLocalPart()); + } +} Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithDefaultNamespace.java ------------------------------------------------------------------------------ svn:eol-style = native Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithNonDefaultNamespace.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithNonDefaultNamespace.java?rev=1060600&view=auto ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithNonDefaultNamespace.java (added) +++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithNonDefaultNamespace.java Tue Jan 18 22:31:37 2011 @@ -0,0 +1,40 @@ +/* + * 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.OMElement; +import org.apache.axiom.om.OMMetaFactory; +import org.apache.axiom.om.util.AXIOMUtil; +import org.apache.axiom.ts.AxiomTestCase; + +public class TestResolveQNameWithNonDefaultNamespace extends AxiomTestCase { + public TestResolveQNameWithNonDefaultNamespace(OMMetaFactory metaFactory) { + super(metaFactory); + } + + protected void runTest() throws Throwable { + OMElement element = AXIOMUtil.stringToOM(metaFactory.getOMFactory(), ""); + QName qname = element.resolveQName("p:test"); + assertEquals("p", qname.getPrefix()); + assertEquals("urn:ns", qname.getNamespaceURI()); + assertEquals("test", qname.getLocalPart()); + } +} Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithNonDefaultNamespace.java ------------------------------------------------------------------------------ svn:eol-style = native Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithoutNamespace.java URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithoutNamespace.java?rev=1060600&view=auto ============================================================================== --- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithoutNamespace.java (added) +++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithoutNamespace.java Tue Jan 18 22:31:37 2011 @@ -0,0 +1,40 @@ +/* + * 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.OMElement; +import org.apache.axiom.om.OMMetaFactory; +import org.apache.axiom.om.util.AXIOMUtil; +import org.apache.axiom.ts.AxiomTestCase; + +public class TestResolveQNameWithoutNamespace extends AxiomTestCase { + public TestResolveQNameWithoutNamespace(OMMetaFactory metaFactory) { + super(metaFactory); + } + + protected void runTest() throws Throwable { + OMElement element = AXIOMUtil.stringToOM(metaFactory.getOMFactory(), ""); + QName qname = element.resolveQName("test"); + assertEquals("", qname.getPrefix()); + assertEquals("", qname.getNamespaceURI()); + assertEquals("test", qname.getLocalPart()); + } +} Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestResolveQNameWithoutNamespace.java ------------------------------------------------------------------------------ svn:eol-style = native