Skip to content

Project creation/deletion tests for #2636#18

Closed
basilevs wants to merge 2 commits into
vogella:fix-close-unrelated-projects-enablementfrom
basilevs:test-close-unrelated-projects-enablement
Closed

Project creation/deletion tests for #2636#18
basilevs wants to merge 2 commits into
vogella:fix-close-unrelated-projects-enablementfrom
basilevs:test-close-unrelated-projects-enablement

Conversation

@basilevs
Copy link
Copy Markdown

Project creation and deletion tests.

I've also observed an attempt to close deleted project, but could not reproduce in a JUnit test.

@basilevs basilevs force-pushed the test-close-unrelated-projects-enablement branch from 8cef843 to 155ec44 Compare April 28, 2026 18:35
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the CloseUnrelatedProjectsActionEnablementTest by adding several new test cases to verify the enablement logic of the 'Close Unrelated Projects' action under various scenarios, such as project deletion, creation, and reopening. It also introduces a fourth test project and sets a specific workbench preference during setup. Feedback was provided regarding the need to restore global preferences after tests to ensure isolation and to correct a misleading assertion message in one of the new tests.

…ed projects

After PR eclipse-platform#3871, updateSelection() only checked whether the user selection
contained an open project, so the action stayed enabled even when no
unrelated projects were left to close. PR eclipse-platform#3871 was needed because the
prior check was triggering buildConnectedComponents() on every selection
change, which calls IProject#getReferencedProjects() across the workspace
and can resolve classpath containers, blocking the IDE.

Cache the workspace project graph and invalidate it from resourceChanged()
when project open state or description changes. The expensive graph build
now runs at most once per project-state change rather than once per
selection event, while updateSelection() can again ask whether any open
unrelated project actually exists. Selection-time work is reduced to a
non-mutating scan of the cached graph.

Add CloseUnrelatedProjectsActionEnablementTest covering the regression
scenario reported on PR eclipse-platform#3871: A and B linked, C unrelated; after closing
C, selecting B must disable the action.
@vogella vogella force-pushed the fix-close-unrelated-projects-enablement branch from de99193 to 13b5a44 Compare April 28, 2026 18:49
@basilevs basilevs force-pushed the test-close-unrelated-projects-enablement branch from ea97f53 to 6def0aa Compare April 28, 2026 19:15
@basilevs
Copy link
Copy Markdown
Author

testEnabledAfterDeleteAndReopen() still fails after latest fix pull

@basilevs basilevs force-pushed the test-close-unrelated-projects-enablement branch from 5c4e743 to ead5c98 Compare April 28, 2026 19:56
@vogella vogella force-pushed the fix-close-unrelated-projects-enablement branch from 13b5a44 to 8f71ec5 Compare April 29, 2026 07:11
@basilevs
Copy link
Copy Markdown
Author

moved to eclipse-platform#3954

@basilevs basilevs closed this Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants