aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2009-11-29 01:19:14 +0100
committerRoel Spilker <r.spilker@gmail.com>2009-11-29 01:19:14 +0100
commitf0585f4ed491eb455fe9484c735365463ae4184e (patch)
treea6d6a33bf57c02a2da0f136e0df72990b326a463
parentbe20f7a1180e4aa3d699d89c756c0c07e2eba1a7 (diff)
downloadlombok-f0585f4ed491eb455fe9484c735365463ae4184e.tar.gz
lombok-f0585f4ed491eb455fe9484c735365463ae4184e.tar.bz2
lombok-f0585f4ed491eb455fe9484c735365463ae4184e.zip
Can now mark test files as Ignored
-rw-r--r--test/core/src/lombok/DirectoryRunner.java24
-rw-r--r--test/lombok/resource/before/CleanupPlain.java1
-rw-r--r--test/lombok/resource/before/SetterPlain.java1
3 files changed, 23 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);
}
}
diff --git a/test/lombok/resource/before/CleanupPlain.java b/test/lombok/resource/before/CleanupPlain.java
index f463b152..6cf09062 100644
--- a/test/lombok/resource/before/CleanupPlain.java
+++ b/test/lombok/resource/before/CleanupPlain.java
@@ -1,3 +1,4 @@
+//ignore
import lombok.Cleanup;
import java.io.*;
class Cleanup {
diff --git a/test/lombok/resource/before/SetterPlain.java b/test/lombok/resource/before/SetterPlain.java
index 482b5e05..85d3aad5 100644
--- a/test/lombok/resource/before/SetterPlain.java
+++ b/test/lombok/resource/before/SetterPlain.java
@@ -1,3 +1,4 @@
+//ignore
import lombok.Setter;
class Setter {
@lombok.Setter int i;