This is an automated email from the ASF dual-hosted git repository.
veithen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-axiom.git
The following commit(s) were added to refs/heads/master by this push:
new 7c8c1a8cb Consolidate om.factory MatrixTest nodes into OMFactoryTests
7c8c1a8cb is described below
commit 7c8c1a8cbc9cdf4946b04cc1ff0918d936baeefe
Author: Copilot <[email protected]>
AuthorDate: Fri Jun 5 10:15:19 2026 +0200
Consolidate om.factory MatrixTest nodes into OMFactoryTests
Co-authored-by: Andreas Veithen-Knowles <[email protected]>
---
.../java/org/apache/axiom/ts/om/OMTestSuite.java | 25 +-
.../TestAddAttributeWithInvalidNamespace1.java | 4 +-
.../TestAddAttributeWithInvalidNamespace2.java | 4 +-
.../apache/axiom/ts/om/factory/OMFactoryTests.java | 257 +++++++++++++++++++++
.../TestCreateOMAttributeGeneratedPrefix.java | 45 ----
.../factory/TestCreateOMAttributeInterfaces.java | 52 -----
...TestCreateOMAttributeNullPrefixNoNamespace.java | 45 ----
...TestCreateOMAttributeWithInvalidNamespace1.java | 44 ----
...TestCreateOMAttributeWithInvalidNamespace2.java | 44 ----
.../factory/TestCreateOMCommentWithoutParent.java | 38 ---
.../factory/TestCreateOMDocTypeWithoutParent.java | 41 ----
.../axiom/ts/om/factory/TestCreateOMDocument.java | 43 ----
.../TestCreateOMElementWithNullOMDataSource1.java | 42 ----
.../TestCreateOMElementWithNullOMDataSource2.java | 42 ----
.../TestCreateOMElementWithNullURIAndPrefix.java | 36 ---
.../ts/om/factory/TestCreateOMEntityReference.java | 41 ----
.../TestCreateOMEntityReferenceWithNullParent.java | 39 ----
.../axiom/ts/om/factory/TestCreateOMNamespace.java | 38 ---
.../factory/TestCreateOMNamespaceWithNullURI.java | 35 ---
...CreateOMProcessingInstructionWithoutParent.java | 39 ----
.../axiom/ts/om/factory/TestCreateOMText.java | 43 ----
.../ts/om/factory/TestCreateOMTextFromOMText.java | 43 ----
.../om/factory/TestCreateOMTextWithNullParent.java | 42 ----
.../ts/om/factory/TestFactoryIsSingleton.java | 40 ----
.../axiom/ts/om/factory/TestGetMetaFactory.java | 40 ----
25 files changed, 264 insertions(+), 898 deletions(-)
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuite.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuite.java
index d2b73153c..ca190f7c0 100644
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuite.java
+++
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuite.java
@@ -36,6 +36,7 @@ import org.apache.axiom.testutils.suite.FanOutNode;
import org.apache.axiom.testutils.suite.InjectorNode;
import org.apache.axiom.testutils.suite.LabelBinding;
import org.apache.axiom.testutils.suite.MatrixTest;
+import org.apache.axiom.testutils.suite.MatrixTestContainer;
import org.apache.axiom.testutils.suite.MatrixTestNode;
import org.apache.axiom.testutils.suite.ParentNode;
import org.apache.axiom.ts.dimension.AddAttributeStrategy;
@@ -730,33 +731,13 @@ public class OMTestSuite {
private static MatrixTestNode factoryTests() {
return new ParentNode(
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMAttributeGeneratedPrefix.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMAttributeInterfaces.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMAttributeNullPrefixNoNamespace.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMAttributeWithInvalidNamespace1.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMAttributeWithInvalidNamespace2.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMCommentWithoutParent.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMDocTypeWithoutParent.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMDocument.class),
+ new
MatrixTestContainer(org.apache.axiom.ts.om.factory.OMFactoryTests.class),
createOMElementTests(),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullOMDataSource1.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullOMDataSource2.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullURIAndPrefix.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMEntityReference.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMEntityReferenceWithNullParent.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMNamespace.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMNamespaceWithNullURI.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMProcessingInstructionWithoutParent.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMText.class),
new FanOutNode<>(
ImmutableList.of(false, true),
Binding.singleton(Key.get(Boolean.class,
Names.named("nullContentId"))),
LabelBinding.simpleBoolean("nullContentId"),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMTextFromBlobProvider.class)),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMTextFromOMText.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMTextWithNullParent.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestFactoryIsSingleton.class),
- new
MatrixTest(org.apache.axiom.ts.om.factory.TestGetMetaFactory.class));
+ new
MatrixTest(org.apache.axiom.ts.om.factory.TestCreateOMTextFromBlobProvider.class)));
}
private static MatrixTestNode createOMElementTests() {
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestAddAttributeWithInvalidNamespace1.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestAddAttributeWithInvalidNamespace1.java
index b676c0746..8031d090f 100644
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestAddAttributeWithInvalidNamespace1.java
+++
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestAddAttributeWithInvalidNamespace1.java
@@ -26,7 +26,7 @@ import javax.xml.namespace.QName;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
-import
org.apache.axiom.ts.om.factory.TestCreateOMAttributeWithInvalidNamespace1;
+import org.apache.axiom.ts.om.factory.OMFactoryTests;
import org.junit.jupiter.api.function.Executable;
/**
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.function.Executable;
* specified namespace is invalid, i.e. if the {@link OMNamespace} object
specifies a prefix for an
* empty namespace.
*
- * @see TestCreateOMAttributeWithInvalidNamespace1
+ * @see OMFactoryTests#createOMAttributeWithInvalidNamespace1()
*/
public class TestAddAttributeWithInvalidNamespace1 implements Executable {
@Inject
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestAddAttributeWithInvalidNamespace2.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestAddAttributeWithInvalidNamespace2.java
index 376338094..071d17ce4 100644
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestAddAttributeWithInvalidNamespace2.java
+++
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestAddAttributeWithInvalidNamespace2.java
@@ -26,7 +26,7 @@ import javax.xml.namespace.QName;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
-import
org.apache.axiom.ts.om.factory.TestCreateOMAttributeWithInvalidNamespace2;
+import org.apache.axiom.ts.om.factory.OMFactoryTests;
import org.junit.jupiter.api.function.Executable;
/**
@@ -34,7 +34,7 @@ import org.junit.jupiter.api.function.Executable;
* specified namespace is invalid, i.e. if the {@link OMNamespace} object
specifies a non-empty
* namespace but no prefix.
*
- * @see TestCreateOMAttributeWithInvalidNamespace2
+ * @see OMFactoryTests#createOMAttributeWithInvalidNamespace2()
*/
public class TestAddAttributeWithInvalidNamespace2 implements Executable {
@Inject
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/OMFactoryTests.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/OMFactoryTests.java
new file mode 100644
index 000000000..6d9d7c7c1
--- /dev/null
+++
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/OMFactoryTests.java
@@ -0,0 +1,257 @@
+/*
+ * 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 static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import com.google.inject.Inject;
+import javax.xml.namespace.QName;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMComment;
+import org.apache.axiom.om.OMContainer;
+import org.apache.axiom.om.OMDataSource;
+import org.apache.axiom.om.OMDocType;
+import org.apache.axiom.om.OMDocument;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMEntityReference;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.OMProcessingInstruction;
+import org.apache.axiom.om.OMSerializable;
+import org.apache.axiom.om.OMText;
+import org.apache.axiom.testutils.suite.Test;
+import org.w3c.dom.Attr;
+import org.w3c.dom.EntityReference;
+
+public class OMFactoryTests {
+ @Inject
+ private OMFactory factory;
+
+ @Inject
+ private OMMetaFactory metaFactory;
+
+ /**
+ * Tests that {@link OMFactory#createOMAttribute(String, OMNamespace,
String)} generates a prefix if
+ * an {@link OMNamespace} object with a null prefix and a non empty
namespace URI is given.
+ */
+ @Test
+ public void createOMAttributeGeneratedPrefix() throws Throwable {
+ OMAttribute attr = factory.createOMAttribute("attr",
factory.createOMNamespace("urn:ns", null), "value");
+ OMNamespace ns = attr.getNamespace();
+ assertThat(ns.getNamespaceURI()).isEqualTo("urn:ns");
+ assertThat(ns.getPrefix()).isNotNull();
+ assertThat(ns.getPrefix()).isNotEmpty();
+ }
+
+ /**
+ * Tests that the {@link OMAttribute} instances created by {@link
+ * OMFactory#createOMAttribute(String, OMNamespace, String)} only
implement the expected interfaces.
+ * An {@link OMAttribute} is neither an {@link OMNode} nor an {@link
OMContainer}. For the latter
+ * this is in contrast to DOM where an {@link Attr} node is a parent node
(containing {@link org.w3c.dom.Text}
+ * and {@link EntityReference} nodes).
+ */
+ @Test
+ public void createOMAttributeInterfaces() throws Throwable {
+ OMNamespace ns = factory.createOMNamespace("urn:test", "p");
+ OMAttribute attr = factory.createOMAttribute("attr", ns, "value");
+ assertThat(attr).isNotInstanceOf(OMSerializable.class);
+ }
+
+ /**
+ * Tests the behavior of {@link OMFactory#createOMAttribute(String,
OMNamespace, String)} if an
+ * {@link OMNamespace} object with a null prefix and an empty namespace
URI is given. Since it is
+ * not allowed to bind a prefix to the empty namespace URI and an
unprefixed attribute has no
+ * namespace, this should give the same result as specifying an empty
prefix.
+ */
+ @Test
+ public void createOMAttributeNullPrefixNoNamespace() throws Throwable {
+ OMNamespace ns = factory.createOMNamespace("", null);
+ OMAttribute attr = factory.createOMAttribute("attr", ns, "value");
+ assertThat(attr.getNamespace()).isNull();
+ }
+
+ /**
+ * Tests that {@link OMFactory#createOMAttribute(String, OMNamespace,
String)} throws an exception
+ * if the specified namespace is invalid, i.e. if the {@link OMNamespace}
object specifies a prefix
+ * for an empty namespace.
+ */
+ @Test
+ public void createOMAttributeWithInvalidNamespace1() throws Throwable {
+ OMNamespace ns = factory.createOMNamespace("", "p");
+ assertThatThrownBy(() -> factory.createOMAttribute("attr", ns,
"value"))
+ .isInstanceOf(IllegalArgumentException.class)
+ .hasMessage("Cannot create a prefixed attribute with an empty
namespace name");
+ }
+
+ /**
+ * Tests that {@link OMFactory#createOMAttribute(String, OMNamespace,
String)} throws an exception
+ * if the specified namespace is invalid, i.e. if the {@link OMNamespace}
object specifies a
+ * non-empty namespace but no prefix.
+ */
+ @Test
+ public void createOMAttributeWithInvalidNamespace2() throws Throwable {
+ OMNamespace ns = factory.createOMNamespace("urn:test", "");
+ assertThatThrownBy(() -> factory.createOMAttribute("attr", ns,
"value"))
+ .isInstanceOf(IllegalArgumentException.class)
+ .hasMessage("Cannot create an unprefixed attribute with a
namespace");
+ }
+
+ @Test
+ public void createOMCommentWithoutParent() throws Throwable {
+ OMComment comment = factory.createOMComment(null, "my comment");
+ assertThat(comment.getParent()).isNull();
+ assertThat(comment.getValue()).isEqualTo("my comment");
+ }
+
+ @Test
+ public void createOMDocTypeWithoutParent() throws Throwable {
+ OMDocType dtd = factory.createOMDocType(null, "root", "publicId",
"systemId", "internalSubset");
+ assertThat(dtd.getParent()).isNull();
+ assertThat(dtd.getRootName()).isEqualTo("root");
+ assertThat(dtd.getPublicId()).isEqualTo("publicId");
+ assertThat(dtd.getSystemId()).isEqualTo("systemId");
+ assertThat(dtd.getInternalSubset()).isEqualTo("internalSubset");
+ }
+
+ @Test
+ public void createOMDocument() throws Throwable {
+ OMDocument document = factory.createOMDocument();
+ assertThat(document).isNotNull();
+ assertThat(document.getFirstOMChild()).isNull();
+
+ // OMDocument doesn't extend OMNode. Therefore, the OMDocument
implementation
+ // should not implement OMNode either. This is a regression test for
AXIOM-385.
+ assertThat(document).isNotInstanceOf(OMNode.class);
+ }
+
+ /**
+ * Tests the behavior of {@link OMFactory#createOMElement(OMDataSource,
String, OMNamespace)} if the
+ * data source is <code>null</code>.
+ */
+ @Test
+ public void createOMElementWithNullOMDataSource1() throws Throwable {
+ assertThatThrownBy(() -> factory.createOMElement(null, "test",
factory.createOMNamespace("urn:test", "p")))
+ .isInstanceOf(IllegalArgumentException.class);
+ }
+
+ /**
+ * Tests the behavior of {@link OMFactory#createOMElement(OMDataSource,
QName)} if the data source
+ * is <code>null</code>.
+ */
+ @Test
+ public void createOMElementWithNullOMDataSource2() throws Throwable {
+ assertThatThrownBy(() -> factory.createOMElement(null, new
QName("urn:test", "test", "p")))
+ .isInstanceOf(IllegalArgumentException.class);
+ }
+
+ @Test
+ public void createOMElementWithNullURIAndPrefix() {
+ assertThatThrownBy(() -> factory.createOMElement("test", (String)
null, (String) null))
+ .isInstanceOf(IllegalArgumentException.class);
+ }
+
+ @Test
+ public void createOMEntityReference() throws Throwable {
+ OMElement parent = factory.createOMElement("test", null);
+ OMEntityReference entref = factory.createOMEntityReference(parent,
"testref");
+ assertThat(entref.getParent()).isSameAs(parent);
+ assertThat(entref.getName()).isEqualTo("testref");
+ assertThat(entref.getReplacementText()).isNull();
+ }
+
+ @Test
+ public void createOMEntityReferenceWithNullParent() throws Throwable {
+ OMEntityReference entref = factory.createOMEntityReference(null,
"testref");
+ assertThat(entref.getParent()).isNull();
+ assertThat(entref.getName()).isEqualTo("testref");
+ assertThat(entref.getReplacementText()).isNull();
+ }
+
+ @Test
+ public void createOMNamespace() throws Throwable {
+ OMNamespace ns = factory.createOMNamespace("urn:test", "t");
+ assertThat(ns.getNamespaceURI()).isEqualTo("urn:test");
+ assertThat(ns.getPrefix()).isEqualTo("t");
+ }
+
+ @Test
+ public void createOMNamespaceWithNullURI() throws Throwable {
+ assertThatThrownBy(() -> factory.createOMNamespace(null,
"t")).isInstanceOf(IllegalArgumentException.class);
+ }
+
+ @Test
+ public void createOMProcessingInstructionWithoutParent() throws Throwable {
+ OMProcessingInstruction pi =
factory.createOMProcessingInstruction(null, "mypi", "data");
+ assertThat(pi.getParent()).isNull();
+ assertThat(pi.getTarget()).isEqualTo("mypi");
+ assertThat(pi.getValue()).isEqualTo("data");
+ }
+
+ @Test
+ public void createOMText() throws Throwable {
+ OMNamespace namespace =
factory.createOMNamespace("http://www.apache.org/~chinthaka", "myhome");
+ OMElement omElement = factory.createOMElement("chinthaka", namespace);
+ String text = "sampleText";
+ OMText omText = factory.createOMText(omElement, text);
+ assertThat(omText.isComplete()).isTrue();
+ assertThat(omText.getText()).isEqualTo(text);
+ }
+
+ /** Tests {@link OMFactory#createOMText(OMContainer, OMText)}. */
+ @Test
+ public void createOMTextFromOMText() throws Throwable {
+ OMText orgText = factory.createOMText("text");
+ OMElement parent = factory.createOMElement("test", null);
+ OMText text = factory.createOMText(parent, orgText);
+ assertThat(text.getText()).isEqualTo("text");
+ assertThat(text.getParent()).isSameAs(parent);
+ }
+
+ /**
+ * Tests that {@link OMFactory#createOMText(OMContainer, String)} can be
used to create an orphaned
+ * node by setting <code>parent</code> to <code>null</code>.
+ */
+ @Test
+ public void createOMTextWithNullParent() throws Throwable {
+ OMText text = factory.createOMText(null, "text");
+ assertThat(text.getParent()).isNull();
+ }
+
+ /**
+ * Tests that the {@link OMFactory} returned by {@link OMMetaFactory} is a
singleton. More precisely
+ * this unit test checks that subsequent calls to {@link
OMMetaFactory#getOMFactory()} return the
+ * same instance.
+ */
+ @Test
+ public void factoryIsSingleton() throws Throwable {
+ assertThat(factory).isSameAs(factory);
+ }
+
+ /**
+ * Tests that {@link OMFactory#getMetaFactory()} returns the reference of
the {@link OMMetaFactory}
+ * from which the reference to the {@link OMFactory} was obtained.
+ */
+ @Test
+ public void getMetaFactory() throws Throwable {
+
assertThat(metaFactory.getOMFactory().getMetaFactory()).isSameAs(metaFactory);
+ }
+}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeGeneratedPrefix.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeGeneratedPrefix.java
deleted file mode 100644
index 8c7622d99..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeGeneratedPrefix.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.junit.jupiter.api.function.Executable;
-
-/**
- * Tests that {@link OMFactory#createOMAttribute(String, OMNamespace, String)}
generates a prefix if
- * an {@link OMNamespace} object with a null prefix and a non empty namespace
URI is given.
- */
-public class TestCreateOMAttributeGeneratedPrefix implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMAttribute attr = factory.createOMAttribute("attr",
factory.createOMNamespace("urn:ns", null), "value");
- OMNamespace ns = attr.getNamespace();
- assertThat(ns.getNamespaceURI()).isEqualTo("urn:ns");
- assertThat(ns.getPrefix()).isNotNull();
- assertThat(ns.getPrefix()).isNotEmpty();
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeInterfaces.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeInterfaces.java
deleted file mode 100644
index 513e082d0..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeInterfaces.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMContainer;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMNode;
-import org.apache.axiom.om.OMSerializable;
-import org.junit.jupiter.api.function.Executable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.EntityReference;
-import org.w3c.dom.Text;
-
-/**
- * Tests that the {@link OMAttribute} instances created by {@link
- * OMFactory#createOMAttribute(String, OMNamespace, String)} only implement
the expected interfaces.
- * An {@link OMAttribute} is neither an {@link OMNode} nor an {@link
OMContainer}. For the latter
- * this is in contrast to DOM where an {@link Attr} node is a parent node
(containing {@link Text}
- * and {@link EntityReference} nodes).
- */
-public class TestCreateOMAttributeInterfaces implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMNamespace ns = factory.createOMNamespace("urn:test", "p");
- OMAttribute attr = factory.createOMAttribute("attr", ns, "value");
- assertThat(attr).isNotInstanceOf(OMSerializable.class);
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeNullPrefixNoNamespace.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeNullPrefixNoNamespace.java
deleted file mode 100644
index c66298041..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeNullPrefixNoNamespace.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.junit.jupiter.api.function.Executable;
-
-/**
- * Tests the behavior of {@link OMFactory#createOMAttribute(String,
OMNamespace, String)} if an
- * {@link OMNamespace} object with a null prefix and an empty namespace URI is
given. Since it is
- * not allowed to bind a prefix to the empty namespace URI and an unprefixed
attribute has no
- * namespace, this should give the same result as specifying an empty prefix.
- */
-public class TestCreateOMAttributeNullPrefixNoNamespace implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMNamespace ns = factory.createOMNamespace("", null);
- OMAttribute attr = factory.createOMAttribute("attr", ns, "value");
- assertThat(attr.getNamespace()).isNull();
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeWithInvalidNamespace1.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeWithInvalidNamespace1.java
deleted file mode 100644
index d630969c9..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeWithInvalidNamespace1.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.junit.jupiter.api.function.Executable;
-
-/**
- * Tests that {@link OMFactory#createOMAttribute(String, OMNamespace, String)}
throws an exception
- * if the specified namespace is invalid, i.e. if the {@link OMNamespace}
object specifies a prefix
- * for an empty namespace.
- */
-public class TestCreateOMAttributeWithInvalidNamespace1 implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMNamespace ns = factory.createOMNamespace("", "p");
- assertThatThrownBy(() -> factory.createOMAttribute("attr", ns,
"value"))
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessage("Cannot create a prefixed attribute with an empty
namespace name");
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeWithInvalidNamespace2.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeWithInvalidNamespace2.java
deleted file mode 100644
index 408109990..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMAttributeWithInvalidNamespace2.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.junit.jupiter.api.function.Executable;
-
-/**
- * Tests that {@link OMFactory#createOMAttribute(String, OMNamespace, String)}
throws an exception
- * if the specified namespace is invalid, i.e. if the {@link OMNamespace}
object specifies a
- * non-empty namespace but no prefix.
- */
-public class TestCreateOMAttributeWithInvalidNamespace2 implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMNamespace ns = factory.createOMNamespace("urn:test", "");
- assertThatThrownBy(() -> factory.createOMAttribute("attr", ns,
"value"))
- .isInstanceOf(IllegalArgumentException.class)
- .hasMessage("Cannot create an unprefixed attribute with a
namespace");
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMCommentWithoutParent.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMCommentWithoutParent.java
deleted file mode 100644
index 716b698b8..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMCommentWithoutParent.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMComment;
-import org.apache.axiom.om.OMFactory;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMCommentWithoutParent implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMComment comment = factory.createOMComment(null, "my comment");
- assertThat(comment.getParent()).isNull();
- assertThat(comment.getValue()).isEqualTo("my comment");
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocTypeWithoutParent.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocTypeWithoutParent.java
deleted file mode 100644
index 921d54dc5..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocTypeWithoutParent.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMDocType;
-import org.apache.axiom.om.OMFactory;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMDocTypeWithoutParent implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMDocType dtd = factory.createOMDocType(null, "root", "publicId",
"systemId", "internalSubset");
- assertThat(dtd.getParent()).isNull();
- assertThat(dtd.getRootName()).isEqualTo("root");
- assertThat(dtd.getPublicId()).isEqualTo("publicId");
- assertThat(dtd.getSystemId()).isEqualTo("systemId");
- assertThat(dtd.getInternalSubset()).isEqualTo("internalSubset");
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocument.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocument.java
deleted file mode 100644
index 0ca4efb30..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocument.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMDocument;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNode;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMDocument implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMDocument document = factory.createOMDocument();
- assertThat(document).isNotNull();
- assertThat(document.getFirstOMChild()).isNull();
-
- // OMDocument doesn't extend OMNode. Therefore, the OMDocument
implementation
- // should not implement OMNode either. This is a regression test for
AXIOM-385.
- assertThat(document).isNotInstanceOf(OMNode.class);
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNullOMDataSource1.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNullOMDataSource1.java
deleted file mode 100644
index ff5b20b1c..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNullOMDataSource1.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.junit.jupiter.api.function.Executable;
-
-/**
- * Tests the behavior of {@link OMFactory#createOMElement(OMDataSource,
String, OMNamespace)} if the
- * data source is <code>null</code>.
- */
-public class TestCreateOMElementWithNullOMDataSource1 implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- assertThatThrownBy(() -> factory.createOMElement(null, "test",
factory.createOMNamespace("urn:test", "p")))
- .isInstanceOf(IllegalArgumentException.class);
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNullOMDataSource2.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNullOMDataSource2.java
deleted file mode 100644
index 2498895fc..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNullOMDataSource2.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import com.google.inject.Inject;
-import javax.xml.namespace.QName;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMFactory;
-import org.junit.jupiter.api.function.Executable;
-
-/**
- * Tests the behavior of {@link OMFactory#createOMElement(OMDataSource,
QName)} if the data source
- * is <code>null</code>.
- */
-public class TestCreateOMElementWithNullOMDataSource2 implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- assertThatThrownBy(() -> factory.createOMElement(null, new
QName("urn:test", "test", "p")))
- .isInstanceOf(IllegalArgumentException.class);
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNullURIAndPrefix.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNullURIAndPrefix.java
deleted file mode 100644
index 9aaa46709..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMElementWithNullURIAndPrefix.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMFactory;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMElementWithNullURIAndPrefix implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() {
- assertThatThrownBy(() -> factory.createOMElement("test", (String)
null, (String) null))
- .isInstanceOf(IllegalArgumentException.class);
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMEntityReference.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMEntityReference.java
deleted file mode 100644
index 858e2349b..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMEntityReference.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMEntityReference;
-import org.apache.axiom.om.OMFactory;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMEntityReference implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMElement parent = factory.createOMElement("test", null);
- OMEntityReference entref = factory.createOMEntityReference(parent,
"testref");
- assertThat(entref.getParent()).isSameAs(parent);
- assertThat(entref.getName()).isEqualTo("testref");
- assertThat(entref.getReplacementText()).isNull();
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMEntityReferenceWithNullParent.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMEntityReferenceWithNullParent.java
deleted file mode 100644
index 29ef1df9e..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMEntityReferenceWithNullParent.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMEntityReference;
-import org.apache.axiom.om.OMFactory;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMEntityReferenceWithNullParent implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMEntityReference entref = factory.createOMEntityReference(null,
"testref");
- assertThat(entref.getParent()).isNull();
- assertThat(entref.getName()).isEqualTo("testref");
- assertThat(entref.getReplacementText()).isNull();
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMNamespace.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMNamespace.java
deleted file mode 100644
index d8a4e060e..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMNamespace.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMNamespace implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMNamespace ns = factory.createOMNamespace("urn:test", "t");
- assertThat(ns.getNamespaceURI()).isEqualTo("urn:test");
- assertThat(ns.getPrefix()).isEqualTo("t");
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMNamespaceWithNullURI.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMNamespaceWithNullURI.java
deleted file mode 100644
index 7027181c9..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMNamespaceWithNullURI.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMFactory;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMNamespaceWithNullURI implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- assertThatThrownBy(() -> factory.createOMNamespace(null,
"t")).isInstanceOf(IllegalArgumentException.class);
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMProcessingInstructionWithoutParent.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMProcessingInstructionWithoutParent.java
deleted file mode 100644
index 4aaadefc7..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMProcessingInstructionWithoutParent.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMProcessingInstruction;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMProcessingInstructionWithoutParent implements
Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMProcessingInstruction pi =
factory.createOMProcessingInstruction(null, "mypi", "data");
- assertThat(pi.getParent()).isNull();
- assertThat(pi.getTarget()).isEqualTo("mypi");
- assertThat(pi.getValue()).isEqualTo("data");
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMText.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMText.java
deleted file mode 100644
index 52648022d..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMText.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMText;
-import org.junit.jupiter.api.function.Executable;
-
-public class TestCreateOMText implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMNamespace namespace =
factory.createOMNamespace("http://www.apache.org/~chinthaka", "myhome");
- OMElement omElement = factory.createOMElement("chinthaka", namespace);
- String text = "sampleText";
- OMText omText = factory.createOMText(omElement, text);
- assertThat(omText.isComplete()).isTrue();
- assertThat(omText.getText()).isEqualTo(text);
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromOMText.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromOMText.java
deleted file mode 100644
index 40d99eeee..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextFromOMText.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMContainer;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMText;
-import org.junit.jupiter.api.function.Executable;
-
-/** Tests {@link OMFactory#createOMText(OMContainer, OMText)}. */
-public class TestCreateOMTextFromOMText implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMText orgText = factory.createOMText("text");
- OMElement parent = factory.createOMElement("test", null);
- OMText text = factory.createOMText(parent, orgText);
- assertThat(text.getText()).isEqualTo("text");
- assertThat(text.getParent()).isSameAs(parent);
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextWithNullParent.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextWithNullParent.java
deleted file mode 100644
index 85658d8c7..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMTextWithNullParent.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMContainer;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMText;
-import org.junit.jupiter.api.function.Executable;
-
-/**
- * Tests that {@link OMFactory#createOMText(OMContainer, String)} can be used
to create an orphaned
- * node by setting <code>parent</code> to <code>null</code>.
- */
-public class TestCreateOMTextWithNullParent implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- OMText text = factory.createOMText(null, "text");
- assertThat(text.getParent()).isNull();
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestFactoryIsSingleton.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestFactoryIsSingleton.java
deleted file mode 100644
index 59276b287..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestFactoryIsSingleton.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMFactory;
-import org.junit.jupiter.api.function.Executable;
-
-/**
- * Tests that the {@link OMFactory} returned by {@link OMMetaFactory} is a
singleton. More precisely
- * this unit test checks that subsequent calls to {@link
OMMetaFactory#getOMFactory()} return the
- * same instance.
- */
-public class TestFactoryIsSingleton implements Executable {
- @Inject
- private OMFactory factory;
-
- @Override
- public void execute() throws Throwable {
- assertThat(factory).isSameAs(factory);
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestGetMetaFactory.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestGetMetaFactory.java
deleted file mode 100644
index 3a5204808..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestGetMetaFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMMetaFactory;
-import org.junit.jupiter.api.function.Executable;
-
-/**
- * Tests that {@link OMFactory#getMetaFactory()} returns the reference of the
{@link OMMetaFactory}
- * from which the reference to the {@link OMFactory} was obtained.
- */
-public class TestGetMetaFactory implements Executable {
- @Inject
- private OMMetaFactory metaFactory;
-
- @Override
- public void execute() throws Throwable {
-
assertThat(metaFactory.getOMFactory().getMetaFactory()).isSameAs(metaFactory);
- }
-}