org.junit.experimental.theories.suppliers.TestedOnSupplier Maven / Gradle / Ivy
Go to download
JUnit is a regression testing framework written by Erich Gamma and Kent Beck.
It is used by the developer who implements unit tests in Java.
package org.junit.experimental.theories.suppliers;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.junit.experimental.theories.ParameterSignature;
import org.junit.experimental.theories.ParameterSupplier;
import org.junit.experimental.theories.PotentialAssignment;
public class TestedOnSupplier extends ParameterSupplier {
@Override public List getValueSources(ParameterSignature sig) {
List list = new ArrayList();
TestedOn testedOn = sig.getAnnotation(TestedOn.class);
int[] ints = testedOn.ints();
for (final int i : ints) {
list.add(PotentialAssignment.forValue(Arrays.asList(ints).toString(), i));
}
return list;
}
}