TestedOnSupplier
public abstract class ParameterSupplier extends Object
Theories
runner
finds accepted data points. Then use your class together with @ParametersSuppliedBy on input
parameters for theories.
For example, here is a supplier for values between two integers, and an annotation that references it:
@Retention(RetentionPolicy.RUNTIME) @ParametersSuppliedBy(BetweenSupplier.class) public @interface Between { int first(); int last(); } public static class BetweenSupplier extends ParameterSupplier { @Override public List<PotentialAssignment> getValueSources(ParameterSignature sig) { List<PotentialAssignment> list = new ArrayList<PotentialAssignment>(); Between annotation = (Between) sig.getSupplierAnnotation(); for (int i = annotation.first(); i <= annotation.last(); i++) list.add(PotentialAssignment.forValue("ints", i)); return list; } }
ParametersSuppliedBy
,
Theories
,
FromDataPoints
Constructor | Description |
---|---|
ParameterSupplier() |
Modifier and Type | Method | Description |
---|---|---|
abstract List<PotentialAssignment> |
getValueSources(ParameterSignature sig) |
public ParameterSupplier()
public abstract List<PotentialAssignment> getValueSources(ParameterSignature sig) throws Throwable
Throwable
Copyright © 2002–2018 JUnit. All rights reserved.