From ed4068d84289390c74ca2e45149c9a22f96ce764 Mon Sep 17 00:00:00 2001 From: grootjans Date: Mon, 14 Feb 2011 22:35:20 +0100 Subject: Added a number of test for AllArgsConstuctor, RequiredArgsConstructor, NoArgsConstructor annotations and added a test for issue: 172 --- .../resource/after-delombok/Constructors.java | 69 ++++++++++++++++++++++ .../transform/resource/after-ecj/Constructors.java | 56 ++++++++++++++++++ test/transform/resource/before/Constructors.java | 29 +++++++++ .../messages-delombok/Constructors.java.messages | 3 + 4 files changed, 157 insertions(+) create mode 100644 test/transform/resource/after-delombok/Constructors.java create mode 100644 test/transform/resource/after-ecj/Constructors.java create mode 100644 test/transform/resource/before/Constructors.java create mode 100644 test/transform/resource/messages-delombok/Constructors.java.messages (limited to 'test/transform') diff --git a/test/transform/resource/after-delombok/Constructors.java b/test/transform/resource/after-delombok/Constructors.java new file mode 100644 index 00000000..f8b090a1 --- /dev/null +++ b/test/transform/resource/after-delombok/Constructors.java @@ -0,0 +1,69 @@ +class RequiredArgsConstructor1 { + final int x; + String name; + + @java.beans.ConstructorProperties({"x"}) + @java.lang.SuppressWarnings("all") + public RequiredArgsConstructor1(final int x) { + this.x = x; + } +} + +class RequiredArgsConstructorAccess { + final int x; + String name; + + @java.beans.ConstructorProperties({"x"}) + @java.lang.SuppressWarnings("all") + protected RequiredArgsConstructorAccess(final int x) { + this.x = x; + } +} + +class RequiredArgsConstructorStaticName { + final int x; + String name; + + @java.lang.SuppressWarnings("all") + private RequiredArgsConstructorStaticName(final int x) { + this.x = x; + } + + @java.lang.SuppressWarnings("all") + public static RequiredArgsConstructorStaticName staticname(final int x) { + return new RequiredArgsConstructorStaticName(x); + } +} + +class RequiredArgsConstructorWithAnnotations { + final int x; + String name; + + @Deprecated + @java.beans.ConstructorProperties({"x"}) + @java.lang.SuppressWarnings("all") + public RequiredArgsConstructorWithAnnotations(final int x) { + this.x = x; + } +} + +class AllArgsConstructor1 { + final int x; + String name; + + @java.beans.ConstructorProperties({"x", "name"}) + @java.lang.SuppressWarnings("all") + public AllArgsConstructor1(final int x, final String name) { + this.x = x; + this.name = name; + } +} + +class NoArgsConstructor1 { + final int x; + String name; + + @java.lang.SuppressWarnings("all") + public NoArgsConstructor1() { + } +} \ No newline at end of file diff --git a/test/transform/resource/after-ecj/Constructors.java b/test/transform/resource/after-ecj/Constructors.java new file mode 100644 index 00000000..e4fba7ff --- /dev/null +++ b/test/transform/resource/after-ecj/Constructors.java @@ -0,0 +1,56 @@ +@lombok.RequiredArgsConstructor class RequiredArgsConstructor1 { + final int x; + String name; + public @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") RequiredArgsConstructor1(final int x) { + super(); + this.x = x; + } +} + +@lombok.RequiredArgsConstructor(access = lombok.AccessLevel.PROTECTED) class RequiredArgsConstructorAccess { + final int x; + String name; + protected @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") RequiredArgsConstructorAccess(final int x) { + super(); + this.x = x; + } +} + +@lombok.RequiredArgsConstructor(staticName = "staticname") class RequiredArgsConstructorStaticName { + final int x; + String name; + private @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticName(final int x) { + super(); + this.x = x; + } + public static @java.lang.SuppressWarnings("all") RequiredArgsConstructorStaticName staticname(final int x) { + return new RequiredArgsConstructorStaticName(x); + } +} + +@lombok.RequiredArgsConstructor() class RequiredArgsConstructorWithAnnotations { + final int x; + String name; + public @Deprecated @java.beans.ConstructorProperties({"x"}) @java.lang.SuppressWarnings("all") RequiredArgsConstructorWithAnnotations(final int x) { + super(); + this.x = x; + } +} + +@lombok.AllArgsConstructor class AllArgsConstructor1 { + final int x; + String name; + public @java.beans.ConstructorProperties({"x", "name"}) @java.lang.SuppressWarnings("all") AllArgsConstructor1(final int x, final String name) { + super(); + this.x = x; + this.name = name; + } +} + +@lombok.NoArgsConstructor class NoArgsConstructor1 { + final int x; + String name; + public @java.lang.SuppressWarnings("all") NoArgsConstructor1() { + super(); + } +} \ No newline at end of file diff --git a/test/transform/resource/before/Constructors.java b/test/transform/resource/before/Constructors.java new file mode 100644 index 00000000..f5b5b770 --- /dev/null +++ b/test/transform/resource/before/Constructors.java @@ -0,0 +1,29 @@ +@lombok.RequiredArgsConstructor class RequiredArgsConstructor1 { + final int x; + String name; +} + +@lombok.RequiredArgsConstructor(access=lombok.AccessLevel.PROTECTED) class RequiredArgsConstructorAccess { + final int x; + String name; +} + +@lombok.RequiredArgsConstructor(staticName="staticname") class RequiredArgsConstructorStaticName { + final int x; + String name; +} + +@lombok.RequiredArgsConstructor(onConstructor=@Deprecated) class RequiredArgsConstructorWithAnnotations { + final int x; + String name; +} + +@lombok.AllArgsConstructor class AllArgsConstructor1 { + final int x; + String name; +} + +@lombok.NoArgsConstructor class NoArgsConstructor1 { + final int x; + String name; +} \ No newline at end of file diff --git a/test/transform/resource/messages-delombok/Constructors.java.messages b/test/transform/resource/messages-delombok/Constructors.java.messages new file mode 100644 index 00000000..0ab86ac6 --- /dev/null +++ b/test/transform/resource/messages-delombok/Constructors.java.messages @@ -0,0 +1,3 @@ +16:48 ERROR incompatible types +found : java.lang.Deprecated +required: lombok.RequiredArgsConstructor.AnyAnnotation \ No newline at end of file -- cgit