From 434ede8891e154a53c43d21c1ec76eea08b36e5c Mon Sep 17 00:00:00 2001 From: Donat Csikos Date: Wed, 12 Jun 2024 14:23:33 +0200 Subject: [PATCH] Fix tests --- build.gradle | 2 +- .../internal/configuration/ProjectConfigurationTest.groovy | 4 ++-- .../core/internal/test/fixtures/WorkspaceSpecification.groovy | 3 ++- .../SynchronizingBuildScriptUpdateListenerTest.groovy | 1 + .../internal/workspace/AddBuildshipNatureHandlerTest.groovy | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 386418166..946792e1a 100644 --- a/build.gradle +++ b/build.gradle @@ -133,7 +133,7 @@ subprojects { languageVersion = JavaLanguageVersion.of(8) } } - } else if (config.targetPlatform.eclipseVersion in ['417', '418', '419', '420', '21', '422', '423', '424'])) { + } else if (config.targetPlatform.eclipseVersion in ['417', '418', '419', '420', '21', '422', '423', '424']) { java { toolchain { languageVersion = JavaLanguageVersion.of(11) diff --git a/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/configuration/ProjectConfigurationTest.groovy b/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/configuration/ProjectConfigurationTest.groovy index 6e146c3ff..e60c54db4 100644 --- a/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/configuration/ProjectConfigurationTest.groovy +++ b/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/configuration/ProjectConfigurationTest.groovy @@ -190,7 +190,7 @@ class ProjectConfigurationTest extends ProjectSynchronizationSpecification { when: configurationManager.saveProjectConfiguration(projectConfig) - configurationManager.saveWorkspaceConfiguration(new WorkspaceConfiguration(distribution, gradleUserHome, javaHome, offlineMode, buildScansEnabled, autoSync, arguments, jvmArguments, showConsole, showExecutions, false)) + configurationManager.saveWorkspaceConfiguration(new WorkspaceConfiguration(distribution, gradleUserHome, javaHome, offlineMode, buildScansEnabled, autoSync, arguments, jvmArguments, showConsole, showExecutions, false, false)) projectConfig = configurationManager.loadProjectConfiguration(project) then: @@ -224,7 +224,7 @@ class ProjectConfigurationTest extends ProjectSynchronizationSpecification { when: configurationManager.saveProjectConfiguration(projectConfig) - configurationManager.saveWorkspaceConfiguration(new WorkspaceConfiguration(GradleDistribution.fromBuild(), null, null, !buildScansEnabled, !offlineMode, !autoSync, [], [], false, false, false)) + configurationManager.saveWorkspaceConfiguration(new WorkspaceConfiguration(GradleDistribution.fromBuild(), null, null, !buildScansEnabled, !offlineMode, !autoSync, [], [], false, false, false, false)) projectConfig = configurationManager.loadProjectConfiguration(project) then: diff --git a/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/test/fixtures/WorkspaceSpecification.groovy b/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/test/fixtures/WorkspaceSpecification.groovy index d7205f76b..68f0a23b2 100644 --- a/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/test/fixtures/WorkspaceSpecification.groovy +++ b/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/test/fixtures/WorkspaceSpecification.groovy @@ -247,7 +247,8 @@ abstract class WorkspaceSpecification extends Specification { } protected List getGradleErrorMarkers(IResource rootResource = workspace.root) { - rootResource.findMarkers(GradleErrorMarker.ID, false, IResource.DEPTH_INFINITE) as List + // error markers created from Tooling API problem events are filtered + (rootResource.findMarkers(GradleErrorMarker.ID, false, IResource.DEPTH_INFINITE) as List).findAll { IMarker m -> m.getAttribute(GradleErrorMarker.ATTRIBUTE_ID, null) == null } } protected List getPlatformLogErrors() { diff --git a/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/workspace/SynchronizingBuildScriptUpdateListenerTest.groovy b/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/workspace/SynchronizingBuildScriptUpdateListenerTest.groovy index 6797ca6fa..d5a27dd91 100644 --- a/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/workspace/SynchronizingBuildScriptUpdateListenerTest.groovy +++ b/org.eclipse.buildship.core.test/src/main/groovy/org/eclipse/buildship/core/internal/workspace/SynchronizingBuildScriptUpdateListenerTest.groovy @@ -212,6 +212,7 @@ class SynchronizingBuildScriptUpdateListenerTest extends ProjectSynchronizationS workspaceConfig.jvmArguments, workspaceConfig.showConsoleView, workspaceConfig.showExecutionsView, + false, false) configurationManager.saveWorkspaceConfiguration(workspaceConfig) } diff --git a/org.eclipse.buildship.ui.test/src/main/groovy/org/eclipse/buildship/ui/internal/workspace/AddBuildshipNatureHandlerTest.groovy b/org.eclipse.buildship.ui.test/src/main/groovy/org/eclipse/buildship/ui/internal/workspace/AddBuildshipNatureHandlerTest.groovy index bc6751785..11c732bd2 100644 --- a/org.eclipse.buildship.ui.test/src/main/groovy/org/eclipse/buildship/ui/internal/workspace/AddBuildshipNatureHandlerTest.groovy +++ b/org.eclipse.buildship.ui.test/src/main/groovy/org/eclipse/buildship/ui/internal/workspace/AddBuildshipNatureHandlerTest.groovy @@ -41,7 +41,7 @@ class AddBuildshipNatureHandlerTest extends WorkspaceSpecification { def "Uses configuration from workspace settings"() { setup: WorkspaceConfiguration originalWorkspaceConfig = configurationManager.loadWorkspaceConfiguration() - WorkspaceConfiguration config = new WorkspaceConfiguration(GradleDistribution.forVersion("3.0"), dir('custom-gradle-home'), null, false, false, false, [], [], false, false, false) + WorkspaceConfiguration config = new WorkspaceConfiguration(GradleDistribution.forVersion("3.0"), dir('custom-gradle-home'), null, false, false, false, [], [], false, false, false, false) configurationManager.saveWorkspaceConfiguration(config) IProject project = EclipseProjects.newProject('add-buildship-nature')