From bc1f91af3a764f0aa81ca441918c16a1d7969a07 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sun, 19 Jan 2014 07:01:10 +0100 Subject: [trivial] added test for logger config keys. --- src/core/lombok/ConfigurationKeys.java | 4 +++- test/transform/resource/after-delombok/LoggerConfig.java | 4 ++++ test/transform/resource/after-ecj/LoggerConfig.java | 6 ++++++ test/transform/resource/before/FlagUsages.java | 6 +++--- test/transform/resource/before/LoggerConfig.java | 5 +++++ 5 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 test/transform/resource/after-delombok/LoggerConfig.java create mode 100644 test/transform/resource/after-ecj/LoggerConfig.java create mode 100644 test/transform/resource/before/LoggerConfig.java diff --git a/src/core/lombok/ConfigurationKeys.java b/src/core/lombok/ConfigurationKeys.java index cd8e0717..022af237 100644 --- a/src/core/lombok/ConfigurationKeys.java +++ b/src/core/lombok/ConfigurationKeys.java @@ -32,8 +32,10 @@ public class ConfigurationKeys { /** * Makes sure all {@link ConfigurationKey}s in this class are loaded. + * + * (Calling the method ensures this class is initialized by the class loader; this is enough to initialize all configuration keys). */ - public static void ensureKeysLoaded() {}; + public static void ensureKeysLoaded() {} // ##### main package features ##### diff --git a/test/transform/resource/after-delombok/LoggerConfig.java b/test/transform/resource/after-delombok/LoggerConfig.java new file mode 100644 index 00000000..ba955638 --- /dev/null +++ b/test/transform/resource/after-delombok/LoggerConfig.java @@ -0,0 +1,4 @@ +class LoggerWithConfig { + @java.lang.SuppressWarnings("all") + private final org.slf4j.Logger myLogger = org.slf4j.LoggerFactory.getLogger(LoggerWithConfig.class); +} \ No newline at end of file diff --git a/test/transform/resource/after-ecj/LoggerConfig.java b/test/transform/resource/after-ecj/LoggerConfig.java new file mode 100644 index 00000000..907a7167 --- /dev/null +++ b/test/transform/resource/after-ecj/LoggerConfig.java @@ -0,0 +1,6 @@ +@lombok.extern.slf4j.Slf4j class LoggerWithConfig { + private final org.slf4j.Logger myLogger = org.slf4j.LoggerFactory.getLogger(LoggerWithConfig.class); + LoggerWithConfig() { + super(); + } +} \ No newline at end of file diff --git a/test/transform/resource/before/FlagUsages.java b/test/transform/resource/before/FlagUsages.java index d6cb331a..8fc8b306 100644 --- a/test/transform/resource/before/FlagUsages.java +++ b/test/transform/resource/before/FlagUsages.java @@ -1,8 +1,8 @@ -//conf: lombok.Getter.flagUsage = WARNING -//conf: lombok.experimental.flagUsage = ERROR +//CONF: lombok.Getter.flagUsage = WARNING +//CONF: lombok.experimental.flagUsage = ERROR public class FlagUsages { @lombok.Getter String x; - + @lombok.experimental.Wither String z; public FlagUsages(String x, String y) { diff --git a/test/transform/resource/before/LoggerConfig.java b/test/transform/resource/before/LoggerConfig.java new file mode 100644 index 00000000..14195e03 --- /dev/null +++ b/test/transform/resource/before/LoggerConfig.java @@ -0,0 +1,5 @@ +//CONF: lombok.log.fieldName = myLogger +//CONF: lombok.log.fieldIsStatic = false +@lombok.extern.slf4j.Slf4j +class LoggerWithConfig { +} -- cgit