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 db8efcfaf Generalize FanOutNode to derive values from the parent
injector
db8efcfaf is described below
commit db8efcfaf2ebe5fa8954eee1fbe5dcbf4560d38b
Author: Andreas Veithen-Knowles <[email protected]>
AuthorDate: Sat Mar 21 18:17:54 2026 +0000
Generalize FanOutNode to derive values from the parent injector
Add a new constructor that accepts Function<Injector, ? extends Iterable<T>>
so values can be computed lazily from the parent injector at tree-expansion
time. The existing ImmutableList<T> constructor is kept as a convenience
delegate for backward compatibility.
---
.../org/apache/axiom/testutils/suite/FanOutNode.java | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git
a/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/FanOutNode.java
b/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/FanOutNode.java
index 4e786740e..9b0aa37b4 100644
---
a/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/FanOutNode.java
+++
b/testing/matrix-testsuite/src/main/java/org/apache/axiom/testutils/suite/FanOutNode.java
@@ -21,8 +21,10 @@ package org.apache.axiom.testutils.suite;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiPredicate;
+import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
import org.junit.jupiter.api.DynamicContainer;
import org.junit.jupiter.api.DynamicNode;
@@ -38,28 +40,36 @@ import com.google.inject.Injector;
* @param <T> the value type
*/
public final class FanOutNode<T> extends MatrixTestNode {
- private final ImmutableList<T> values;
+ private final Function<Injector, ? extends Iterable<T>> valuesFunction;
private final Binding<T> binding;
private final ParameterBinding<? super T> parameterBinding;
private final MatrixTestNode child;
public FanOutNode(
- ImmutableList<T> values,
+ Function<Injector, ? extends Iterable<T>> valuesFunction,
Binding<T> binding,
ParameterBinding<? super T> parameterBinding,
MatrixTestNode child) {
- this.values = values;
+ this.valuesFunction = valuesFunction;
this.binding = binding;
this.parameterBinding = parameterBinding;
this.child = child;
}
+ public FanOutNode(
+ ImmutableList<T> values,
+ Binding<T> binding,
+ ParameterBinding<? super T> parameterBinding,
+ MatrixTestNode child) {
+ this(injector -> values, binding, parameterBinding, child);
+ }
+
@Override
Stream<DynamicNode> toDynamicNodes(
Injector parentInjector,
Map<String, String> inheritedParameters,
BiPredicate<Class<?>, Map<String, String>> excludes) {
- return values.stream()
+ return
StreamSupport.stream(valuesFunction.apply(parentInjector).spliterator(), false)
.map(
value -> {
Injector childInjector =