aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRoel Spilker <r.spilker@gmail.com>2020-01-16 21:11:31 +0100
committerRoel Spilker <r.spilker@gmail.com>2020-01-20 14:10:43 +0100
commitf2d49a89ecc09dc30fc03102254c9ffc62b7659e (patch)
treee38beb58e217c143c9db58cef55d047b62f3876a /test
parentbb4fb7d220da8d49aea93087b92dcb8adbbb7f99 (diff)
downloadlombok-f2d49a89ecc09dc30fc03102254c9ffc62b7659e.tar.gz
lombok-f2d49a89ecc09dc30fc03102254c9ffc62b7659e.tar.bz2
lombok-f2d49a89ecc09dc30fc03102254c9ffc62b7659e.zip
Config import: change bubble iteration
Diffstat (limited to 'test')
-rw-r--r--test/core/src/lombok/LombokTestSource.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/core/src/lombok/LombokTestSource.java b/test/core/src/lombok/LombokTestSource.java
index c924b8f7..b04f0ba0 100644
--- a/test/core/src/lombok/LombokTestSource.java
+++ b/test/core/src/lombok/LombokTestSource.java
@@ -42,9 +42,11 @@ import org.junit.Assert;
import lombok.core.LombokImmutableList;
import lombok.core.configuration.BubblingConfigurationResolver;
import lombok.core.configuration.ConfigurationFile;
+import lombok.core.configuration.ConfigurationFileToSource;
import lombok.core.configuration.ConfigurationParser;
import lombok.core.configuration.ConfigurationProblemReporter;
import lombok.core.configuration.ConfigurationResolver;
+import lombok.core.configuration.ConfigurationSource;
import lombok.core.configuration.SingleConfigurationSource;
public class LombokTestSource {
@@ -240,12 +242,21 @@ public class LombokTestSource {
this.skipIdempotent = skipIdempotent;
this.unchanged = unchanged;
this.platforms = platformLimit == null ? null : Arrays.asList(platformLimit);
+
ConfigurationProblemReporter reporter = new ConfigurationProblemReporter() {
@Override public void report(String sourceDescription, String problem, int lineNumber, CharSequence line) {
Assert.fail("Problem on directive line: " + problem + " at conf line #" + lineNumber + " (" + line + ")");
}
};
- this.configuration = new BubblingConfigurationResolver(Collections.singleton(SingleConfigurationSource.parse(ConfigurationFile.fromCharSequence(file.getAbsoluteFile().getPath(), conf, ConfigurationFile.getLastModifiedOrMissing(file)), new ConfigurationParser(reporter))));
+ final ConfigurationFile configurationFile = ConfigurationFile.fromCharSequence(file.getAbsoluteFile().getPath(), conf, ConfigurationFile.getLastModifiedOrMissing(file));
+ final ConfigurationSource source = SingleConfigurationSource.parse(configurationFile, new ConfigurationParser(reporter));
+ ConfigurationFileToSource sourceFinder = new ConfigurationFileToSource() {
+ @Override public ConfigurationSource parsed(ConfigurationFile fileLocation) {
+ return fileLocation.equals(configurationFile) ? source : null;
+ }
+ };
+
+ this.configuration = new BubblingConfigurationResolver(configurationFile, sourceFinder);
this.formatPreferences = Collections.unmodifiableMap(formats);
}