From 96151ade650c2038ab639a1c0f5a504747c4b1b5 Mon Sep 17 00:00:00 2001 From: Caleb Brinkman Date: Wed, 10 Jul 2019 15:05:06 -0500 Subject: Add tests for prefixed builder --- .../resource/after-delombok/BuilderWithPrefix.java | 34 ++++++++++++++++++++++ .../resource/after-ecj/BuilderWithPrefix.java | 27 +++++++++++++++++ .../resource/before/BuilderWithPrefix.java | 6 ++++ 3 files changed, 67 insertions(+) create mode 100644 test/transform/resource/after-delombok/BuilderWithPrefix.java create mode 100644 test/transform/resource/after-ecj/BuilderWithPrefix.java create mode 100644 test/transform/resource/before/BuilderWithPrefix.java (limited to 'test/transform/resource') diff --git a/test/transform/resource/after-delombok/BuilderWithPrefix.java b/test/transform/resource/after-delombok/BuilderWithPrefix.java new file mode 100644 index 00000000..c29d2a16 --- /dev/null +++ b/test/transform/resource/after-delombok/BuilderWithPrefix.java @@ -0,0 +1,34 @@ +import java.util.List; +class BuilderWithPrefix { + private int unprefixed; + @java.lang.SuppressWarnings("all") + BuilderWithPrefix(final int unprefixed) { + this.unprefixed = unprefixed; + } + @java.lang.SuppressWarnings("all") + protected static class BuilderWithPrefixBuilder { + @java.lang.SuppressWarnings("all") + private int unprefixed; + @java.lang.SuppressWarnings("all") + BuilderWithPrefixBuilder() { + } + @java.lang.SuppressWarnings("all") + public BuilderWithPrefixBuilder withUnprefixed(final int unprefixed) { + this.unprefixed = unprefixed; + return this; + } + @java.lang.SuppressWarnings("all") + public BuilderWithPrefix build() { + return new BuilderWithPrefix(unprefixed); + } + @java.lang.Override + @java.lang.SuppressWarnings("all") + public java.lang.String toString() { + return "BuilderWithPrefix.BuilderWithPrefixBuilder(unprefixed=" + this.unprefixed + ")"; + } + } + @java.lang.SuppressWarnings("all") + protected static BuilderWithPrefixBuilder builder() { + return new BuilderWithPrefixBuilder(); + } +} diff --git a/test/transform/resource/after-ecj/BuilderWithPrefix.java b/test/transform/resource/after-ecj/BuilderWithPrefix.java new file mode 100644 index 00000000..21a60d0d --- /dev/null +++ b/test/transform/resource/after-ecj/BuilderWithPrefix.java @@ -0,0 +1,27 @@ +import java.util.List; +@lombok.Builder(access = lombok.AccessLevel.PROTECTED,setterPrefix = "with") class BuilderWithPrefix { + protected static @java.lang.SuppressWarnings("all") class BuilderWithPrefixBuilder { + private @java.lang.SuppressWarnings("all") int unprefixed; + @java.lang.SuppressWarnings("all") BuilderWithPrefixBuilder() { + super(); + } + public @java.lang.SuppressWarnings("all") BuilderWithPrefixBuilder withUnprefixed(final int unprefixed) { + this.unprefixed = unprefixed; + return this; + } + public @java.lang.SuppressWarnings("all") BuilderWithPrefix build() { + return new BuilderWithPrefix(unprefixed); + } + public @java.lang.Override @java.lang.SuppressWarnings("all") java.lang.String toString() { + return (((("BuilderWithPrefix.BuilderWithPrefixBuilder(unprefixed=" + this.unprefixed) + ")"); + } + } + private int unprefixed; + @java.lang.SuppressWarnings("all") BuilderWithPrefix(final int unprefixed) { + super(); + this.unprefixed = unprefixed; + } + protected static @java.lang.SuppressWarnings("all") BuilderWithPrefixBuilder builder() { + return new BuilderWithPrefixBuilder(); + } +} diff --git a/test/transform/resource/before/BuilderWithPrefix.java b/test/transform/resource/before/BuilderWithPrefix.java new file mode 100644 index 00000000..38f3c029 --- /dev/null +++ b/test/transform/resource/before/BuilderWithPrefix.java @@ -0,0 +1,6 @@ +import java.util.List; + +@lombok.Builder(access = lombok.AccessLevel.PROTECTED, setterPrefix = "with") +class BuilderWithPrefix { + private int unprefixed; +} -- cgit