thoroughly updated the launch targets for testing lombok in eclipse;

they should now be able to handle running JDK8 etc tests.

CAREFUL: You MUST name your JDK8 'JavaSE-1.8' or it won't work.

Also added a basic test for JDK8 features.
This commit is contained in:
Reinier Zwitserloot committed 2014-05-04 10:33:55 +02:00
1 parent e890428077
commit 7079271802
5 files changed
+41 -24

No files matched your search

+9 -1
View File
@@ -431,9 +431,12 @@ ${sourceWarning}</echo>
overwrite="true">
<filterset>
<filter token="JAVAC_LOCATION" value="${test.location.javac}" />
<filter token="ECJ_LOCATION" value="${test.location.ecj}" />
<filter token="RT_LOCATION" value="${test.location.bootclasspath}" />
<filter token="JAVA_VERSION" value="${test.javaversion}" />
</filterset>
</copy>
<echo>WARNING: If you wish to test JDK8 features in eclipse, there must be a JDK8 installation configured in your eclipse, and it must be called 'JavaSE-1.8'.</echo>
</target>
<target name="setupJavaOpenJDK6TestEnvironment" description="Sets up the test so that 'ant test' will test against OpenJDK6.">
@@ -445,6 +448,7 @@ ${sourceWarning}</echo>
<entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" />
<entry key="test.location.bootclasspath" value="lib/openJDK6Environment/rt-openjdk6.jar" />
<entry key="test.location.name" value="OpenJDK6" />
<entry key="test.javaversion" value="6" />
</propertyfile>
<echo>Tests will now run against OpenJDK6</echo>
<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
@@ -459,6 +463,7 @@ ${sourceWarning}</echo>
<entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" />
<entry key="test.location.bootclasspath" value="lib/openJDK7Environment/rt-openjdk7.jar" />
<entry key="test.location.name" value="OpenJDK7" />
<entry key="test.javaversion" value="7" />
</propertyfile>
<echo>Tests will now run against OpenJDK7</echo>
<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
@@ -473,6 +478,7 @@ ${sourceWarning}</echo>
<entry key="test.location.ecj" value="lib/ecj7/org.eclipse.custom-ecj.jar" />
<entry key="test.location.bootclasspath" value="lib/oracleJDK7Environment/rt.jar" />
<entry key="test.location.name" value="OracleJDK7" />
<entry key="test.javaversion" value="7" />
</propertyfile>
<echo>Tests will now run against Oracle JDK7</echo>
<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
@@ -487,12 +493,13 @@ ${sourceWarning}</echo>
<entry key="test.location.ecj" value="lib/ecj8/org.eclipse.custom-ecj.jar" />
<entry key="test.location.bootclasspath" value="lib/oracleJDK8Environment/rt.jar" />
<entry key="test.location.name" value="OracleJDK8" />
<entry key="test.javaversion" value="8" />
</propertyfile>
<echo>Tests will now run against Oracle JDK8</echo>
<antcall target="-createEclipseLaunchForTestEnvironmentIfEclipseProject" />
</target>
<target name="-failIfNoTestEnvironmentProperties" unless="test.location.ecj">
<target name="-failIfNoTestEnvironmentProperties" unless="test.javaversion">
<fail>ERROR: No test environment set up.
You need to set up a test environment, which consists of a version of javac, and a JRE runtime classpath ('rt.jar').
@@ -513,6 +520,7 @@ You can also create your own by writing a 'testenvironment.properties' file. The
* test.location.ecj = /path/to/ecj6.jar
* test.location.bootclasspath = /path/to/rt.jar
* test.location.name = RandomUsefulNameToIdentifyThisSetup
* test.javaversion = 6
</fail>
</target>
+25 -16
View File
@@ -1,19 +1,28 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/lombok/test/core/src/lombok/RunAllTests.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="lombok.RunAllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="lombok"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-javaagent:dist/lombok.jar -Xbootclasspath/p:@JAVAC_LOCATION@ -Ddelombok.bootclasspath=@RT_LOCATION@"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/lombok/test/core/src/lombok/RunAllTests.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
<listAttribute key="org.eclipse.jdt.launching.CLASSPATH">
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry containerPath=&quot;org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.@JAVA_VERSION@&quot; path=&quot;1&quot; type=&quot;4&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/lombok/@ECJ_LOCATION@&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry internalArchive=&quot;/lombok/@JAVAC_LOCATION@&quot; path=&quot;3&quot; type=&quot;2&quot;/&gt;&#10;"/>
<listEntry value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#10;&lt;runtimeClasspathEntry id=&quot;org.eclipse.jdt.launching.classpathentry.defaultClasspath&quot;&gt;&#10;&lt;memento exportedEntriesOnly=&quot;false&quot; project=&quot;lombok&quot;/&gt;&#10;&lt;/runtimeClasspathEntry&gt;&#10;"/>
</listAttribute>
<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/>
<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.@JAVA_VERSION@"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="lombok.RunAllTests"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="lombok"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-javaagent:dist/lombok.jar -Ddelombok.bootclasspath=@RT_LOCATION@"/>
</launchConfiguration>
+6 -5
View File
@@ -70,22 +70,22 @@ public class RunTestsViaEcj extends AbstractRunTests {
warnings.put(CompilerOptions.OPTION_ReportUnusedLabel, "ignore");
warnings.put(CompilerOptions.OPTION_ReportUnusedImport, "ignore");
warnings.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, "ignore");
warnings.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_7);
warnings.put(CompilerOptions.OPTION_Source, "1." + Eclipse.getEcjCompilerVersion());
options.set(warnings);
return options;
}
protected IErrorHandlingPolicy ecjErrorHandlingPolicy() {
return new IErrorHandlingPolicy() {
@Override public boolean stopOnFirstError() {
public boolean stopOnFirstError() {
return true;
}
@Override public boolean proceedOnErrors() {
public boolean proceedOnErrors() {
return false;
}
@Override public boolean ignoreAllErrors() {
public boolean ignoreAllErrors() {
return false;
}
};
@@ -124,7 +124,8 @@ public class RunTestsViaEcj extends AbstractRunTests {
CompilationUnitDeclaration cud = compilationUnit_.get();
result.append(cud.toString());
if (cud == null) result.append("---- NO CompilationUnit provided by ecj ----");
else result.append(cud.toString());
}
private FileSystem createFileSystem(File file) {
@@ -1,4 +1,3 @@
//version 7
import java.io.IOException;
public class ValInTryWithResources {
public void whyTryInsteadOfCleanup() throws IOException {
@@ -1,4 +1,4 @@
//version 7
//version 7:
import lombok.val;
import java.io.IOException;