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 b522f06c6 Add convenience constructors for the single-child case
b522f06c6 is described below

commit b522f06c6f3aa37f61871e0de904f94767a1cc14
Author: Andreas Veithen-Knowles <[email protected]>
AuthorDate: Sat Mar 7 21:11:13 2026 +0000

    Add convenience constructors for the single-child case
---
 .../axiom/testutils/suite/DimensionFanOutNode.java | 12 +++++++++++
 .../apache/axiom/testutils/suite/InjectorNode.java | 20 +++++++++++++++++
 .../axiom/testutils/suite/ParameterFanOutNode.java | 18 ++++++++++++++++
 .../org/apache/axiom/ts/saaj/SAAJTestSuite.java    | 25 ++++++++--------------
 4 files changed, 59 insertions(+), 16 deletions(-)

diff --git 
a/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/DimensionFanOutNode.java
 
b/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/DimensionFanOutNode.java
index 83994dc30..a5a3f4fe6 100644
--- 
a/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/DimensionFanOutNode.java
+++ 
b/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/DimensionFanOutNode.java
@@ -40,6 +40,18 @@ public class DimensionFanOutNode<D extends Dimension> 
extends AbstractFanOutNode
         super(dimensionType, dimensions, children);
     }
 
+    /**
+     * Convenience constructor for the case of a single child.
+     *
+     * @param dimensionType the dimension type
+     * @param dimensions the dimension values to fan out over
+     * @param child the single child node
+     */
+    public DimensionFanOutNode(
+            Class<D> dimensionType, ImmutableList<D> dimensions, 
MatrixTestNode child) {
+        this(dimensionType, dimensions, ImmutableList.of(child));
+    }
+
     @Override
     protected Map<String, String> extractParameters(D dimension) {
         Map<String, String> parameters = new LinkedHashMap<>();
diff --git 
a/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/InjectorNode.java
 
b/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/InjectorNode.java
index 927519536..aa398676b 100644
--- 
a/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/InjectorNode.java
+++ 
b/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/InjectorNode.java
@@ -60,6 +60,26 @@ public class InjectorNode extends ParentNode {
         this(ImmutableList.of(module), children);
     }
 
+    /**
+     * Convenience constructor for the case of a single child.
+     *
+     * @param modules the Guice modules to install when creating the child 
injector
+     * @param child the single child node of this node
+     */
+    public InjectorNode(ImmutableList<Module> modules, MatrixTestNode child) {
+        this(modules, ImmutableList.of(child));
+    }
+
+    /**
+     * Convenience constructor for the case of a single module and a single 
child.
+     *
+     * @param module the Guice module to install when creating the child 
injector
+     * @param child the single child node of this node
+     */
+    public InjectorNode(Module module, MatrixTestNode child) {
+        this(ImmutableList.of(module), ImmutableList.of(child));
+    }
+
     @Override
     Stream<DynamicNode> toDynamicNodes(
             Injector parentInjector,
diff --git 
a/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/ParameterFanOutNode.java
 
b/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/ParameterFanOutNode.java
index 23d92059e..b57e80b87 100644
--- 
a/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/ParameterFanOutNode.java
+++ 
b/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/ParameterFanOutNode.java
@@ -45,6 +45,24 @@ public class ParameterFanOutNode<T> extends 
AbstractFanOutNode<T> {
         this.parameterValueFunction = parameterValueFunction;
     }
 
+    /**
+     * Convenience constructor for the case of a single child.
+     *
+     * @param type the value type
+     * @param values the values to fan out over
+     * @param parameterName the parameter name
+     * @param parameterValueFunction maps each value to its parameter value 
string
+     * @param child the single child node
+     */
+    public ParameterFanOutNode(
+            Class<T> type,
+            ImmutableList<T> values,
+            String parameterName,
+            Function<T, String> parameterValueFunction,
+            MatrixTestNode child) {
+        this(type, values, parameterName, parameterValueFunction, 
ImmutableList.of(child));
+    }
+
     @Override
     protected Map<String, String> extractParameters(T value) {
         return Map.of(parameterName, parameterValueFunction.apply(value));
diff --git 
a/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/SAAJTestSuite.java
 
b/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/SAAJTestSuite.java
index 37f700eee..6b39abc3f 100644
--- 
a/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/SAAJTestSuite.java
+++ 
b/testing/saaj-testsuite/src/main/java/org/apache/axiom/ts/saaj/SAAJTestSuite.java
@@ -37,9 +37,14 @@ import com.google.inject.AbstractModule;
 
 public class SAAJTestSuite {
     public static InjectorNode create(SAAJMetaFactory metaFactory) {
-        SAAJImplementation impl = new SAAJImplementation(metaFactory);
-
-        ParameterFanOutNode<SOAPSpec> specs =
+        return new InjectorNode(
+                new AbstractModule() {
+                    @Override
+                    protected void configure() {
+                        bind(SAAJImplementation.class)
+                                .toInstance(new 
SAAJImplementation(metaFactory));
+                    }
+                },
                 new ParameterFanOutNode<>(
                         SOAPSpec.class,
                         Multiton.getInstances(SOAPSpec.class),
@@ -51,18 +56,6 @@ public class SAAJTestSuite {
                                 new 
MatrixTest(TestAddChildElementLocalName.class),
                                 new 
MatrixTest(TestAddChildElementLocalNamePrefixAndURI.class),
                                 new MatrixTest(TestSetParentElement.class),
-                                new MatrixTest(TestGetOwnerDocument.class)));
-
-        InjectorNode suite =
-                new InjectorNode(
-                        new AbstractModule() {
-                            @Override
-                            protected void configure() {
-                                
bind(SAAJImplementation.class).toInstance(impl);
-                            }
-                        },
-                        ImmutableList.of(specs));
-
-        return suite;
+                                new MatrixTest(TestGetOwnerDocument.class))));
     }
 }

Reply via email to