diff options
author | Roel Spilker <r.spilker@gmail.com> | 2009-11-28 22:50:44 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2009-11-28 22:50:44 +0100 |
commit | 6d9bc684692a6bbef5a960a113af834ce8a16447 (patch) | |
tree | 852399c38bd9387e5da10ae3655504092f3ea975 /test/delombok | |
parent | c1ec2b5edbe6172bb0a031700bf928cd2950bac0 (diff) | |
download | lombok-6d9bc684692a6bbef5a960a113af834ce8a16447.tar.gz lombok-6d9bc684692a6bbef5a960a113af834ce8a16447.tar.bz2 lombok-6d9bc684692a6bbef5a960a113af834ce8a16447.zip |
Use new DirectoryRunner to run tests on all files in a directory
Diffstat (limited to 'test/delombok')
-rw-r--r-- | test/delombok/src/lombok/delombok/TestLombokFiles.java | 16 | ||||
-rw-r--r-- | test/delombok/src/lombok/delombok/TestSourceFiles.java | 38 |
2 files changed, 19 insertions, 35 deletions
diff --git a/test/delombok/src/lombok/delombok/TestLombokFiles.java b/test/delombok/src/lombok/delombok/TestLombokFiles.java index 1d93a4b2..66e3580e 100644 --- a/test/delombok/src/lombok/delombok/TestLombokFiles.java +++ b/test/delombok/src/lombok/delombok/TestLombokFiles.java @@ -23,16 +23,20 @@ package lombok.delombok; import java.io.File; +import lombok.DirectoryRunner; import lombok.TestViaDelombok; -import org.junit.Test; +import org.junit.runner.RunWith; +@RunWith(DirectoryRunner.class) public class TestLombokFiles { - private static final File BEFORE_DIR = new File("test/lombok/resource/before"); - private static final File AFTER_DIR = new File("test/lombok/resource/after"); - @Test - public void testSources() throws Exception { - TestViaDelombok.runComparison(BEFORE_DIR, AFTER_DIR); + public static File getBeforeDirectory() { + TestViaDelombok.printErrors(true); + return new File("test/lombok/resource/before"); + } + + public static File getAfterDirectory() { + return new File("test/lombok/resource/after"); } } diff --git a/test/delombok/src/lombok/delombok/TestSourceFiles.java b/test/delombok/src/lombok/delombok/TestSourceFiles.java index fc2a9cab..2c0085eb 100644 --- a/test/delombok/src/lombok/delombok/TestSourceFiles.java +++ b/test/delombok/src/lombok/delombok/TestSourceFiles.java @@ -21,39 +21,19 @@ */ package lombok.delombok; -import lombok.ReflectionFileTester; +import java.io.File; -import org.junit.BeforeClass; -import org.junit.Test; +import lombok.DirectoryRunner; +import org.junit.runner.RunWith; + +@RunWith(DirectoryRunner.class) public class TestSourceFiles { - private static final String AFTER = "test/delombok/resource/after"; - private static final String BEFORE = "test/delombok/resource/before"; - - private static final ReflectionFileTester tester = new ReflectionFileTester(BEFORE, AFTER); - - @BeforeClass - public static void verify() { - tester.verify(TestSourceFiles.class); - } - - @Test - public void testAnnotation() throws Exception { - tester.test(); - } - - @Test - public void testCast() throws Exception { - tester.test(); - } - - @Test - public void testForLoop() throws Exception { - tester.test(); + public static File getBeforeDirectory() { + return new File("test/delombok/resource/before"); } - @Test - public void testWithComments() throws Exception { - tester.test(); + public static File getAfterDirectory() { + return new File("test/delombok/resource/after"); } } |