aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/transform/resource/after-delombok/NonNullWithAlternateException.java17
-rw-r--r--test/transform/resource/after-ecj/NonNullWithAlternateException.java20
-rw-r--r--test/transform/resource/before/NonNullWithAlternateException.java9
-rw-r--r--test/transform/resource/before/NonNullWithMistypedException.java7
-rw-r--r--test/transform/resource/messages-delombok/NonNullPlain.java.messages2
-rw-r--r--test/transform/resource/messages-delombok/NonNullWithMistypedException.java.messages1
-rw-r--r--test/transform/resource/messages-ecj/NonNullWithMistypedException.java.messages1
7 files changed, 56 insertions, 1 deletions
diff --git a/test/transform/resource/after-delombok/NonNullWithAlternateException.java b/test/transform/resource/after-delombok/NonNullWithAlternateException.java
new file mode 100644
index 00000000..d4a2f657
--- /dev/null
+++ b/test/transform/resource/after-delombok/NonNullWithAlternateException.java
@@ -0,0 +1,17 @@
+public class NonNullWithAlternateException {
+ @lombok.NonNull
+ private String test;
+ public void testMethod(@lombok.NonNull String arg) {
+ if (arg == null) {
+ throw new java.lang.IllegalArgumentException("arg");
+ }
+ System.out.println(arg);
+ }
+ @java.lang.SuppressWarnings("all")
+ public void setTest(@lombok.NonNull final String test) {
+ if (test == null) {
+ throw new java.lang.IllegalArgumentException("test");
+ }
+ this.test = test;
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/after-ecj/NonNullWithAlternateException.java b/test/transform/resource/after-ecj/NonNullWithAlternateException.java
new file mode 100644
index 00000000..43edeb8c
--- /dev/null
+++ b/test/transform/resource/after-ecj/NonNullWithAlternateException.java
@@ -0,0 +1,20 @@
+public class NonNullWithAlternateException {
+ private @lombok.NonNull @lombok.Setter String test;
+ public NonNullWithAlternateException() {
+ super();
+ }
+ public void testMethod(@lombok.NonNull String arg) {
+ if ((arg == null))
+ {
+ throw new java.lang.IllegalArgumentException("arg");
+ }
+ System.out.println(arg);
+ }
+ public @java.lang.SuppressWarnings("all") void setTest(final @lombok.NonNull String test) {
+ if ((test == null))
+ {
+ throw new java.lang.IllegalArgumentException("test");
+ }
+ this.test = test;
+ }
+} \ No newline at end of file
diff --git a/test/transform/resource/before/NonNullWithAlternateException.java b/test/transform/resource/before/NonNullWithAlternateException.java
new file mode 100644
index 00000000..780afc39
--- /dev/null
+++ b/test/transform/resource/before/NonNullWithAlternateException.java
@@ -0,0 +1,9 @@
+//CONF: lombok.nonNull.exceptionType = java.lang.IllegalArgumentException
+
+public class NonNullWithAlternateException {
+ @lombok.NonNull @lombok.Setter private String test;
+
+ public void testMethod(@lombok.NonNull String arg) {
+ System.out.println(arg);
+ }
+}
diff --git a/test/transform/resource/before/NonNullWithMistypedException.java b/test/transform/resource/before/NonNullWithMistypedException.java
new file mode 100644
index 00000000..6e1fb880
--- /dev/null
+++ b/test/transform/resource/before/NonNullWithMistypedException.java
@@ -0,0 +1,7 @@
+//CONF: lombok.nonNull.exceptionType = 12345
+//skip compare content: Just testing appropriate generation of error message.
+
+@lombok.Data
+public class NonNullWithMistypedException {
+ private @lombok.NonNull String test;
+}
diff --git a/test/transform/resource/messages-delombok/NonNullPlain.java.messages b/test/transform/resource/messages-delombok/NonNullPlain.java.messages
index 4033f645..7b0c540b 100644
--- a/test/transform/resource/messages-delombok/NonNullPlain.java.messages
+++ b/test/transform/resource/messages-delombok/NonNullPlain.java.messages
@@ -1 +1 @@
-8 @NonNull is meaningless on a primitive. \ No newline at end of file
+5 @NonNull is meaningless on a primitive. \ No newline at end of file
diff --git a/test/transform/resource/messages-delombok/NonNullWithMistypedException.java.messages b/test/transform/resource/messages-delombok/NonNullWithMistypedException.java.messages
new file mode 100644
index 00000000..98bafe6e
--- /dev/null
+++ b/test/transform/resource/messages-delombok/NonNullWithMistypedException.java.messages
@@ -0,0 +1 @@
+4 Configuration key contains invalid java type reference '12345'; use something like 'java.lang.NullPointerException' as value for this key.
diff --git a/test/transform/resource/messages-ecj/NonNullWithMistypedException.java.messages b/test/transform/resource/messages-ecj/NonNullWithMistypedException.java.messages
new file mode 100644
index 00000000..98bafe6e
--- /dev/null
+++ b/test/transform/resource/messages-ecj/NonNullWithMistypedException.java.messages
@@ -0,0 +1 @@
+4 Configuration key contains invalid java type reference '12345'; use something like 'java.lang.NullPointerException' as value for this key.