From 9eb70cb3e2043b5262e686b4a80da36e5aa88d81 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Tue, 17 Nov 2015 00:03:33 +0100 Subject: add the capability to the testing framework to verify that delombok actually also handles the changed flag correctly --- test/transform/resource/after-ecj/LoggerSlf4jOnNonType.java | 7 ------- test/transform/resource/before/JavadocGenerally.java | 1 + test/transform/resource/before/TestOperators.java | 1 + test/transform/resource/before/TrickyTypeResolution2.java | 1 + test/transform/resource/before/ValErrors.java | 1 + test/transform/resource/before/ValInBasicFor.java | 1 + test/transform/resource/before/WithInnerAnnotation.java | 1 + test/transform/resource/messages-delombok/ValErrors.java.messages | 4 ++-- .../resource/messages-delombok/ValInBasicFor.java.messages | 2 +- test/transform/resource/messages-ecj/ValErrors.java.messages | 4 ++-- test/transform/resource/messages-ecj/ValInBasicFor.java.messages | 4 ++-- test/transform/src/lombok/transform/TestLombokFilesIdempotent.java | 7 ++++++- test/transform/src/lombok/transform/TestSourceFiles.java | 7 ++++++- test/transform/src/lombok/transform/TestWithDelombok.java | 7 ++++++- test/transform/src/lombok/transform/TestWithEcj.java | 7 ++++++- 15 files changed, 37 insertions(+), 18 deletions(-) delete mode 100644 test/transform/resource/after-ecj/LoggerSlf4jOnNonType.java (limited to 'test/transform') diff --git a/test/transform/resource/after-ecj/LoggerSlf4jOnNonType.java b/test/transform/resource/after-ecj/LoggerSlf4jOnNonType.java deleted file mode 100644 index f0c2ee58..00000000 --- a/test/transform/resource/after-ecj/LoggerSlf4jOnNonType.java +++ /dev/null @@ -1,7 +0,0 @@ -class LoggerSlf4jOnNonType { - LoggerSlf4jOnNonType() { - super(); - } - @lombok.extern.slf4j.Slf4j void foo() { - } -} \ No newline at end of file diff --git a/test/transform/resource/before/JavadocGenerally.java b/test/transform/resource/before/JavadocGenerally.java index ee015acf..e47de44d 100644 --- a/test/transform/resource/before/JavadocGenerally.java +++ b/test/transform/resource/before/JavadocGenerally.java @@ -1,3 +1,4 @@ +// unchanged /** * Doc on package */ diff --git a/test/transform/resource/before/TestOperators.java b/test/transform/resource/before/TestOperators.java index 566bedfc..de384122 100644 --- a/test/transform/resource/before/TestOperators.java +++ b/test/transform/resource/before/TestOperators.java @@ -1,3 +1,4 @@ +// unchanged class TestOperators { int x = 10; public void test() { diff --git a/test/transform/resource/before/TrickyTypeResolution2.java b/test/transform/resource/before/TrickyTypeResolution2.java index 00f2ac39..6dfddee0 100644 --- a/test/transform/resource/before/TrickyTypeResolution2.java +++ b/test/transform/resource/before/TrickyTypeResolution2.java @@ -1,3 +1,4 @@ +// unchanged import lombok.*; class DoNothingDueToTopLevel { void test() { diff --git a/test/transform/resource/before/ValErrors.java b/test/transform/resource/before/ValErrors.java index 96181638..87383719 100644 --- a/test/transform/resource/before/ValErrors.java +++ b/test/transform/resource/before/ValErrors.java @@ -1,3 +1,4 @@ +// unchanged import lombok.val; public class ValErrors { diff --git a/test/transform/resource/before/ValInBasicFor.java b/test/transform/resource/before/ValInBasicFor.java index 1f132b8f..a109bcd3 100644 --- a/test/transform/resource/before/ValInBasicFor.java +++ b/test/transform/resource/before/ValInBasicFor.java @@ -1,3 +1,4 @@ +// unchanged import lombok.val; public class ValInBasicFor { diff --git a/test/transform/resource/before/WithInnerAnnotation.java b/test/transform/resource/before/WithInnerAnnotation.java index a8decfeb..dca1f269 100644 --- a/test/transform/resource/before/WithInnerAnnotation.java +++ b/test/transform/resource/before/WithInnerAnnotation.java @@ -1,3 +1,4 @@ +// unchanged class WithInnerAnnotation { @interface Inner { int bar() default 42; diff --git a/test/transform/resource/messages-delombok/ValErrors.java.messages b/test/transform/resource/messages-delombok/ValErrors.java.messages index bb33c6de..0777143b 100644 --- a/test/transform/resource/messages-delombok/ValErrors.java.messages +++ b/test/transform/resource/messages-delombok/ValErrors.java.messages @@ -1,2 +1,2 @@ -5 Cannot use 'val' here because initializer expression does not have a representable type: Type cannot be resolved -9 'val' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... }) +6 Cannot use 'val' here because initializer expression does not have a representable type: Type cannot be resolved +10 'val' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... }) diff --git a/test/transform/resource/messages-delombok/ValInBasicFor.java.messages b/test/transform/resource/messages-delombok/ValInBasicFor.java.messages index 7166b550..60f8f70c 100644 --- a/test/transform/resource/messages-delombok/ValInBasicFor.java.messages +++ b/test/transform/resource/messages-delombok/ValInBasicFor.java.messages @@ -1 +1 @@ -6 'val' is not allowed in old-style for loops +7 'val' is not allowed in old-style for loops diff --git a/test/transform/resource/messages-ecj/ValErrors.java.messages b/test/transform/resource/messages-ecj/ValErrors.java.messages index 6d53ddd6..c4c76901 100644 --- a/test/transform/resource/messages-ecj/ValErrors.java.messages +++ b/test/transform/resource/messages-ecj/ValErrors.java.messages @@ -1,2 +1,2 @@ -5 d cannot be resolved to a variable -9 'val' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... }) +6 d cannot be resolved to a variable +10 'val' is not compatible with array initializer expressions. Use the full form (new int[] { ... } instead of just { ... }) diff --git a/test/transform/resource/messages-ecj/ValInBasicFor.java.messages b/test/transform/resource/messages-ecj/ValInBasicFor.java.messages index c75e20f2..b32eabe4 100644 --- a/test/transform/resource/messages-ecj/ValInBasicFor.java.messages +++ b/test/transform/resource/messages-ecj/ValInBasicFor.java.messages @@ -1,2 +1,2 @@ -6 'val' is not allowed in old-style for loops -6 Type mismatch: cannot convert from int to val +7 'val' is not allowed in old-style for loops +7 Type mismatch: cannot convert from int to val diff --git a/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java b/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java index d2909943..754a4237 100644 --- a/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java +++ b/test/transform/src/lombok/transform/TestLombokFilesIdempotent.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2010 The Project Lombok Authors. + * Copyright (C) 2009-2015 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,4 +53,9 @@ public class TestLombokFilesIdempotent extends DirectoryRunner.TestParams { public boolean printErrors() { return true; } + + @Override + public boolean expectChanges() { + return false; + } } diff --git a/test/transform/src/lombok/transform/TestSourceFiles.java b/test/transform/src/lombok/transform/TestSourceFiles.java index c3ac0a68..17be133e 100644 --- a/test/transform/src/lombok/transform/TestSourceFiles.java +++ b/test/transform/src/lombok/transform/TestSourceFiles.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2010 The Project Lombok Authors. + * Copyright (C) 2009-2015 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,4 +53,9 @@ public class TestSourceFiles extends DirectoryRunner.TestParams { public File getMessagesDirectory() { return null; } + + @Override + public boolean expectChanges() { + return false; + } } diff --git a/test/transform/src/lombok/transform/TestWithDelombok.java b/test/transform/src/lombok/transform/TestWithDelombok.java index bd8d9d09..9f4cf94a 100644 --- a/test/transform/src/lombok/transform/TestWithDelombok.java +++ b/test/transform/src/lombok/transform/TestWithDelombok.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2010 The Project Lombok Authors. + * Copyright (C) 2009-2015 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -53,4 +53,9 @@ public class TestWithDelombok extends DirectoryRunner.TestParams { public File getMessagesDirectory() { return new File("test/transform/resource/messages-delombok"); } + + @Override + public boolean expectChanges() { + return true; + } } diff --git a/test/transform/src/lombok/transform/TestWithEcj.java b/test/transform/src/lombok/transform/TestWithEcj.java index 0a4057dd..3df8dc8b 100644 --- a/test/transform/src/lombok/transform/TestWithEcj.java +++ b/test/transform/src/lombok/transform/TestWithEcj.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2012 The Project Lombok Authors. + * Copyright (C) 2009-2015 The Project Lombok Authors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -57,4 +57,9 @@ public class TestWithEcj extends DirectoryRunner.TestParams { public File getMessagesDirectory() { return new File("test/transform/resource/messages-ecj"); } + + @Override + public boolean expectChanges() { + return true; + } } -- cgit