From d9ba2a191ac71e7d8689f1ad0e99160b1c8dae3d Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 3 Nov 2010 00:42:32 +0100 Subject: big changes to delombok to prep for resolution, when sourcepath and classpath are relevant, and the flow needs to be parse all, then enter all, then transform all, instead of parse->enter->transform sequentially for each file in isolation. --- test/core/src/lombok/AbstractRunTests.java | 9 ++++++--- test/core/src/lombok/RunTestsViaDelombok.java | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'test/core') diff --git a/test/core/src/lombok/AbstractRunTests.java b/test/core/src/lombok/AbstractRunTests.java index 4241646b..7d5992be 100644 --- a/test/core/src/lombok/AbstractRunTests.java +++ b/test/core/src/lombok/AbstractRunTests.java @@ -37,12 +37,12 @@ public abstract class AbstractRunTests { public void compareFile(DirectoryRunner.TestParams params, File file) throws Throwable { StringBuilder messages = new StringBuilder(); - StringWriter result = new StringWriter(); - transformCode(messages, result, file); + StringWriter writer = new StringWriter(); + transformCode(messages, writer, file); compare( file.getName(), readFile(params.getAfterDirectory(), file, false), - result.toString(), + writer.toString(), readFile(params.getMessagesDirectory(), file, true), messages.toString(), params.printErrors()); @@ -111,6 +111,9 @@ public abstract class AbstractRunTests { private static void compareContent(String name, String expectedFile, String actualFile) { String[] expectedLines = expectedFile.split("(\\r?\\n)"); String[] actualLines = actualFile.split("(\\r?\\n)"); + if (expectedLines[0].startsWith("// Generated by delombok at ")) { + expectedLines[0] = ""; + } if (actualLines[0].startsWith("// Generated by delombok at ")) { actualLines[0] = ""; } diff --git a/test/core/src/lombok/RunTestsViaDelombok.java b/test/core/src/lombok/RunTestsViaDelombok.java index 50fad33e..59a0ee89 100644 --- a/test/core/src/lombok/RunTestsViaDelombok.java +++ b/test/core/src/lombok/RunTestsViaDelombok.java @@ -51,6 +51,9 @@ public class RunTestsViaDelombok extends AbstractRunTests { } }); - delombok.delombok(file.getAbsolutePath(), result); + delombok.addFile(file.getParentFile(), file.getName()); + delombok.setSourcepath(file.getParentFile().getAbsolutePath()); + delombok.setWriter(result); + delombok.delombok(); } } -- cgit