diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-03-23 06:01:50 +0100 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2021-03-23 06:01:50 +0100 |
commit | 3d7754e269ec84604d43be97a684bb26b519c6b9 (patch) | |
tree | 00f6a9e348b6cba0c025b46134ece5f86649f22f /test | |
parent | cc98adac012d0d18c70628eb5e6f1646ce574e8a (diff) | |
download | lombok-3d7754e269ec84604d43be97a684bb26b519c6b9.tar.gz lombok-3d7754e269ec84604d43be97a684bb26b519c6b9.tar.bz2 lombok-3d7754e269ec84604d43be97a684bb26b519c6b9.zip |
[testing] wahey, ecj testing works again, and now we can test JDK16 features in it!
Diffstat (limited to 'test')
-rw-r--r-- | test/core/src/lombok/RunTestsViaEcj.java | 11 | ||||
-rw-r--r-- | test/stubs/java/lang/Record.java | 3 | ||||
-rw-r--r-- | test/stubs/java/lang/runtime/ObjectMethods.java | 12 |
3 files changed, 21 insertions, 5 deletions
diff --git a/test/core/src/lombok/RunTestsViaEcj.java b/test/core/src/lombok/RunTestsViaEcj.java index 1c2be160..2e89f99b 100644 --- a/test/core/src/lombok/RunTestsViaEcj.java +++ b/test/core/src/lombok/RunTestsViaEcj.java @@ -110,6 +110,11 @@ public class RunTestsViaEcj extends AbstractRunTests { }; } + private ICompilationUnit getSourceUnit(File file, String source) { + if (eclipseAvailable()) return new TestCompilationUnitEclipse(file.getName(), source); + return new TestCompilationUnitEcj(file.getName(), source); + } + @Override public boolean transformCode(Collection<CompilerMessage> messages, StringWriter result, File file, String encoding, Map<String, String> formatPreferences, int minVersion, boolean checkPositions) throws Throwable { final AtomicReference<CompilationResult> compilationResult_ = new AtomicReference<CompilationResult>(); @@ -124,11 +129,7 @@ public class RunTestsViaEcj extends AbstractRunTests { char[] sourceArray = source.toCharArray(); final ICompilationUnit sourceUnit; try { - if (eclipseAvailable()) { - sourceUnit = new TestCompilationUnitEclipse(file.getName(), source); - } else { - sourceUnit = new TestCompilationUnitEcj(file.getName(), source); - } + sourceUnit = getSourceUnit(file, source); } catch (Throwable t) { t.printStackTrace(); return false; diff --git a/test/stubs/java/lang/Record.java b/test/stubs/java/lang/Record.java new file mode 100644 index 00000000..e985bb45 --- /dev/null +++ b/test/stubs/java/lang/Record.java @@ -0,0 +1,3 @@ +package java.lang; + +public abstract class Record {} diff --git a/test/stubs/java/lang/runtime/ObjectMethods.java b/test/stubs/java/lang/runtime/ObjectMethods.java new file mode 100644 index 00000000..519563ae --- /dev/null +++ b/test/stubs/java/lang/runtime/ObjectMethods.java @@ -0,0 +1,12 @@ +package java.lang.runtime; + +// import java.lang.invoke.MethodHandle; +// import java.lang.invoke.MethodHandles; +// import java.lang.invoke.TypeDescriptor; + +public class ObjectMethods { +// public static Object bootstrap(MethodHandles.Lookup lookup, String methodName, TypeDescriptor type, Class<?> recordClass, String names, MethodHandle... getters) throws Throwable { + public static Object bootstrap(Object lookup, String methodName, Object type, Class<?> recordClass, String names, Object... getters) throws Throwable { + return null; + } +} |