aboutsummaryrefslogtreecommitdiff
path: root/test/core/src/lombok/DirectoryRunner.java
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2010-07-20 23:51:47 +0200
committerRoel Spilker <r.spilker@gmail.com>2010-07-20 23:51:47 +0200
commitced6843970d270d5edce04f885cf4625cb0a9d86 (patch)
treece10f5b83731810e94baccedba8315a573c6d39f /test/core/src/lombok/DirectoryRunner.java
parent58f5f68f0534503281d0be5aff408b1d183096c7 (diff)
downloadlombok-ced6843970d270d5edce04f885cf4625cb0a9d86.tar.gz
lombok-ced6843970d270d5edce04f885cf4625cb0a9d86.tar.bz2
lombok-ced6843970d270d5edce04f885cf4625cb0a9d86.zip
Added support for checking compiler messages (errors & warnings)
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;
}