aboutsummaryrefslogtreecommitdiff
path: root/test/core/src/lombok/DirectoryRunner.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/core/src/lombok/DirectoryRunner.java')
-rw-r--r--test/core/src/lombok/DirectoryRunner.java11
1 files changed, 9 insertions, 2 deletions
diff --git a/test/core/src/lombok/DirectoryRunner.java b/test/core/src/lombok/DirectoryRunner.java
index 1c8cfb2e..db474ff0 100644
--- a/test/core/src/lombok/DirectoryRunner.java
+++ b/test/core/src/lombok/DirectoryRunner.java
@@ -2,6 +2,7 @@ package lombok;
import java.io.BufferedReader;
import java.io.File;
+import java.io.FileFilter;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
@@ -16,6 +17,12 @@ import org.junit.runner.notification.RunNotifier;
public class DirectoryRunner extends Runner {
+ private static final FileFilter JAVA_FILE_FILTER = new FileFilter() {
+ @Override public boolean accept(File file) {
+ return file.isFile() && file.getName().endsWith(".java");
+ }
+ };
+
private final Description description;
private final Map<String, Description> tests = new TreeMap<String, Description>();
private final Throwable failure;
@@ -41,7 +48,7 @@ public class DirectoryRunner extends Runner {
Method afterMethod = testClass.getDeclaredMethod("getAfterDirectory");
afterDirectory = (File) afterMethod.invoke(null);
- for (File file : beforeDirectory.listFiles()) {
+ for (File file : beforeDirectory.listFiles(JAVA_FILE_FILTER)) {
Description testDescription = Description.createTestDescription(testClass, file.getName());
description.addChild(testDescription);
tests.put(file.getName(), testDescription);
@@ -82,7 +89,7 @@ public class DirectoryRunner extends Runner {
if (mustIgnore(file)) {
return false;
}
- RunTestsViaDelombok.compareFile(afterDirectory, file);
+ RunTestsViaDelombok.compareFile(beforeDirectory, afterDirectory, file);
return true;
}