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 9e9191591 Modernize W3CDOMTestSuiteBuilder
9e9191591 is described below
commit 9e9191591782fd01160f818f759dec5fcf988d01
Author: Andreas Veithen-Knowles <[email protected]>
AuthorDate: Sat Mar 28 11:56:57 2026 +0000
Modernize W3CDOMTestSuiteBuilder
---
testing/dom-testsuite/pom.xml | 1 +
.../axiom/ts/dom/w3c/W3CDOMTestSuiteBuilder.java | 6 ++---
testing/dom-testsuite/src/w3c/DOMTestSink.patch | 26 ++++++++++++++++++++++
3 files changed, 29 insertions(+), 4 deletions(-)
diff --git a/testing/dom-testsuite/pom.xml b/testing/dom-testsuite/pom.xml
index d7c9ab54e..f55c06254 100644
--- a/testing/dom-testsuite/pom.xml
+++ b/testing/dom-testsuite/pom.xml
@@ -187,6 +187,7 @@
<configuration>
<target>
<patch patchfile="src/w3c/resolveURI.patch"
dir="${project.build.directory}/w3c/java" strip="1" />
+ <patch patchfile="src/w3c/DOMTestSink.patch"
dir="${project.build.directory}/w3c/java" strip="1" />
</target>
</configuration>
</execution>
diff --git
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/w3c/W3CDOMTestSuiteBuilder.java
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/w3c/W3CDOMTestSuiteBuilder.java
index 9f61eb470..b9208d444 100644
---
a/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/w3c/W3CDOMTestSuiteBuilder.java
+++
b/testing/dom-testsuite/src/main/java/org/apache/axiom/ts/dom/w3c/W3CDOMTestSuiteBuilder.java
@@ -74,7 +74,7 @@ public abstract class W3CDOMTestSuiteBuilder extends
MatrixTestSuiteBuilder {
suite.build(
new DOMTestSink() {
@Override
- public void addTest(Class testClass) {
+ public void addTest(Class<? extends DOMTestCase>
testClass) {
try {
if (!unsupportedFeatures.isEmpty()) {
Set<DOMFeature> usedFeatures = new
HashSet<DOMFeature>();
@@ -92,9 +92,7 @@ public abstract class W3CDOMTestSuiteBuilder extends
MatrixTestSuiteBuilder {
}
}
Constructor<? extends DOMTestCase> testConstructor
=
- ((Class<?>) testClass)
- .asSubclass(DOMTestCase.class)
-
.getConstructor(DOMTestDocumentBuilderFactory.class);
+
testClass.getConstructor(DOMTestDocumentBuilderFactory.class);
DOMTestCase test;
try {
test = testConstructor.newInstance(new
Object[] {factory});
diff --git a/testing/dom-testsuite/src/w3c/DOMTestSink.patch
b/testing/dom-testsuite/src/w3c/DOMTestSink.patch
new file mode 100644
index 000000000..f3b3a3a52
--- /dev/null
+++ b/testing/dom-testsuite/src/w3c/DOMTestSink.patch
@@ -0,0 +1,26 @@
+*
+* 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.
+*
+--- java/org/w3c/domts/DOMTestSink.java.org 2026-03-28 11:51:52
++++ java/org/w3c/domts/DOMTestSink.java 2026-03-28 11:52:14
+@@ -24,4 +24,4 @@
+
+ public interface DOMTestSink {
+- public void addTest(Class test);
++ public void addTest(Class<? extends DOMTestCase> test);
+ }