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 3a689d320 Migrate SOAPDOMTestSuiteBuilder to MatrixTestNode framework
3a689d320 is described below
commit 3a689d320706dfc6d787d3c9165a55880eff59df
Author: Andreas Veithen-Knowles <[email protected]>
AuthorDate: Sat Mar 21 15:11:48 2026 +0000
Migrate SOAPDOMTestSuiteBuilder to MatrixTestNode framework
---
.../soap/impl/dom/SOAPDOMImplementationTest.java | 18 ++++----
.../apache/axiom/ts/soapdom/SOAPDOMTestSuite.java | 49 ++++++++++++++++++++++
.../axiom/ts/soapdom/SOAPDOMTestSuiteBuilder.java | 49 ----------------------
.../soapdom/header/TestExamineAllHeaderBlocks.java | 3 ++
.../TestExamineMustUnderstandHeaderBlocks.java | 3 ++
.../message/TestLazySOAPFactorySelection.java | 3 ++
6 files changed, 67 insertions(+), 58 deletions(-)
diff --git
a/implementations/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPDOMImplementationTest.java
b/implementations/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPDOMImplementationTest.java
index c96d470bd..7141beafc 100644
---
a/implementations/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPDOMImplementationTest.java
+++
b/implementations/axiom-dom/src/test/java/org/apache/axiom/soap/impl/dom/SOAPDOMImplementationTest.java
@@ -18,16 +18,16 @@
*/
package org.apache.axiom.soap.impl.dom;
-import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactoryLoader;
-import org.apache.axiom.ts.soapdom.SOAPDOMTestSuiteBuilder;
+import java.util.stream.Stream;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
+import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactoryLoader;
+import org.apache.axiom.ts.soapdom.SOAPDOMTestSuite;
+import org.junit.jupiter.api.DynamicNode;
+import org.junit.jupiter.api.TestFactory;
-public class SOAPDOMImplementationTest extends TestCase {
- public static TestSuite suite() {
- SOAPDOMTestSuiteBuilder builder =
- new SOAPDOMTestSuiteBuilder(new
OMDOMMetaFactoryLoader().load(null));
- return builder.build();
+public class SOAPDOMImplementationTest {
+ @TestFactory
+ public Stream<DynamicNode> tests() {
+ return SOAPDOMTestSuite.create(new
OMDOMMetaFactoryLoader().load(null)).toDynamicNodes();
}
}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/SOAPDOMTestSuite.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/SOAPDOMTestSuite.java
new file mode 100644
index 000000000..21085dd00
--- /dev/null
+++
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/SOAPDOMTestSuite.java
@@ -0,0 +1,49 @@
+/*
+ * 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.soapdom;
+
+import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.dom.DOMMetaFactory;
+import org.apache.axiom.testing.multiton.Multiton;
+import org.apache.axiom.testutils.suite.FanOutNode;
+import org.apache.axiom.testutils.suite.InjectorNode;
+import org.apache.axiom.testutils.suite.MatrixTest;
+import org.apache.axiom.testutils.suite.ParentNode;
+import org.apache.axiom.ts.soap.SOAPSpec;
+
+public class SOAPDOMTestSuite {
+ public static InjectorNode create(DOMMetaFactory metaFactory) {
+ return new InjectorNode(
+ binder ->
binder.bind(OMMetaFactory.class).toInstance(metaFactory),
+ new FanOutNode<>(
+ Multiton.getInstances(SOAPSpec.class),
+ (binder, value) ->
binder.bind(SOAPSpec.class).toInstance(value),
+ (params, value) -> params.addTestParameter("spec",
value.getName()),
+ new ParentNode(
+ new MatrixTest(
+ org.apache.axiom.ts.soapdom.header
+
.TestExamineAllHeaderBlocks.class),
+ new MatrixTest(
+ org.apache.axiom.ts.soapdom.header
+
.TestExamineMustUnderstandHeaderBlocks.class),
+ new MatrixTest(
+ org.apache.axiom.ts.soapdom.message
+
.TestLazySOAPFactorySelection.class))));
+ }
+}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/SOAPDOMTestSuiteBuilder.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/SOAPDOMTestSuiteBuilder.java
deleted file mode 100644
index 379fbe147..000000000
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/SOAPDOMTestSuiteBuilder.java
+++ /dev/null
@@ -1,49 +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.soapdom;
-
-import org.apache.axiom.om.dom.DOMMetaFactory;
-import org.apache.axiom.testutils.suite.MatrixTestSuiteBuilder;
-import org.apache.axiom.ts.soap.SOAPSpec;
-
-public class SOAPDOMTestSuiteBuilder extends MatrixTestSuiteBuilder {
- private final DOMMetaFactory metaFactory;
-
- public SOAPDOMTestSuiteBuilder(DOMMetaFactory metaFactory) {
- this.metaFactory = metaFactory;
- }
-
- @Override
- protected void addTests() {
- addTests(SOAPSpec.SOAP11);
- addTests(SOAPSpec.SOAP12);
- }
-
- private void addTests(SOAPSpec spec) {
- addTest(
- new
org.apache.axiom.ts.soapdom.header.TestExamineAllHeaderBlocks(
- metaFactory, spec));
- addTest(
- new
org.apache.axiom.ts.soapdom.header.TestExamineMustUnderstandHeaderBlocks(
- metaFactory, spec));
- addTest(
- new
org.apache.axiom.ts.soapdom.message.TestLazySOAPFactorySelection(
- metaFactory, spec));
- }
-}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/header/TestExamineAllHeaderBlocks.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/header/TestExamineAllHeaderBlocks.java
index 0fc00bc26..a0e2dd912 100644
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/header/TestExamineAllHeaderBlocks.java
+++
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/header/TestExamineAllHeaderBlocks.java
@@ -33,12 +33,15 @@ import org.apache.axiom.ts.soap.SOAPTestCase;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import com.google.inject.Inject;
+
/**
* Tests that child elements of a {@link SOAPHeader} created using the DOM API
are converted on the
* fly and returned as {@link SOAPHeaderBlock} instances by {@link
* SOAPHeader#examineAllHeaderBlocks()}.
*/
public class TestExamineAllHeaderBlocks extends SOAPTestCase {
+ @Inject
public TestExamineAllHeaderBlocks(OMMetaFactory metaFactory, SOAPSpec
spec) {
super(metaFactory, spec);
}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/header/TestExamineMustUnderstandHeaderBlocks.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/header/TestExamineMustUnderstandHeaderBlocks.java
index e9363fd1c..dbc9aa049 100644
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/header/TestExamineMustUnderstandHeaderBlocks.java
+++
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/header/TestExamineMustUnderstandHeaderBlocks.java
@@ -33,7 +33,10 @@ import org.apache.axiom.ts.soap.SOAPTestCase;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
+import com.google.inject.Inject;
+
public class TestExamineMustUnderstandHeaderBlocks extends SOAPTestCase {
+ @Inject
public TestExamineMustUnderstandHeaderBlocks(OMMetaFactory metaFactory,
SOAPSpec spec) {
super(metaFactory, spec);
}
diff --git
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/message/TestLazySOAPFactorySelection.java
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/message/TestLazySOAPFactorySelection.java
index c9e7fa7f0..3742c75a0 100644
---
a/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/message/TestLazySOAPFactorySelection.java
+++
b/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/soapdom/message/TestLazySOAPFactorySelection.java
@@ -26,7 +26,10 @@ import org.apache.axiom.ts.soap.SOAPTestCase;
import org.apache.axiom.ts.soap.SOAPSampleSet;
import org.w3c.dom.Document;
+import com.google.inject.Inject;
+
public class TestLazySOAPFactorySelection extends SOAPTestCase {
+ @Inject
public TestLazySOAPFactorySelection(OMMetaFactory metaFactory, SOAPSpec
spec) {
super(metaFactory, spec);
}