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 3d1be4c91 Consolidate attr tests into AttrTests
3d1be4c91 is described below
commit 3d1be4c916e070db12b4cfe3638ea46289eaa14d
Author: Copilot <[email protected]>
AuthorDate: Fri May 22 22:19:52 2026 +0100
Consolidate attr tests into AttrTests
Co-authored-by: Andreas Veithen-Knowles <[email protected]>
---
.../java/org/apache/axiom/ts/dom/DOMTestSuite.java | 9 +-
.../org/apache/axiom/ts/dom/attr/AttrTests.java | 129 +++++++++++++++++++++
.../axiom/ts/dom/attr/TestGetChildNodes.java | 47 --------
.../axiom/ts/dom/attr/TestGetFirstChild.java | 45 -------
.../attr/TestGetNamespaceURIWithNoNamespace.java | 41 -------
.../dom/attr/TestGetValueWithMultipleChildren.java | 42 -------
.../TestLookupNamespaceURIWithoutOwnerElement.java | 44 -------
.../attr/TestSetPrefixNotNullWithNamespace.java | 46 --------
.../attr/TestSetPrefixNotNullWithoutNamespace.java | 48 --------
.../dom/attr/TestSetPrefixNullWithNamespace.java | 46 --------
10 files changed, 130 insertions(+), 367 deletions(-)
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuite.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuite.java
index 82a7963d3..7b693ac79 100644
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuite.java
+++
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/DOMTestSuite.java
@@ -61,14 +61,7 @@ public class DOMTestSuite {
return new InjectorNode(
binder ->
binder.bind(DocumentBuilderFactory.class).toInstance(dbf),
new ParentNode(
- new
MatrixTest(org.apache.axiom.ts.dom.attr.TestGetChildNodes.class),
- new
MatrixTest(org.apache.axiom.ts.dom.attr.TestGetFirstChild.class),
- new
MatrixTest(org.apache.axiom.ts.dom.attr.TestGetNamespaceURIWithNoNamespace.class),
- new
MatrixTest(org.apache.axiom.ts.dom.attr.TestGetValueWithMultipleChildren.class),
- new
MatrixTest(org.apache.axiom.ts.dom.attr.TestLookupNamespaceURIWithoutOwnerElement.class),
- new
MatrixTest(org.apache.axiom.ts.dom.attr.TestSetPrefixNotNullWithNamespace.class),
- new
MatrixTest(org.apache.axiom.ts.dom.attr.TestSetPrefixNotNullWithoutNamespace.class),
- new
MatrixTest(org.apache.axiom.ts.dom.attr.TestSetPrefixNullWithNamespace.class),
+ new
MatrixTestContainer(org.apache.axiom.ts.dom.attr.AttrTests.class),
new
MatrixTest(org.apache.axiom.ts.dom.builder.TestParseURI.class),
new
MatrixTest(org.apache.axiom.ts.dom.builder.TestWhitespaceAroundDocumentElement.class),
new
MatrixTest(org.apache.axiom.ts.dom.document.TestAdoptNode.class),
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/AttrTests.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/AttrTests.java
new file mode 100644
index 000000000..83d6b7055
--- /dev/null
+++
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/AttrTests.java
@@ -0,0 +1,129 @@
+/*
+ * 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.dom.attr;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import com.google.inject.Inject;
+import javax.xml.parsers.DocumentBuilderFactory;
+import org.apache.axiom.testutils.suite.Test;
+import org.w3c.dom.Attr;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+public class AttrTests {
+ @Inject
+ private DocumentBuilderFactory dbf;
+
+ @Test
+ public void getChildNodes() throws Throwable {
+ Document document = dbf.newDocumentBuilder().newDocument();
+ Attr attr = document.createAttributeNS(null, "name");
+ attr.setValue("value");
+ NodeList children = attr.getChildNodes();
+ assertThat(children.getLength()).isEqualTo(1);
+ Node child = children.item(0);
+ assertThat(child).isInstanceOf(Text.class);
+ assertThat(((Text) child).getData()).isEqualTo("value");
+ }
+
+ @Test
+ public void getFirstChild() throws Throwable {
+ Document document = dbf.newDocumentBuilder().newDocument();
+ Attr attr = document.createAttributeNS(null, "name");
+ attr.setValue("value");
+ Node child = attr.getFirstChild();
+ assertThat(child).isNotNull();
+ assertThat(child).isInstanceOf(Text.class);
+ assertThat(((Text) child).getData()).isEqualTo("value");
+ }
+
+ @Test
+ public void getNamespaceURIWithNoNamespace() throws Throwable {
+ Document doc = dbf.newDocumentBuilder().newDocument();
+ Attr attr = doc.createAttributeNS(null, "test");
+ assertThat(attr.getNamespaceURI()).isNull();
+ attr = doc.createAttributeNS("", "test");
+ assertThat(attr.getNamespaceURI()).isNull();
+ }
+
+ @Test
+ public void getValueWithMultipleChildren() throws Throwable {
+ Document document = dbf.newDocumentBuilder().newDocument();
+ Attr attr = document.createAttributeNS(null, "attr");
+ attr.appendChild(document.createTextNode("A"));
+ attr.appendChild(document.createTextNode("B"));
+ attr.appendChild(document.createTextNode("C"));
+ assertThat(attr.getValue()).isEqualTo("ABC");
+ }
+
+ /**
+ * Tests the behavior of {@link Node#lookupNamespaceURI(String)} on an
attribute node that has no
+ * owner element.
+ */
+ @Test
+ public void lookupNamespaceURIWithoutOwnerElement() throws Throwable {
+ Document document = dbf.newDocumentBuilder().newDocument();
+ Attr attr = document.createAttributeNS("urn:test", "p:attr");
+ assertThat(attr.lookupNamespaceURI("p")).isNull();
+ }
+
+ /**
+ * Tests the behavior of {@link Node#setPrefix(String)} on an {@link Attr}
if the specified prefix
+ * is not null (and not an empty string) and the attribute has a namespace.
+ */
+ @Test
+ public void setPrefixNotNullWithNamespace() throws Throwable {
+ Document document = dbf.newDocumentBuilder().newDocument();
+ Attr attr = document.createAttributeNS("urn:ns", "p:test");
+ attr.setPrefix("q");
+ assertThat(attr.getPrefix()).isEqualTo("q");
+ assertThat(attr.getName()).isEqualTo("q:test");
+ }
+
+ /**
+ * Tests that {@link Node#setPrefix(String)} throws an exception if an
attempt is made to set a
+ * prefix on an {@link Attr} that has no namespace.
+ */
+ @Test
+ public void setPrefixNotNullWithoutNamespace() throws Throwable {
+ Document document = dbf.newDocumentBuilder().newDocument();
+ Attr attr = document.createAttributeNS(null, "test");
+ assertThatThrownBy(() -> attr.setPrefix("p"))
+ .isInstanceOfSatisfying(
+ DOMException.class, ex ->
assertThat(ex.code).isEqualTo(DOMException.NAMESPACE_ERR));
+ }
+
+ /**
+ * Tests the behavior of {@link Node#setPrefix(String)} when used to
remove the prefix on an {@link
+ * Attr} that has a namespace. Although this results in an attribute that
is invalid with respect to
+ * namespaces, no exception is thrown.
+ */
+ @Test
+ public void setPrefixNullWithNamespace() throws Throwable {
+ Document document = dbf.newDocumentBuilder().newDocument();
+ Attr attr = document.createAttributeNS("urn:test", "p:test");
+ attr.setPrefix(null);
+ assertThat(attr.getPrefix()).isNull();
+ }
+}
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetChildNodes.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetChildNodes.java
deleted file mode 100644
index 9572fb989..000000000
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetChildNodes.java
+++ /dev/null
@@ -1,47 +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.dom.attr;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.junit.jupiter.api.function.Executable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-public class TestGetChildNodes implements Executable {
- @Inject
- private DocumentBuilderFactory dbf;
-
- @Override
- public void execute() throws Throwable {
- Document document = dbf.newDocumentBuilder().newDocument();
- Attr attr = document.createAttributeNS(null, "name");
- attr.setValue("value");
- NodeList children = attr.getChildNodes();
- assertThat(children.getLength()).isEqualTo(1);
- Node child = children.item(0);
- assertThat(child).isInstanceOf(Text.class);
- assertThat(((Text) child).getData()).isEqualTo("value");
- }
-}
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetFirstChild.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetFirstChild.java
deleted file mode 100644
index 5cfa7d756..000000000
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetFirstChild.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.dom.attr;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.junit.jupiter.api.function.Executable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.Text;
-
-public class TestGetFirstChild implements Executable {
- @Inject
- private DocumentBuilderFactory dbf;
-
- @Override
- public void execute() throws Throwable {
- Document document = dbf.newDocumentBuilder().newDocument();
- Attr attr = document.createAttributeNS(null, "name");
- attr.setValue("value");
- Node child = attr.getFirstChild();
- assertThat(child).isNotNull();
- assertThat(child).isInstanceOf(Text.class);
- assertThat(((Text) child).getData()).isEqualTo("value");
- }
-}
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetNamespaceURIWithNoNamespace.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetNamespaceURIWithNoNamespace.java
deleted file mode 100644
index f42b6f053..000000000
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetNamespaceURIWithNoNamespace.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.dom.attr;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.junit.jupiter.api.function.Executable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-
-public class TestGetNamespaceURIWithNoNamespace implements Executable {
- @Inject
- private DocumentBuilderFactory dbf;
-
- @Override
- public void execute() throws Throwable {
- Document doc = dbf.newDocumentBuilder().newDocument();
- Attr attr = doc.createAttributeNS(null, "test");
- assertThat(attr.getNamespaceURI()).isNull();
- attr = doc.createAttributeNS("", "test");
- assertThat(attr.getNamespaceURI()).isNull();
- }
-}
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetValueWithMultipleChildren.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetValueWithMultipleChildren.java
deleted file mode 100644
index c21080a9b..000000000
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestGetValueWithMultipleChildren.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.dom.attr;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.junit.jupiter.api.function.Executable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-
-public class TestGetValueWithMultipleChildren implements Executable {
- @Inject
- private DocumentBuilderFactory dbf;
-
- @Override
- public void execute() throws Throwable {
- Document document = dbf.newDocumentBuilder().newDocument();
- Attr attr = document.createAttributeNS(null, "attr");
- attr.appendChild(document.createTextNode("A"));
- attr.appendChild(document.createTextNode("B"));
- attr.appendChild(document.createTextNode("C"));
- assertThat(attr.getValue()).isEqualTo("ABC");
- }
-}
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestLookupNamespaceURIWithoutOwnerElement.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestLookupNamespaceURIWithoutOwnerElement.java
deleted file mode 100644
index 40e3c45c6..000000000
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestLookupNamespaceURIWithoutOwnerElement.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.dom.attr;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.junit.jupiter.api.function.Executable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Tests the behavior of {@link Node#lookupNamespaceURI(String)} on an
attribute node that has no
- * owner element.
- */
-public class TestLookupNamespaceURIWithoutOwnerElement implements Executable {
- @Inject
- private DocumentBuilderFactory dbf;
-
- @Override
- public void execute() throws Throwable {
- Document document = dbf.newDocumentBuilder().newDocument();
- Attr attr = document.createAttributeNS("urn:test", "p:attr");
- assertThat(attr.lookupNamespaceURI("p")).isNull();
- }
-}
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithNamespace.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithNamespace.java
deleted file mode 100644
index ec3382031..000000000
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithNamespace.java
+++ /dev/null
@@ -1,46 +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.dom.attr;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.junit.jupiter.api.function.Executable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Tests the behavior of {@link Node#setPrefix(String)} on an {@link Attr} if
the specified prefix
- * is not null (and not an empty string) and the attribute has a namespace.
- */
-public class TestSetPrefixNotNullWithNamespace implements Executable {
- @Inject
- private DocumentBuilderFactory dbf;
-
- @Override
- public void execute() throws Throwable {
- Document document = dbf.newDocumentBuilder().newDocument();
- Attr attr = document.createAttributeNS("urn:ns", "p:test");
- attr.setPrefix("q");
- assertThat(attr.getPrefix()).isEqualTo("q");
- assertThat(attr.getName()).isEqualTo("q:test");
- }
-}
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithoutNamespace.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithoutNamespace.java
deleted file mode 100644
index ce8916051..000000000
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNotNullWithoutNamespace.java
+++ /dev/null
@@ -1,48 +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.dom.attr;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatThrownBy;
-
-import com.google.inject.Inject;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.junit.jupiter.api.function.Executable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Tests that {@link Node#setPrefix(String)} throws an exception if an attempt
is made to set a
- * prefix on an {@link Attr} that has no namespace.
- */
-public class TestSetPrefixNotNullWithoutNamespace implements Executable {
- @Inject
- private DocumentBuilderFactory dbf;
-
- @Override
- public void execute() throws Throwable {
- Document document = dbf.newDocumentBuilder().newDocument();
- Attr attr = document.createAttributeNS(null, "test");
- assertThatThrownBy(() -> attr.setPrefix("p"))
- .isInstanceOfSatisfying(
- DOMException.class, ex ->
assertThat(ex.code).isEqualTo(DOMException.NAMESPACE_ERR));
- }
-}
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNullWithNamespace.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNullWithNamespace.java
deleted file mode 100644
index d35e4f439..000000000
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/attr/TestSetPrefixNullWithNamespace.java
+++ /dev/null
@@ -1,46 +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.dom.attr;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import com.google.inject.Inject;
-import javax.xml.parsers.DocumentBuilderFactory;
-import org.junit.jupiter.api.function.Executable;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-/**
- * Tests the behavior of {@link Node#setPrefix(String)} when used to remove
the prefix on an {@link
- * Attr} that has a namespace. Although this results in an attribute that is
invalid with respect to
- * namespaces, no exception is thrown.
- */
-public class TestSetPrefixNullWithNamespace implements Executable {
- @Inject
- private DocumentBuilderFactory dbf;
-
- @Override
- public void execute() throws Throwable {
- Document document = dbf.newDocumentBuilder().newDocument();
- Attr attr = document.createAttributeNS("urn:test", "p:test");
- attr.setPrefix(null);
- assertThat(attr.getPrefix()).isNull();
- }
-}