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

Further simplify unused parts of AbstractParseModuleTest

parent dedd7310
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,6 @@ package de.tla2b.util;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import de.tla2b.util.PolySuite.Configuration;
......@@ -10,16 +9,7 @@ import de.tla2b.util.PolySuite.Configuration;
public abstract class AbstractParseModuleTest {
private static final String TLA_SUFFIX = ".tla";
protected static File[] getModules(String path) {
final File dir = new File(path);
return dir.listFiles((d, name) -> name.endsWith(TLA_SUFFIX));
}
protected static File[] getModulesRecursively(String path) {
return walk(path).toArray(new File[0]);
}
private static ArrayList<File> walk(String path) {
protected static ArrayList<File> getModulesRecursively(String path) {
File root = new File(path);
File[] list = root.listFiles();
......@@ -29,7 +19,7 @@ public abstract class AbstractParseModuleTest {
for (File f : list) {
if (f.isDirectory()) {
files.addAll(walk(f.getAbsolutePath()));
files.addAll(getModulesRecursively(f.getAbsolutePath()));
} else if (f.getName().endsWith(TLA_SUFFIX)) {
files.add(f);
}
......@@ -38,12 +28,7 @@ public abstract class AbstractParseModuleTest {
}
protected static Configuration getConfiguration2(String path) {
final ArrayList<Object> expectedValues = new ArrayList<Object>();
File[] modules = getModulesRecursively(path);
final ArrayList<File> allModules = new ArrayList<File>(Arrays.asList(modules));
for (int i = 0; i < modules.length; i++) {
expectedValues.add(1);
}
final ArrayList<File> allModules = getModulesRecursively(path);
return new Configuration() {
public int size() {
......@@ -59,7 +44,7 @@ public abstract class AbstractParseModuleTest {
}
public Object getExpectedValue(int index) {
return expectedValues.get(index);
return 1;
}
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment