Skip to content

Commit

Permalink
Remove old 1.x Java compiler versions support from PDE tests
Browse files Browse the repository at this point in the history
Basically moves tests that used various old 1.x JDK compiler settings to
use 1.8 target (only supported 1.x Java compiler target in the future).

See eclipse-jdt/eclipse.jdt.core#2536
  • Loading branch information
iloveeclipse committed Jun 18, 2024
1 parent c32168e commit c500d99
Show file tree
Hide file tree
Showing 34 changed files with 75 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.pde.api.tools.tests
Bundle-Version: 1.3.500.qualifier
Bundle-Version: 1.3.600.qualifier
Bundle-Vendor: %Bundle-Vendor
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.pde.api.tools;bundle-version="1.0.600",
Expand Down
2 changes: 1 addition & 1 deletion apitools/org.eclipse.pde.api.tools.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<relativePath>../../</relativePath>
</parent>
<artifactId>org.eclipse.pde.api.tools.tests</artifactId>
<version>1.3.500-SNAPSHOT</version>
<version>1.3.600-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<properties>
<defaultSigning-excludeInnerJars>true</defaultSigning-excludeInnerJars>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ protected void createExistingProject(File projectDir, boolean importfiles, boole
* @return the default compiler compliance to use for the test
*/
protected String getTestCompliance() {
return JavaCore.VERSION_1_4;
return JavaCore.VERSION_1_8;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,10 @@ public IPath addProject(String projectName, String compliance) throws Unsupporte
public void setProjectCompliance(IJavaProject project, String compliance) {
int requiredComplianceFlag = 0;
String compilerVersion = null;
if (JavaCore.VERSION_1_4.equals(compliance)) {
requiredComplianceFlag = AbstractCompilerTest.F_1_4;
compilerVersion = JavaCore.VERSION_1_4;
} else if (JavaCore.VERSION_1_5.equals(compliance)) {
requiredComplianceFlag = AbstractCompilerTest.F_1_5;
compilerVersion = JavaCore.VERSION_1_5;
} else if (JavaCore.VERSION_1_6.equals(compliance)) {
requiredComplianceFlag = AbstractCompilerTest.F_1_6;
compilerVersion = JavaCore.VERSION_1_6;
} else if (JavaCore.VERSION_1_7.equals(compliance)) {
requiredComplianceFlag = AbstractCompilerTest.F_1_7;
compilerVersion = JavaCore.VERSION_1_7;
} else if (JavaCore.VERSION_1_8.equals(compliance)) {
if (JavaCore.VERSION_1_8.equals(compliance)) {
requiredComplianceFlag = AbstractCompilerTest.F_1_8;
compilerVersion = JavaCore.VERSION_1_8;
} else if (!JavaCore.VERSION_1_4.equals(compliance) && !JavaCore.VERSION_1_3.equals(compliance)) {
} else {
throw new UnsupportedOperationException("Test framework doesn't support compliance level: " + compliance); //$NON-NLS-1$
}
if (requiredComplianceFlag != 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static Test suite() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static Test suite() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public EnumIncrementalBuildTests(String name) {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static Test suite() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

public void testInvalidAnnotationFieldTag1I() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public InvalidAnnotationMethodTagTests(String name) {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected int getDefaultProblemId() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

public void testInvalidAnnotationTag3I() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ protected IPath getTestSourcePath() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static Test suite() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

public void testInvalidEnumConstantTag1I() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static Test suite() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

public void testInvalidEnumFieldTag1I() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public InvalidEnumMethodTagTests(String name) {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ protected int getDefaultProblemId() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

public void testInvalidEnumTag1I() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected IPath getTestSourcePath() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public static Test suite() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public ValidEnumMethodTagTests(String name) {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected IPath getTestSourcePath() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

public static Test suite() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ protected IPath getTestSourcePath() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

public static Test suite() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ protected int getDefaultProblemId() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Java5ClassUsageTests(String name) {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static Test suite() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static Test suite() {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_5;
return JavaCore.VERSION_1_8;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Java7UsageTest(String name) {

@Override
protected String getTestCompliance() {
return JavaCore.VERSION_1_7;
return JavaCore.VERSION_1_8;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1117,9 +1117,9 @@ public void testMethodInheritInvalidRestrictionInterface() {
public void testEnumMethodWithNoReference() {
IApiDescription manifest = newDescription();
Map<String, String> options = JavaCore.getDefaultOptions();
options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_5);
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_5);
options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_5);
options.put(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, JavaCore.VERSION_1_8);
options.put(JavaCore.COMPILER_COMPLIANCE, JavaCore.VERSION_1_8);
options.put(JavaCore.COMPILER_SOURCE, JavaCore.VERSION_1_8);
doScan("a/b/c/TestMethod21.java", manifest, options); //$NON-NLS-1$
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public static IJavaProject createPluginProject(String projectName, String[] addi
description.setExtensionRegistry(true);
description.setEquinox(true);
description.setBundleVersion(new Version("1.0.0")); //$NON-NLS-1$
description.setExecutionEnvironments(new String[] { "J2SE-1.5" }); //$NON-NLS-1$
description.setExecutionEnvironments(new String[] { "JavaSE-1.8" }); //$NON-NLS-1$
description.apply(null);
AbstractApiTest.waitForAutoBuild();
return JavaCore.create(project);
Expand Down
2 changes: 1 addition & 1 deletion ui/org.eclipse.pde.ui.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: PDE JUnit Tests
Bundle-SymbolicName: org.eclipse.pde.ui.tests; singleton:=true
Bundle-Version: 3.12.500.qualifier
Bundle-Version: 3.12.600.qualifier
Bundle-ClassPath: tests.jar
Bundle-Vendor: Eclipse.org
Require-Bundle: org.eclipse.pde.ui,
Expand Down
6 changes: 3 additions & 3 deletions ui/org.eclipse.pde.ui.tests/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
<extension
point="org.eclipse.jdt.launching.executionEnvironments">
<environment
description="Java 1.3 without sound APIs (PDE test suite)"
id="J2SE-1.3-NO-SOUND"
profileProperties="profiles/J2SE-1.3-NO-SOUND.profile">
description="Java 1.8 without sound APIs (PDE test suite)"
id="J2SE-1.8-NO-SOUND"
profileProperties="profiles/J2SE-1.8-NO-SOUND.profile">
</environment>
<analyzer
class="org.eclipse.pde.ui.tests.ee.EnvironmentAnalyzerDelegate"
Expand Down
2 changes: 1 addition & 1 deletion ui/org.eclipse.pde.ui.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<relativePath>../../</relativePath>
</parent>
<artifactId>org.eclipse.pde.ui.tests</artifactId>
<version>3.12.500-SNAPSHOT</version>
<version>3.12.600-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ org.osgi.framework.executionenvironment = \
OSGi/Minimum-1.1,\
JRE-1.1,\
J2SE-1.2,\
J2SE-1.3-NO-SOUND
osgi.java.profile.name = J2SE-1.3-NO-SOUND
org.eclipse.jdt.core.compiler.compliance=1.3
org.eclipse.jdt.core.compiler.source=1.3
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.3
J2SE-1.8-NO-SOUND
osgi.java.profile.name = J2SE-1.8-NO-SOUND
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class EnvironmentAnalyzerDelegate implements IExecutionEnvironmentAnalyze
/**
* Environment identifier
*/
public static final String EE_NO_SOUND = "J2SE-1.3-NO-SOUND";
public static final String EE_NO_SOUND = "J2SE-1.8-NO-SOUND";

@Override
public CompatibleEnvironment[] analyze(IVMInstall vm, IProgressMonitor monitor) throws CoreException {
Expand Down
Loading

0 comments on commit c500d99

Please sign in to comment.