aboutsummaryrefslogtreecommitdiff
path: root/test/lombok/resource/before
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2009-11-29 01:07:53 +0100
committerRoel Spilker <r.spilker@gmail.com>2009-11-29 01:07:53 +0100
commitbe20f7a1180e4aa3d699d89c756c0c07e2eba1a7 (patch)
tree8ff277160a99fc7f2f6a11fdea60980979019195 /test/lombok/resource/before
parent0b36718d20bf149b4bdd9b2be88bf68055311b9a (diff)
downloadlombok-be20f7a1180e4aa3d699d89c756c0c07e2eba1a7.tar.gz
lombok-be20f7a1180e4aa3d699d89c756c0c07e2eba1a7.tar.bz2
lombok-be20f7a1180e4aa3d699d89c756c0c07e2eba1a7.zip
Added tests for Setter, Cleanup and NonNull
Diffstat (limited to 'test/lombok/resource/before')
-rw-r--r--test/lombok/resource/before/CleanupName.java6
-rw-r--r--test/lombok/resource/before/CleanupPlain.java11
-rw-r--r--test/lombok/resource/before/GetterAlreadyExists.java54
-rw-r--r--test/lombok/resource/before/GetterPlain.java1
-rw-r--r--test/lombok/resource/before/NonNullPlain.java11
-rw-r--r--test/lombok/resource/before/SetterAccessLevel.java12
-rw-r--r--test/lombok/resource/before/SetterAlreadyExists.java35
-rw-r--r--test/lombok/resource/before/SetterPlain.java5
8 files changed, 134 insertions, 1 deletions
diff --git a/test/lombok/resource/before/CleanupName.java b/test/lombok/resource/before/CleanupName.java
new file mode 100644
index 00000000..0d253f1e
--- /dev/null
+++ b/test/lombok/resource/before/CleanupName.java
@@ -0,0 +1,6 @@
+class Cleanup {
+ void test() throws Exception {
+ @lombok.Cleanup("toString") Object o = "Hello World!";
+ System.out.println(o);
+ }
+} \ No newline at end of file
diff --git a/test/lombok/resource/before/CleanupPlain.java b/test/lombok/resource/before/CleanupPlain.java
new file mode 100644
index 00000000..f463b152
--- /dev/null
+++ b/test/lombok/resource/before/CleanupPlain.java
@@ -0,0 +1,11 @@
+import lombok.Cleanup;
+import java.io.*;
+class Cleanup {
+ void test() throws Exception {
+ @lombok.Cleanup InputStream in = new FileInputStream("in");
+ @Cleanup OutputStream out = new FileOutputStream("out");
+ if (in.markSupported()) {
+ out.flush();
+ }
+ }
+} \ No newline at end of file
diff --git a/test/lombok/resource/before/GetterAlreadyExists.java b/test/lombok/resource/before/GetterAlreadyExists.java
index 3a22ed36..93b77dc1 100644
--- a/test/lombok/resource/before/GetterAlreadyExists.java
+++ b/test/lombok/resource/before/GetterAlreadyExists.java
@@ -51,4 +51,58 @@ class Getter9 {
boolean getFoo() {
return false;
}
+}
+class Getter10 {
+ @lombok.Getter boolean foo;
+ static boolean hasFoo() {
+ return false;
+ }
+}
+class Getter11 {
+ @lombok.Getter boolean foo;
+ static boolean isFoo() {
+ return false;
+ }
+}
+class Getter12 {
+ @lombok.Getter boolean foo;
+ static boolean getFoo() {
+ return false;
+ }
+}
+class Getter13 {
+ @lombok.Getter String foo;
+ static boolean hasFoo() {
+ return false;
+ }
+}
+class Getter14 {
+ @lombok.Getter String foo;
+ static boolean isFoo() {
+ return false;
+ }
+}
+class Getter15 {
+ @lombok.Getter String foo;
+ static boolean getFoo() {
+ return false;
+ }
+}
+class Getter16 {
+ @lombok.Getter String foo;
+ static String hasFoo() {
+ return false;
+ }
+}
+class Getter17 {
+ @lombok.Getter String foo;
+ static String isFoo() {
+ return false;
+ }
+}
+class Getter18 {
+ @lombok.Getter String foo;
+ static String getFoo() {
+ return false;
+ }
} \ No newline at end of file
diff --git a/test/lombok/resource/before/GetterPlain.java b/test/lombok/resource/before/GetterPlain.java
index e3baf5ae..e6018972 100644
--- a/test/lombok/resource/before/GetterPlain.java
+++ b/test/lombok/resource/before/GetterPlain.java
@@ -1,5 +1,4 @@
import lombok.Getter;
-
class Getter {
@lombok.Getter int i;
@Getter int foo;
diff --git a/test/lombok/resource/before/NonNullPlain.java b/test/lombok/resource/before/NonNullPlain.java
new file mode 100644
index 00000000..eef64b2f
--- /dev/null
+++ b/test/lombok/resource/before/NonNullPlain.java
@@ -0,0 +1,11 @@
+class NonNullPlain {
+ @lombok.Getter
+ @lombok.Setter
+ @lombok.NonNull
+ @lombok.Getter int i;
+
+ @lombok.Getter
+ @lombok.Setter
+ @lombok.NonNull
+ String s;
+} \ No newline at end of file
diff --git a/test/lombok/resource/before/SetterAccessLevel.java b/test/lombok/resource/before/SetterAccessLevel.java
new file mode 100644
index 00000000..767341ef
--- /dev/null
+++ b/test/lombok/resource/before/SetterAccessLevel.java
@@ -0,0 +1,12 @@
+class Setter {
+ @lombok.Setter(lombok.AccessLevel.NONE)
+ boolean isNone;
+ @lombok.Setter(lombok.AccessLevel.PRIVATE)
+ boolean isPrivate;
+ @lombok.Setter(lombok.AccessLevel.PACKAGE)
+ boolean isPackage;
+ @lombok.Setter(lombok.AccessLevel.PROTECTED)
+ boolean isProtected;
+ @lombok.Setter(lombok.AccessLevel.PUBLIC)
+ boolean isPublic;
+}
diff --git a/test/lombok/resource/before/SetterAlreadyExists.java b/test/lombok/resource/before/SetterAlreadyExists.java
new file mode 100644
index 00000000..a7a94123
--- /dev/null
+++ b/test/lombok/resource/before/SetterAlreadyExists.java
@@ -0,0 +1,35 @@
+class Setter1 {
+ @lombok.Setter boolean foo;
+ void setFoo(boolean foo) {
+ }
+}
+class Setter2 {
+ @lombok.Setter boolean foo;
+ void setFoo(String foo) {
+ }
+}
+class Setter3 {
+ @lombok.Setter String foo;
+ void setFoo(boolean foo) {
+ }
+}
+class Setter4 {
+ @lombok.Setter String foo;
+ void setFoo(String foo) {
+ }
+}
+class Setter5 {
+ @lombok.Setter String foo;
+ void setFoo() {
+ }
+}
+class Setter6 {
+ @lombok.Setter String foo;
+ void setFoo(String foo, int x) {
+ }
+}
+class Setter7 {
+ @lombok.Setter String foo;
+ static void setFoo() {
+ }
+}
diff --git a/test/lombok/resource/before/SetterPlain.java b/test/lombok/resource/before/SetterPlain.java
new file mode 100644
index 00000000..482b5e05
--- /dev/null
+++ b/test/lombok/resource/before/SetterPlain.java
@@ -0,0 +1,5 @@
+import lombok.Setter;
+class Setter {
+ @lombok.Setter int i;
+ @Setter int foo;
+} \ No newline at end of file