ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1040988 - in /webservices/commons/trunk/modules/axiom/modules: axiom-api/src/main/java/org/apache/axiom/om/ axiom-api/src/test/java/org/apache/axiom/om/ axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/factory/ axiom-impl/src/test/java...
Date Wed, 01 Dec 2010 12:56:43 GMT
Author: veithen
Date: Wed Dec  1 12:56:43 2010
New Revision: 1040988

URL: http://svn.apache.org/viewvc?rev=1040988&view=rev
Log:
Made the specification of one of the createOMElement more precise, and added a test case.

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMFactoryTestBase.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/factory/
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/factory/OMFactoryTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/factory/
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/factory/OMFactoryTest.java
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java?rev=1040988&r1=1040987&r2=1040988&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMFactory.java
Wed Dec  1 12:56:43 2010
@@ -72,15 +72,17 @@ public interface OMFactory {
     OMSourcedElement createOMElement(OMDataSource source, QName qname);
 
     /**
-     * This is almost the same as as createOMElement(localName,OMNamespace) method above.
But some
-     * people may, for some reason, need to use the conventional method of putting a namespace.
Or
-     * in other words people might not want to use the new OMNamespace. Well, this is for
those
-     * people.
-     *
+     * Create an element with the given name.
+     * 
      * @param localName
+     *            the local part of the name; must not be <code>null</code>
      * @param namespaceURI
+     *            the namespace URI, or the empty string if the element has no
+     *            namespace; must not be <code>null</code>
      * @param namespacePrefix
-     * @return Returns the newly created OMElement.
+     * @return the newly created OMElement.
+     * @throws IllegalArgumentException
+     *             if <code>namespaceURI</code> is <code>null</code>
      */
     OMElement createOMElement(String localName,
                                      String namespaceURI,

Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMFactoryTestBase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMFactoryTestBase.java?rev=1040988&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMFactoryTestBase.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/test/java/org/apache/axiom/om/OMFactoryTestBase.java
Wed Dec  1 12:56:43 2010
@@ -0,0 +1,36 @@
+/*
+ * 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;
+
+public class OMFactoryTestBase extends AbstractTestCase {
+    protected final OMMetaFactory omMetaFactory;
+
+    public OMFactoryTestBase(OMMetaFactory omMetaFactory) {
+        this.omMetaFactory = omMetaFactory;
+    }
+    
+    public void testCreateOMElementWithNullNamespaceURIAndPrefix() {
+        try {
+            omMetaFactory.getOMFactory().createOMElement("test", (String)null, (String)null);
+            fail("Expected IllegalArgumentException");
+        } catch (IllegalArgumentException ex) {
+            // Expected
+        }
+    }
+}

Added: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/factory/OMFactoryTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/factory/OMFactoryTest.java?rev=1040988&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/factory/OMFactoryTest.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/factory/OMFactoryTest.java
Wed Dec  1 12:56:43 2010
@@ -0,0 +1,27 @@
+/*
+ * 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.factory;
+
+import org.apache.axiom.om.OMFactoryTestBase;
+
+public class OMFactoryTest extends OMFactoryTestBase {
+    public OMFactoryTest() {
+        super(new OMDOMMetaFactory());
+    }
+}

Added: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/factory/OMFactoryTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/factory/OMFactoryTest.java?rev=1040988&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/factory/OMFactoryTest.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/factory/OMFactoryTest.java
Wed Dec  1 12:56:43 2010
@@ -0,0 +1,27 @@
+/*
+ * 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.factory;
+
+import org.apache.axiom.om.OMFactoryTestBase;
+
+public class OMFactoryTest extends OMFactoryTestBase {
+    public OMFactoryTest() {
+        super(new OMLinkedListMetaFactory());
+    }
+}



Mime
View raw message