ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1311504 - in /webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om: ./ factory/
Date Mon, 09 Apr 2012 22:37:17 GMT
Author: veithen
Date: Mon Apr  9 22:37:16 2012
New Revision: 1311504

URL: http://svn.apache.org/viewvc?rev=1311504&view=rev
Log:
Increased the test coverage for the various createOMElement methods.

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementParentSupplier.java
  (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementVariant.java
      - copied, changed from r1311475, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/OMElementCreator.java
Removed:
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/OMElementCreator.java
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementTestCase.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithDefaultNamespace.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithGeneratedPrefix.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithInvalidNamespace.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNonDefaultNamespace.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace2.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace3.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespaceNullPrefix.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
Mon Apr  9 22:37:16 2012
@@ -27,7 +27,8 @@ import org.apache.axiom.ts.om.container.
 import org.apache.axiom.ts.om.container.OMElementFactory;
 import org.apache.axiom.ts.om.container.SerializationMethod;
 import org.apache.axiom.ts.om.container.SerializeToOutputStream;
-import org.apache.axiom.ts.om.factory.OMElementCreator;
+import org.apache.axiom.ts.om.factory.CreateOMElementParentSupplier;
+import org.apache.axiom.ts.om.factory.CreateOMElementVariant;
 import org.apache.axiom.ts.om.xpath.AXIOMXPathTestCase;
 import org.apache.axiom.ts.om.xpath.TestAXIOMXPath;
 
@@ -257,22 +258,27 @@ public class OMTestSuiteBuilder extends 
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMAttributeWithInvalidNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMCommentWithoutParent(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMDocument(metaFactory));
-        for (int i=0; i<OMElementCreator.INSTANCES.length; i++) {
-            OMElementCreator creator = OMElementCreator.INSTANCES[i];
-            if (creator.isSupportsDefaultNamespace()) {
-                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithDefaultNamespace(metaFactory,
creator));
+        for (int i=0; i<CreateOMElementVariant.INSTANCES.length; i++) {
+            CreateOMElementVariant variant = CreateOMElementVariant.INSTANCES[i];
+            for (int j=0; j<CreateOMElementParentSupplier.INSTANCES.length; j++) {
+                CreateOMElementParentSupplier parentSupplier = CreateOMElementParentSupplier.INSTANCES[j];
+                if (parentSupplier.isSupported(variant)) {
+                    if (variant.isSupportsDefaultNamespace()) {
+                        addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithDefaultNamespace(metaFactory,
variant, parentSupplier));
+                    }
+                    addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithGeneratedPrefix(metaFactory,
variant, parentSupplier));
+                    addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespaceNullPrefix(metaFactory,
variant, parentSupplier));
+                    addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithInvalidNamespace(metaFactory,
variant, parentSupplier));
+                    addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNonDefaultNamespace(metaFactory,
variant, parentSupplier));
+                    addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace(metaFactory,
variant, parentSupplier));
+                }
             }
-            addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithGeneratedPrefix(metaFactory,
creator));
-            addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespaceNullPrefix(metaFactory,
creator));
-            addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithInvalidNamespace(metaFactory,
creator));
-            if (creator.isSupportsContainer()) {
-                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope(metaFactory,
creator));
+            if (variant.isSupportsContainer()) {
+                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope(metaFactory,
variant));
             }
-            addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNonDefaultNamespace(metaFactory,
creator));
-            addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace(metaFactory,
creator));
-            if (creator.isSupportsContainer() && creator.isSupportsDefaultNamespace())
{
-                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace2(metaFactory,
creator));
-                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace3(metaFactory,
creator));
+            if (variant.isSupportsContainer() && variant.isSupportsDefaultNamespace())
{
+                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace2(metaFactory,
variant));
+                addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithoutNamespace3(metaFactory,
variant));
             }
         }
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullURIAndPrefix(metaFactory));

Added: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementParentSupplier.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementParentSupplier.java?rev=1311504&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementParentSupplier.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementParentSupplier.java
Mon Apr  9 22:37:16 2012
@@ -0,0 +1,67 @@
+/*
+ * 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.factory;
+
+import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMFactory;
+
+public abstract class CreateOMElementParentSupplier {
+    public static final CreateOMElementParentSupplier[] INSTANCES = {
+        new CreateOMElementParentSupplier("null") {
+            public boolean isSupported(CreateOMElementVariant variant) {
+                return true;
+            }
+
+            public OMContainer createParent(OMFactory factory) {
+                return null;
+            }
+        },
+        new CreateOMElementParentSupplier("document") {
+            public boolean isSupported(CreateOMElementVariant variant) {
+                return variant.isSupportsContainer();
+            }
+
+            public OMContainer createParent(OMFactory factory) {
+                return factory.createOMDocument();
+            }
+        },
+        new CreateOMElementParentSupplier("element") {
+            public boolean isSupported(CreateOMElementVariant variant) {
+                return variant.isSupportsContainer();
+            }
+
+            public OMContainer createParent(OMFactory factory) {
+                return factory.createOMElement("test", null);
+            }
+        },
+    };
+
+    private final String name;
+    
+    public CreateOMElementParentSupplier(String name) {
+        this.name = name;
+    }
+    
+    public final String getName() {
+        return name;
+    }
+
+    public abstract boolean isSupported(CreateOMElementVariant variant);
+    public abstract OMContainer createParent(OMFactory factory);
+}

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

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementTestCase.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementTestCase.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementTestCase.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementTestCase.java
Mon Apr  9 22:37:16 2012
@@ -27,11 +27,16 @@ import org.apache.axiom.ts.AxiomTestCase
  * <code>createOMElement</code> methods in {@link OMFactory}.
  */
 public abstract class CreateOMElementTestCase extends AxiomTestCase {
-    protected final OMElementCreator variant;
+    protected final CreateOMElementVariant variant;
+    protected final CreateOMElementParentSupplier parentSupplier;
 
-    public CreateOMElementTestCase(OMMetaFactory metaFactory, OMElementCreator variant) {
+    public CreateOMElementTestCase(OMMetaFactory metaFactory, CreateOMElementVariant variant,
CreateOMElementParentSupplier parentSupplier) {
         super(metaFactory);
         this.variant = variant;
+        this.parentSupplier = parentSupplier;
         addTestProperty("variant", variant.getName());
+        if (parentSupplier != null) {
+            addTestProperty("parent", parentSupplier.getName());
+        }
     }
 }

Copied: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementVariant.java
(from r1311475, webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/OMElementCreator.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementVariant.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementVariant.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/OMElementCreator.java&r1=1311475&r2=1311504&rev=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/OMElementCreator.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/CreateOMElementVariant.java
Mon Apr  9 22:37:16 2012
@@ -25,9 +25,9 @@ import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 
-public abstract class OMElementCreator {
-    public static final OMElementCreator[] INSTANCES = new OMElementCreator[] {
-        new OMElementCreator("QName", false, false) {
+public abstract class CreateOMElementVariant {
+    public static final CreateOMElementVariant[] INSTANCES = {
+        new CreateOMElementVariant("QName", false, false) {
             public OMElement createOMElement(OMFactory factory, OMContainer parent, String
localName,
                     String namespaceURI, String prefix) {
                 if (prefix == null) {
@@ -36,7 +36,7 @@ public abstract class OMElementCreator {
                 return factory.createOMElement(new QName(namespaceURI, localName, prefix));
             }
         },
-        new OMElementCreator("QName,OMContainer", false, true) {
+        new CreateOMElementVariant("QName,OMContainer", false, true) {
             public OMElement createOMElement(OMFactory factory, OMContainer parent, String
localName,
                     String namespaceURI, String prefix) {
                 if (prefix == null) {
@@ -45,21 +45,21 @@ public abstract class OMElementCreator {
                 return factory.createOMElement(new QName(namespaceURI, localName, prefix),
parent);
             }
         },
-        new OMElementCreator("String,OMNamespace", true, false) {
+        new CreateOMElementVariant("String,OMNamespace", true, false) {
             public OMElement createOMElement(OMFactory factory, OMContainer parent, String
localName,
                     String namespaceURI, String prefix) {
                 return factory.createOMElement(localName,
                         getOMNamespace(factory, namespaceURI, prefix));
             }
         },
-        new OMElementCreator("String,OMNamespace,OMContainer", true, true) {
+        new CreateOMElementVariant("String,OMNamespace,OMContainer", true, true) {
             public OMElement createOMElement(OMFactory factory, OMContainer parent, String
localName,
                     String namespaceURI, String prefix) {
                 return factory.createOMElement(localName,
                         getOMNamespace(factory, namespaceURI, prefix), parent);
             }
         },
-        new OMElementCreator("String,String,String", true, false) {
+        new CreateOMElementVariant("String,String,String", true, false) {
             public OMElement createOMElement(OMFactory factory, OMContainer parent, String
localName,
                     String namespaceURI, String prefix) {
                 return factory.createOMElement(localName, namespaceURI, prefix);
@@ -71,7 +71,7 @@ public abstract class OMElementCreator {
     private final boolean supportsDefaultNamespace;
     private final boolean supportsContainer;
     
-    public OMElementCreator(String name, boolean supportsDefaultNamespace, boolean supportsContainer)
{
+    public CreateOMElementVariant(String name, boolean supportsDefaultNamespace, boolean
supportsContainer) {
         this.name = name;
         this.supportsDefaultNamespace = supportsDefaultNamespace;
         this.supportsContainer = supportsContainer;

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithDefaultNamespace.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithDefaultNamespace.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithDefaultNamespace.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithDefaultNamespace.java
Mon Apr  9 22:37:16 2012
@@ -26,13 +26,13 @@ import org.apache.axiom.om.OMMetaFactory
 import org.apache.axiom.om.OMNamespace;
 
 public class TestCreateOMElementWithDefaultNamespace extends CreateOMElementTestCase {
-    public TestCreateOMElementWithDefaultNamespace(OMMetaFactory metaFactory, OMElementCreator
variant) {
-        super(metaFactory, variant);
+    public TestCreateOMElementWithDefaultNamespace(OMMetaFactory metaFactory, CreateOMElementVariant
variant, CreateOMElementParentSupplier parentSupplier) {
+        super(metaFactory, variant, parentSupplier);
     }
 
     protected void runTest() throws Throwable {
         OMFactory factory = metaFactory.getOMFactory();
-        OMElement element = variant.createOMElement(factory, null, "test", "urn:ns", "");
+        OMElement element = variant.createOMElement(factory, parentSupplier.createParent(factory),
"test", "urn:ns", "");
         assertTrue(element.isComplete());
         assertEquals("test", element.getLocalName());
         OMNamespace ns = factory.createOMNamespace("urn:ns", "");

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithGeneratedPrefix.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithGeneratedPrefix.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithGeneratedPrefix.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithGeneratedPrefix.java
Mon Apr  9 22:37:16 2012
@@ -27,17 +27,18 @@ import org.apache.axiom.om.OMNamespace;
 
 /**
  * Tests the behavior of the <code>createOMElement</code> methods in {@link OMFactory}
when
- * requested to create an element with a namespace but no namespace prefix is given and no
parent is
- * specified. In this case, <code>createOMElement</code> is expected to generate
a prefix.
+ * requested to create an element with a namespace but no namespace prefix is given and no
matching
+ * namespace declaration is in scope. In this case, <code>createOMElement</code>
is expected to
+ * generate a prefix.
  */
 public class TestCreateOMElementWithGeneratedPrefix extends CreateOMElementTestCase {
-    public TestCreateOMElementWithGeneratedPrefix(OMMetaFactory metaFactory, OMElementCreator
variant) {
-        super(metaFactory, variant);
+    public TestCreateOMElementWithGeneratedPrefix(OMMetaFactory metaFactory, CreateOMElementVariant
variant, CreateOMElementParentSupplier parentSupplier) {
+        super(metaFactory, variant, parentSupplier);
     }
 
     protected void runTest() throws Throwable {
         OMFactory factory = metaFactory.getOMFactory();
-        OMElement element = variant.createOMElement(factory, null, "test", "urn:test", null);
+        OMElement element = variant.createOMElement(factory, parentSupplier.createParent(factory),
"test", "urn:test", null);
         assertEquals("test", element.getLocalName());
         OMNamespace ns = element.getNamespace();
         assertNotNull(ns);

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithInvalidNamespace.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithInvalidNamespace.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithInvalidNamespace.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithInvalidNamespace.java
Mon Apr  9 22:37:16 2012
@@ -26,14 +26,14 @@ import org.apache.axiom.om.OMMetaFactory
  * Neither XML 1.0 nor XML 1.1 allow binding a prefix to the empty namespace name.
  */
 public class TestCreateOMElementWithInvalidNamespace extends CreateOMElementTestCase {
-    public TestCreateOMElementWithInvalidNamespace(OMMetaFactory metaFactory, OMElementCreator
variant) {
-        super(metaFactory, variant);
+    public TestCreateOMElementWithInvalidNamespace(OMMetaFactory metaFactory, CreateOMElementVariant
variant, CreateOMElementParentSupplier parentSupplier) {
+        super(metaFactory, variant, parentSupplier);
     }
 
     protected void runTest() throws Throwable {
         OMFactory factory = metaFactory.getOMFactory();
         try {
-            variant.createOMElement(factory, null, "test", "", "p");
+            variant.createOMElement(factory, parentSupplier.createParent(factory), "test",
"", "p");
             fail("Expected IllegalArgumentException");
         } catch (IllegalArgumentException ex) {
             // Expected

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNamespaceInScope.java
Mon Apr  9 22:37:16 2012
@@ -32,8 +32,8 @@ import org.apache.axiom.om.OMNamespace;
  * parent is specified for the {@link OMElement} to be created.
  */
 public class TestCreateOMElementWithNamespaceInScope extends CreateOMElementTestCase {
-    public TestCreateOMElementWithNamespaceInScope(OMMetaFactory metaFactory, OMElementCreator
variant) {
-        super(metaFactory, variant);
+    public TestCreateOMElementWithNamespaceInScope(OMMetaFactory metaFactory, CreateOMElementVariant
variant) {
+        super(metaFactory, variant, null);
     }
 
     protected void runTest() throws Throwable {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNonDefaultNamespace.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNonDefaultNamespace.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNonDefaultNamespace.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNonDefaultNamespace.java
Mon Apr  9 22:37:16 2012
@@ -26,13 +26,13 @@ import org.apache.axiom.om.OMMetaFactory
 import org.apache.axiom.om.OMNamespace;
 
 public class TestCreateOMElementWithNonDefaultNamespace extends CreateOMElementTestCase {
-    public TestCreateOMElementWithNonDefaultNamespace(OMMetaFactory metaFactory, OMElementCreator
variant) {
-        super(metaFactory, variant);
+    public TestCreateOMElementWithNonDefaultNamespace(OMMetaFactory metaFactory, CreateOMElementVariant
variant, CreateOMElementParentSupplier parentSupplier) {
+        super(metaFactory, variant, parentSupplier);
     }
 
     protected void runTest() throws Throwable {
         OMFactory factory = metaFactory.getOMFactory();
-        OMElement element = variant.createOMElement(factory, null, "test", "urn:ns", "ns");
+        OMElement element = variant.createOMElement(factory, parentSupplier.createParent(factory),
"test", "urn:ns", "ns");
         assertTrue(element.isComplete());
         assertEquals("test", element.getLocalName());
         OMNamespace ns = factory.createOMNamespace("urn:ns", "ns");

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace.java
Mon Apr  9 22:37:16 2012
@@ -24,17 +24,17 @@ import org.apache.axiom.om.OMMetaFactory
 
 /**
  * Tests the behavior of the <code>createOMElement</code> methods in {@link OMFactory}
when
- * requested to create an element without namespace and without parent. In this case, no
namespace
- * declaration is added to the created element.
+ * requested to create an element without namespace. In this case, no namespace declaration
is added
+ * to the created element.
  */
 public class TestCreateOMElementWithoutNamespace extends CreateOMElementTestCase {
-    public TestCreateOMElementWithoutNamespace(OMMetaFactory metaFactory, OMElementCreator
variant) {
-        super(metaFactory, variant);
+    public TestCreateOMElementWithoutNamespace(OMMetaFactory metaFactory, CreateOMElementVariant
variant, CreateOMElementParentSupplier parentSupplier) {
+        super(metaFactory, variant, parentSupplier);
     }
 
     protected void runTest() throws Throwable {
         OMFactory factory = metaFactory.getOMFactory();
-        OMElement element = variant.createOMElement(factory, null, "test", "", "");
+        OMElement element = variant.createOMElement(factory, parentSupplier.createParent(factory),
"test", "", "");
         assertEquals("test", element.getLocalName());
         assertNull(element.getNamespace());
         assertFalse(element.getAllDeclaredNamespaces().hasNext());

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace2.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace2.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace2.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace2.java
Mon Apr  9 22:37:16 2012
@@ -35,8 +35,8 @@ import org.apache.axiom.om.OMNamespace;
  * <a href="https://issues.apache.org/jira/browse/AXIOM-400">AXIOM-400</a>.
  */
 public class TestCreateOMElementWithoutNamespace2 extends CreateOMElementTestCase {
-    public TestCreateOMElementWithoutNamespace2(OMMetaFactory metaFactory, OMElementCreator
variant) {
-        super(metaFactory, variant);
+    public TestCreateOMElementWithoutNamespace2(OMMetaFactory metaFactory, CreateOMElementVariant
variant) {
+        super(metaFactory, variant, null);
     }
 
     protected void runTest() throws Throwable {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace3.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace3.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace3.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespace3.java
Mon Apr  9 22:37:16 2012
@@ -31,8 +31,8 @@ import org.apache.axiom.om.OMMetaFactory
  * element.
  */
 public class TestCreateOMElementWithoutNamespace3 extends CreateOMElementTestCase {
-    public TestCreateOMElementWithoutNamespace3(OMMetaFactory metaFactory, OMElementCreator
variant) {
-        super(metaFactory, variant);
+    public TestCreateOMElementWithoutNamespace3(OMMetaFactory metaFactory, CreateOMElementVariant
variant) {
+        super(metaFactory, variant, null);
     }
 
     protected void runTest() throws Throwable {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespaceNullPrefix.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespaceNullPrefix.java?rev=1311504&r1=1311503&r2=1311504&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespaceNullPrefix.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithoutNamespaceNullPrefix.java
Mon Apr  9 22:37:16 2012
@@ -32,13 +32,13 @@ import org.apache.axiom.om.OMMetaFactory
  * used instead.
  */
 public class TestCreateOMElementWithoutNamespaceNullPrefix extends CreateOMElementTestCase
{
-    public TestCreateOMElementWithoutNamespaceNullPrefix(OMMetaFactory metaFactory, OMElementCreator
variant) {
-        super(metaFactory, variant);
+    public TestCreateOMElementWithoutNamespaceNullPrefix(OMMetaFactory metaFactory, CreateOMElementVariant
variant, CreateOMElementParentSupplier parentSupplier) {
+        super(metaFactory, variant, parentSupplier);
     }
 
     protected void runTest() throws Throwable {
         OMFactory factory = metaFactory.getOMFactory();
-        OMElement element = variant.createOMElement(factory, null, "test", "", null);
+        OMElement element = variant.createOMElement(factory, parentSupplier.createParent(factory),
"test", "", null);
         assertEquals("test", element.getLocalName());
         assertNull(element.getNamespace());
         Iterator it = element.getAllDeclaredNamespaces();



Mime
View raw message