diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-02-14 16:39:48 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-02-14 16:39:48 +0100 |
commit | 06581537f24fe31ee096960be496bc503059a95e (patch) | |
tree | 3732f6fe2117c390f9812b5961dd2d95d4293026 /test/transform/resource/before | |
parent | 5e9e16a6b98da5a17f5efe785917bc1e92265fc8 (diff) | |
download | lombok-06581537f24fe31ee096960be496bc503059a95e.tar.gz lombok-06581537f24fe31ee096960be496bc503059a95e.tar.bz2 lombok-06581537f24fe31ee096960be496bc503059a95e.zip |
More test files, test files updated to be valid java, and ecj test now goes through the complete compile process. This means val and @Delegate testing is now enabled.
TODO: Update -eclipse tests.
Diffstat (limited to 'test/transform/resource/before')
10 files changed, 44 insertions, 29 deletions
diff --git a/test/transform/resource/before/Constructors.java b/test/transform/resource/before/Constructors.java index bb39490a..6ac228d6 100644 --- a/test/transform/resource/before/Constructors.java +++ b/test/transform/resource/before/Constructors.java @@ -15,6 +15,6 @@ String name; } @lombok.NoArgsConstructor class NoArgsConstructor1 { - final int x; + int x; String name; }
\ No newline at end of file diff --git a/test/transform/resource/before/DataPlain.java b/test/transform/resource/before/DataPlain.java index e2469d44..e7e3da11 100644 --- a/test/transform/resource/before/DataPlain.java +++ b/test/transform/resource/before/DataPlain.java @@ -14,7 +14,7 @@ final @Data class Data3 { @Data @lombok.EqualsAndHashCode(callSuper=true) final class Data4 extends java.util.Timer { - final int x; + int x; Data4() { super(); } diff --git a/test/transform/resource/before/DelegateOnGetterNone.java b/test/transform/resource/before/DelegateOnGetterNone.java index f9642e6b..9db0ea38 100644 --- a/test/transform/resource/before/DelegateOnGetterNone.java +++ b/test/transform/resource/before/DelegateOnGetterNone.java @@ -5,7 +5,7 @@ import lombok.Getter; @Getter class DelegateOnGetterNone { - @Delegate @Getter(AccessLevel.NONE) private final Bar bar; + @Delegate @Getter(AccessLevel.NONE) private final Bar bar = null; private interface Bar { void setList(java.util.ArrayList<java.lang.String> list); diff --git a/test/transform/resource/before/GetterAlreadyExists.java b/test/transform/resource/before/GetterAlreadyExists.java index 93b77dc1..426ab391 100644 --- a/test/transform/resource/before/GetterAlreadyExists.java +++ b/test/transform/resource/before/GetterAlreadyExists.java @@ -91,18 +91,18 @@ class Getter15 { class Getter16 { @lombok.Getter String foo; static String hasFoo() { - return false; + return ""; } } class Getter17 { @lombok.Getter String foo; static String isFoo() { - return false; + return ""; } } class Getter18 { @lombok.Getter String foo; static String getFoo() { - return false; + return ""; } }
\ No newline at end of file diff --git a/test/transform/resource/before/ToStringInner.java b/test/transform/resource/before/ToStringInner.java index f56865e0..728ee17f 100644 --- a/test/transform/resource/before/ToStringInner.java +++ b/test/transform/resource/before/ToStringInner.java @@ -1,16 +1,16 @@ import lombok.ToString; @ToString class ToStringOuter { - final int x; + int x; String name; @ToString class ToStringInner { - final int y; + int y; } @ToString static class ToStringStaticInner { - final int y; + int y; } class ToStringMiddle { @ToString class ToStringMoreInner { - final String name; + String name; } } }
\ No newline at end of file diff --git a/test/transform/resource/before/ToStringPlain.java b/test/transform/resource/before/ToStringPlain.java index 5b9db1c7..eaa1f463 100644 --- a/test/transform/resource/before/ToStringPlain.java +++ b/test/transform/resource/before/ToStringPlain.java @@ -1,9 +1,9 @@ import lombok.ToString; @lombok.ToString class ToString1 { - final int x; + int x; String name; } @ToString class ToString2 { - final int x; + int x; String name; }
\ No newline at end of file diff --git a/test/transform/resource/before/ValComplex.java b/test/transform/resource/before/ValComplex.java index c2e53011..e20124a2 100644 --- a/test/transform/resource/before/ValComplex.java +++ b/test/transform/resource/before/ValComplex.java @@ -1,11 +1,11 @@ import lombok.val; public class ValComplex { - private ValSimple field = new ValSimple(); + private String field = ""; private static final int CONSTANT = 20; - public void testReferencingOtherFiles() { - val shouldBeString = field.method(); + public void testComplex() { + val shouldBeCharArray = field.toCharArray(); val shouldBeInt = CONSTANT; val lock = new Object(); synchronized (lock) { @@ -13,10 +13,10 @@ public class ValComplex { val inner = 10; switch (field) { case 5: - val shouldBeString2 = shouldBeString; + val shouldBeCharArray2 = shouldBeCharArray; val innerInner = inner; } } - val shouldBeValSimple = field; //Unshadowing + val shouldBeString = field; //Unshadowing } }
\ No newline at end of file diff --git a/test/transform/resource/before/ValInFor.java b/test/transform/resource/before/ValInFor.java index ebe7287c..35332b34 100644 --- a/test/transform/resource/before/ValInFor.java +++ b/test/transform/resource/before/ValInFor.java @@ -1,17 +1,6 @@ import lombok.val; public class ValInFor { - { - val x = 10; - val x2 = -1; - val a = "Hello"; - for (val y = x, z = x2; y < 20; y++) { - val q = y; - val w = z; - val v = a; - } - } - public void enhancedFor() { java.util.List<String> list = java.util.Arrays.asList("Hello, World!"); for (val shouldBeString : list) { diff --git a/test/transform/resource/before/ValOutersWithGenerics.java b/test/transform/resource/before/ValOutersWithGenerics.java new file mode 100644 index 00000000..145f812c --- /dev/null +++ b/test/transform/resource/before/ValOutersWithGenerics.java @@ -0,0 +1,26 @@ +import java.util.*; +import lombok.val; + +public class ValOutersWithGenerics<Z> { + class Inner { + } + + public void testOutersWithGenerics() { + val foo = ""; + List<Inner> list = new ArrayList<Inner>(); + val elem = list.get(0); + } + + public void testLocalClasses() { + class Local<A> {} + + val q = new Local<String>(); + } + + static class SubClass extends ValOutersWithGenerics<String> { + public void testSubClassOfOutersWithGenerics() { + List<Inner> list = new ArrayList<Inner>(); + val elem = list.get(0); + } + } +} diff --git a/test/transform/resource/before/ValWeirdTypes.java b/test/transform/resource/before/ValWeirdTypes.java index 302ef841..8cba2de5 100644 --- a/test/transform/resource/before/ValWeirdTypes.java +++ b/test/transform/resource/before/ValWeirdTypes.java @@ -2,7 +2,7 @@ import java.util.*; import lombok.val; public class ValWeirdTypes<Z> { - private final List<Z> fieldList; + private List<Z> fieldList; public void testGenerics() { List<String> list = new ArrayList<String>(); |