From 89c058f96e55208299c23e3573d7578f7099d785 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 7 Dec 2009 15:59:29 +0100 Subject: Added tests to @Data to check if a field starting with $ will be ignored --- test/delombok/resource/after/DataIgnore.java | 30 +++++++++++++++++++++++++++ test/delombok/resource/before/DataIgnore.java | 4 ++++ 2 files changed, 34 insertions(+) create mode 100644 test/delombok/resource/after/DataIgnore.java create mode 100644 test/delombok/resource/before/DataIgnore.java (limited to 'test') diff --git a/test/delombok/resource/after/DataIgnore.java b/test/delombok/resource/after/DataIgnore.java new file mode 100644 index 00000000..706d7b59 --- /dev/null +++ b/test/delombok/resource/after/DataIgnore.java @@ -0,0 +1,30 @@ +class DataIgnore { + final int x; + String $name; + public DataIgnore(final int x) { + this.x = x; + } + public int getX() { + return x; + } + @java.lang.Override + public boolean equals(final java.lang.Object o) { + if (o == this) return true; + if (o == null) return false; + if (o.getClass() != this.getClass()) return false; + final DataIgnore other = (DataIgnore)o; + if (this.x != other.x) return false; + return true; + } + @java.lang.Override + public int hashCode() { + final int PRIME = 31; + int result = 1; + result = result * PRIME + this.x; + return result; + } + @java.lang.Override + public java.lang.String toString() { + return "DataIgnore(x=" + x + ")"; + } +} diff --git a/test/delombok/resource/before/DataIgnore.java b/test/delombok/resource/before/DataIgnore.java new file mode 100644 index 00000000..5f957bdc --- /dev/null +++ b/test/delombok/resource/before/DataIgnore.java @@ -0,0 +1,4 @@ +@lombok.Data class DataIgnore { + final int x; + String $name; +} -- cgit From d5e7ae61c0d820be49a181a3f1755d84c0908058 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Mon, 7 Dec 2009 16:05:19 +0100 Subject: Added tests to see if we handle fields that start with a $ correctly --- test/delombok/resource/after/GetterWithDollar.java | 15 +++++++++++++++ test/delombok/resource/after/SetterWithDollar.java | 15 +++++++++++++++ test/delombok/resource/before/GetterWithDollar.java | 9 +++++++++ test/delombok/resource/before/SetterWithDollar.java | 9 +++++++++ 4 files changed, 48 insertions(+) create mode 100644 test/delombok/resource/after/GetterWithDollar.java create mode 100644 test/delombok/resource/after/SetterWithDollar.java create mode 100644 test/delombok/resource/before/GetterWithDollar.java create mode 100644 test/delombok/resource/before/SetterWithDollar.java (limited to 'test') diff --git a/test/delombok/resource/after/GetterWithDollar.java b/test/delombok/resource/after/GetterWithDollar.java new file mode 100644 index 00000000..56be0249 --- /dev/null +++ b/test/delombok/resource/after/GetterWithDollar.java @@ -0,0 +1,15 @@ +class GetterWithDollar1 { + int $i; + + public int getI() { + return $i; + } +} +class GetterWithDollar2 { + int $i; + int i; + + public int getI() { + return i; + } +} \ No newline at end of file diff --git a/test/delombok/resource/after/SetterWithDollar.java b/test/delombok/resource/after/SetterWithDollar.java new file mode 100644 index 00000000..c26a1ccd --- /dev/null +++ b/test/delombok/resource/after/SetterWithDollar.java @@ -0,0 +1,15 @@ +class SetterWithDollar1 { + int $i; + + public void setI(final int i) { + this.$i = i; + } +} +class SetterWithDollar2 { + int $i; + int i; + + public void setI(final int i) { + this.i = i; + } +} \ No newline at end of file diff --git a/test/delombok/resource/before/GetterWithDollar.java b/test/delombok/resource/before/GetterWithDollar.java new file mode 100644 index 00000000..e1ef0818 --- /dev/null +++ b/test/delombok/resource/before/GetterWithDollar.java @@ -0,0 +1,9 @@ +//ignore +class GetterWithDollar1 { + @lombok.Getter int $i; +} + +class GetterWithDollar2 { + @lombok.Getter int $i; + @lombok.Getter int i; +} diff --git a/test/delombok/resource/before/SetterWithDollar.java b/test/delombok/resource/before/SetterWithDollar.java new file mode 100644 index 00000000..c09173b0 --- /dev/null +++ b/test/delombok/resource/before/SetterWithDollar.java @@ -0,0 +1,9 @@ +//ignore +class SetterWithDollar1 { + @lombok.Setter int $i; +} + +class SetterWithDollar2 { + @lombok.Setter int $i; + @lombok.Setter int i; +} -- cgit