Skip to content

Commit

Permalink
Even more updates for pre 1.8 target removal
Browse files Browse the repository at this point in the history
Continuation of #230
  • Loading branch information
akurtakov committed Sep 27, 2024
1 parent 9070717 commit 0d3bb29
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 197 deletions.

This file was deleted.

29 changes: 0 additions & 29 deletions org.eclipse.m2e.tests/projects/compilerSettings14/pom.xml

This file was deleted.

30 changes: 0 additions & 30 deletions org.eclipse.m2e.tests/projects/compilerSettings18/pom.xml

This file was deleted.

43 changes: 0 additions & 43 deletions org.eclipse.m2e.tests/projects/compilerSettingsJsr14/pom.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.launching.JavaRuntime;

import org.apache.maven.archetype.catalog.Archetype;
import org.apache.maven.artifact.Artifact;
Expand Down Expand Up @@ -873,64 +872,6 @@ public void testProjectNameWithNameTemplate() throws Exception {
assertTrue(workspace.getRoot().getProject("My super awesome project-0.0.1-SNAPSHOT").exists());
}

@Test
public void testCompilerSettingsJsr14() throws Exception {
deleteProject("compilerSettingsJsr14");

ResolverConfiguration configuration = new ResolverConfiguration();
ProjectImportConfiguration projectImportConfiguration = new ProjectImportConfiguration(configuration);
importProject("compilerSettingsJsr14", "projects/compilerSettingsJsr14", projectImportConfiguration);

waitForJobsToComplete();

IProject project = workspace.getRoot().getProject("compilerSettingsJsr14");
assertTrue(project.exists());

WorkspaceHelpers.assertNoErrors(project);

IJavaProject javaProject = JavaCore.create(project);
assertEquals("1.5", javaProject.getOption(JavaCore.COMPILER_SOURCE, true));
assertEquals("1.5", javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true));

IClasspathEntry jreEntry = getJreContainer(javaProject.getRawClasspath());
assertEquals("J2SE-1.5", JavaRuntime.getExecutionEnvironmentId(jreEntry.getPath()));
}

@Test
public void testCompilerSettings14() throws Exception {
deleteProject("compilerSettings14");

ResolverConfiguration configuration = new ResolverConfiguration();
ProjectImportConfiguration projectImportConfiguration = new ProjectImportConfiguration(configuration);
importProject("compilerSettings14", "projects/compilerSettings14", projectImportConfiguration);

waitForJobsToComplete();

IProject project = workspace.getRoot().getProject("compilerSettings14");
assertTrue(project.exists());

// Build path specifies execution environment J2SE-1.4.
// There are no JREs in the workspace strictly compatible with this environment.
WorkspaceHelpers.assertNoErrors(project);

IJavaProject javaProject = JavaCore.create(project);
assertEquals("1.4", javaProject.getOption(JavaCore.COMPILER_SOURCE, true));
assertEquals("1.4", javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true));
assertEquals("123", javaProject.getOption(JavaCore.COMPILER_PB_MAX_PER_UNIT, true));

IClasspathEntry jreEntry = getJreContainer(javaProject.getRawClasspath());
assertEquals("J2SE-1.4", JavaRuntime.getExecutionEnvironmentId(jreEntry.getPath()));
}

private IClasspathEntry getJreContainer(IClasspathEntry[] entries) {
for(IClasspathEntry entry : entries) {
if(JavaRuntime.newDefaultJREContainerPath().isPrefixOf(entry.getPath())) {
return entry;
}
}
return null;
}

@Test
public void testMavenBuilderOrder() throws Exception {
IProject project = createExisting("builderOrder", "projects/builderOrder");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ public void testExtractionOfCompilerSettingsDespiteErrorsInExecutionPlan() throw
});

IJavaProject javaProject = JavaCore.create(project);
assertEquals("1.6", javaProject.getOption(JavaCore.COMPILER_SOURCE, true));
assertEquals("1.5", javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true));
assertEquals("11", javaProject.getOption(JavaCore.COMPILER_SOURCE, true));
assertEquals("11", javaProject.getOption(JavaCore.COMPILER_CODEGEN_TARGET_PLATFORM, true));
}

@Test
Expand Down

This file was deleted.

0 comments on commit 0d3bb29

Please sign in to comment.