diff options
author | Roel Spilker <r.spilker@gmail.com> | 2009-11-29 01:19:14 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2009-11-29 01:19:14 +0100 |
commit | f0585f4ed491eb455fe9484c735365463ae4184e (patch) | |
tree | a6d6a33bf57c02a2da0f136e0df72990b326a463 /test/core | |
parent | be20f7a1180e4aa3d699d89c756c0c07e2eba1a7 (diff) | |
download | lombok-f0585f4ed491eb455fe9484c735365463ae4184e.tar.gz lombok-f0585f4ed491eb455fe9484c735365463ae4184e.tar.bz2 lombok-f0585f4ed491eb455fe9484c735365463ae4184e.zip |
Can now mark test files as Ignored
Diffstat (limited to 'test/core')
-rw-r--r-- | test/core/src/lombok/DirectoryRunner.java | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/test/core/src/lombok/DirectoryRunner.java b/test/core/src/lombok/DirectoryRunner.java index 9905df04..40b21aa0 100644 --- a/test/core/src/lombok/DirectoryRunner.java +++ b/test/core/src/lombok/DirectoryRunner.java @@ -1,6 +1,10 @@ package lombok; +import java.io.BufferedReader; import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.IOException; import java.lang.reflect.Method; import java.util.Map; import java.util.TreeMap; @@ -62,7 +66,9 @@ public class DirectoryRunner extends Runner { Description testDescription = entry.getValue(); notifier.fireTestStarted(testDescription); try { - runTest(entry.getKey()); + if (!runTest(entry.getKey())) { + notifier.fireTestIgnored(testDescription); + } } catch (Throwable t) { notifier.fireTestFailure(new Failure(testDescription, t)); @@ -71,7 +77,19 @@ public class DirectoryRunner extends Runner { } } - private void runTest(String fileName) throws Throwable { - TestViaDelombok.compareFile(afterDirectory, new File(beforeDirectory, fileName)); + private boolean runTest(String fileName) throws Throwable { + File file = new File(beforeDirectory, fileName); + if (mustIgnore(file)) { + return false; + } + TestViaDelombok.compareFile(afterDirectory, file); + return true; + } + + private boolean mustIgnore(File file) throws FileNotFoundException, IOException { + BufferedReader reader = new BufferedReader(new FileReader(file)); + String line = reader.readLine(); + reader.close(); + return "//ignore".equals(line); } } |