aboutsummaryrefslogtreecommitdiff
path: root/test/transform/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-07-21 23:52:28 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-07-21 23:52:28 +0200
commit59e585a0c68959eb72be34524bdad19df5dc8a4d (patch)
tree72860f9fce0a62bb1d0e8dbe3a021f4bd8f20ab4 /test/transform/src
parent1a9f8f168aa17f77c6e27d0a740b5f7614fb5c90 (diff)
downloadlombok-59e585a0c68959eb72be34524bdad19df5dc8a4d.tar.gz
lombok-59e585a0c68959eb72be34524bdad19df5dc8a4d.tar.bz2
lombok-59e585a0c68959eb72be34524bdad19df5dc8a4d.zip
refactored the tests to prepare running ecj as well as delombok.
Diffstat (limited to 'test/transform/src')
-rw-r--r--test/transform/src/lombok/transform/TestLombokFilesIdempotent.java56
-rw-r--r--test/transform/src/lombok/transform/TestSourceFiles.java52
-rw-r--r--test/transform/src/lombok/transform/TestWithDelombok.java56
3 files changed, 164 insertions, 0 deletions
diff --git a/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java b/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java
new file mode 100644
index 00000000..63d34820
--- /dev/null
+++ b/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright © 2009-2010 Reinier Zwitserloot and Roel Spilker.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package lombok.transform;
+
+import java.io.File;
+
+import lombok.DirectoryRunner;
+
+import org.junit.runner.RunWith;
+
+@RunWith(DirectoryRunner.class)
+public class TestLombokFilesIdempotent implements DirectoryRunner.TestParams {
+ @Override
+ public File getBeforeDirectory() {
+ return getAfterDirectory();
+ }
+
+ @Override
+ public File getAfterDirectory() {
+ return new File("test/transform/resource/after-delombok");
+ }
+
+ @Override
+ public DirectoryRunner.Compiler getCompiler() {
+ return DirectoryRunner.Compiler.DELOMBOK;
+ }
+
+ @Override
+ public boolean printErrors() {
+ return true;
+ }
+
+ @Override
+ public File getMessagesDirectory() {
+ return null;
+ }
+}
diff --git a/test/transform/src/lombok/transform/TestSourceFiles.java b/test/transform/src/lombok/transform/TestSourceFiles.java
new file mode 100644
index 00000000..7bcaa1f7
--- /dev/null
+++ b/test/transform/src/lombok/transform/TestSourceFiles.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright © 2009-2010 Reinier Zwitserloot and Roel Spilker.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package lombok.transform;
+
+import java.io.File;
+
+import lombok.DirectoryRunner;
+
+import org.junit.runner.RunWith;
+
+@RunWith(DirectoryRunner.class)
+public class TestSourceFiles implements DirectoryRunner.TestParams {
+ public DirectoryRunner.Compiler getCompiler() {
+ return DirectoryRunner.Compiler.DELOMBOK;
+ }
+
+ public boolean printErrors() {
+ return true;
+ }
+
+ public File getBeforeDirectory() {
+ return new File("test/pretty/resource/before");
+ }
+
+ public File getAfterDirectory() {
+ return new File("test/pretty/resource/after");
+ }
+
+ @Override
+ public File getMessagesDirectory() {
+ return null;
+ }
+}
diff --git a/test/transform/src/lombok/transform/TestWithDelombok.java b/test/transform/src/lombok/transform/TestWithDelombok.java
new file mode 100644
index 00000000..b4ee6793
--- /dev/null
+++ b/test/transform/src/lombok/transform/TestWithDelombok.java
@@ -0,0 +1,56 @@
+/*
+ * Copyright © 2009-2010 Reinier Zwitserloot and Roel Spilker.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+package lombok.transform;
+
+import java.io.File;
+
+import lombok.DirectoryRunner;
+
+import org.junit.runner.RunWith;
+
+@RunWith(DirectoryRunner.class)
+public class TestWithDelombok implements DirectoryRunner.TestParams {
+ @Override
+ public DirectoryRunner.Compiler getCompiler() {
+ return DirectoryRunner.Compiler.DELOMBOK;
+ }
+
+ @Override
+ public boolean printErrors() {
+ return true;
+ }
+
+ @Override
+ public File getBeforeDirectory() {
+ return new File("test/transform/resource/before");
+ }
+
+ @Override
+ public File getAfterDirectory() {
+ return new File("test/transform/resource/after-delombok");
+ }
+
+ @Override
+ public File getMessagesDirectory() {
+ return new File("test/transform/resource/messages-delombok");
+ }
+}