1b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotpackage org.junit.experimental.theories.suppliers;
2b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot
3b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.util.ArrayList;
4b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.util.Arrays;
5b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.util.List;
6b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot
7b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport org.junit.experimental.theories.ParameterSignature;
8b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport org.junit.experimental.theories.ParameterSupplier;
9b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport org.junit.experimental.theories.PotentialAssignment;
10b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot
11b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot
12b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot
13b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotpublic class TestedOnSupplier extends ParameterSupplier {
14b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot	@Override public List<PotentialAssignment> getValueSources(ParameterSignature sig) {
15b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot		List<PotentialAssignment> list = new ArrayList<PotentialAssignment>();
16b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot		TestedOn testedOn = sig.getAnnotation(TestedOn.class);
17b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot		int[] ints = testedOn.ints();
18b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot		for (final int i : ints) {
19b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot			list.add(PotentialAssignment.forValue(Arrays.asList(ints).toString(), i));
20b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot		}
21b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot		return list;
22b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot	}
23b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot}
24