Skip to content
Snippets Groups Projects
Commit d9cc292e authored by dgelessus's avatar dgelessus
Browse files

Simplify AbstractParseMachineTest expected value handling further

parent 24d7790c
No related branches found
No related tags found
No related merge requests found
...@@ -39,13 +39,8 @@ public abstract class AbstractParseMachineTest { ...@@ -39,13 +39,8 @@ public abstract class AbstractParseMachineTest {
protected static Configuration getConfiguration2(List<String> list) { protected static Configuration getConfiguration2(List<String> list) {
List<File> allMachines = new ArrayList<>(); List<File> allMachines = new ArrayList<>();
List<TLCResult> expectedValues = new ArrayList<>();
for (String path : list) { for (String path : list) {
List<File> machines = getMachinesRecursively(path); allMachines.addAll(getMachinesRecursively(path));
allMachines.addAll(machines);
for (int i = 0; i < machines.size(); i++) {
expectedValues.add(TLCResult.NoError);
}
} }
return new Configuration() { return new Configuration() {
...@@ -62,7 +57,7 @@ public abstract class AbstractParseMachineTest { ...@@ -62,7 +57,7 @@ public abstract class AbstractParseMachineTest {
} }
public TLCResult getExpectedValue(int index) { public TLCResult getExpectedValue(int index) {
return expectedValues.get(index); return TLCResult.NoError;
} }
}; };
} }
...@@ -70,13 +65,8 @@ public abstract class AbstractParseMachineTest { ...@@ -70,13 +65,8 @@ public abstract class AbstractParseMachineTest {
protected static Configuration getConfiguration(List<String> list, TLCResult expectedResult) { protected static Configuration getConfiguration(List<String> list, TLCResult expectedResult) {
List<File> allMachines = new ArrayList<>(); List<File> allMachines = new ArrayList<>();
List<TLCResult> expectedValues = new ArrayList<>();
for (String path : list) { for (String path : list) {
File[] machines = getMachines(path); allMachines.addAll(Arrays.asList(getMachines(path)));
allMachines.addAll(Arrays.asList(machines));
for (int i = 0; i < machines.length; i++) {
expectedValues.add(expectedResult);
}
} }
return new Configuration() { return new Configuration() {
...@@ -93,7 +83,7 @@ public abstract class AbstractParseMachineTest { ...@@ -93,7 +83,7 @@ public abstract class AbstractParseMachineTest {
} }
public TLCResult getExpectedValue(int index) { public TLCResult getExpectedValue(int index) {
return expectedValues.get(index); return expectedResult;
} }
}; };
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment