diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-11-03 00:42:32 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2010-11-03 00:42:32 +0100 |
commit | d9ba2a191ac71e7d8689f1ad0e99160b1c8dae3d (patch) | |
tree | f7b11103f82bf496beca40854520c8b47dc4bf93 /test/core/src | |
parent | 6e2924bcf2ceb390c0f8c712e8ee9c4428173ded (diff) | |
download | lombok-d9ba2a191ac71e7d8689f1ad0e99160b1c8dae3d.tar.gz lombok-d9ba2a191ac71e7d8689f1ad0e99160b1c8dae3d.tar.bz2 lombok-d9ba2a191ac71e7d8689f1ad0e99160b1c8dae3d.zip |
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.
Diffstat (limited to 'test/core/src')
-rw-r--r-- | test/core/src/lombok/AbstractRunTests.java | 9 | ||||
-rw-r--r-- | test/core/src/lombok/RunTestsViaDelombok.java | 5 |
2 files changed, 10 insertions, 4 deletions
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(); } } |