Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Even more updates for pre 1.8 target removal #231

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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.

Loading