Skip to content

test(e2e): cover classpath / referenced-libraries commands#1028

Open
wenytang-ms wants to merge 2 commits into
mainfrom
e2e/phase-b-classpath
Open

test(e2e): cover classpath / referenced-libraries commands#1028
wenytang-ms wants to merge 2 commits into
mainfrom
e2e/phase-b-classpath

Conversation

@wenytang-ms
Copy link
Copy Markdown
Contributor

Phase B: Classpath / Referenced Libraries coverage

Adds test/e2e-plans/java-dep-classpath.yaml exercising all four java.project.* referenced-library commands on an invisible (unmanaged-folder) project, plus the two distinct removeLibrary code paths.

Commands covered

Command UI affordance Plan cycle
java.project.refreshLibraries Refresh inline icon on Referenced Libraries 1
java.project.addLibraries + inline icon -> simpleFileDialog jar pick 2
java.project.removeLibrary (include-removal) command id (handler unchanged) 3
java.project.addLibraryFolders command id -> Select Library Folders button 4
java.project.removeLibrary (exclude-add) command id (handler unchanged) 5

Notable design decisions (documented inline in the YAML)

  • Invisible projects do not auto-activate redhat.java -- bootstrap with open file src/App.java before waitForLanguageServer.
  • Single-folder workspaces have no collapseWorkspaceRoot target -- use collapseSidebarSection invisible so the JAVA PROJECTS pane gets the vertical room virtualisation needs to render jar leaves.
  • Jar leaves carry the resolved path in their accessible name -- drop exact: true on jar verifyTreeItem blocks (project root keeps it).
  • Smoke-test driver swaps native showOpenDialog for simpleFileDialog -- drive the picker with fillQuickInput; folder pick additionally needs tryClickButton Select Library Folders because Enter on a folder navigates into it.
  • removeLibrary is invoked via executeVSCodeCommand -- the inline minus icon hit-target is narrower than the wrapping <li class="action-item"> whose centre clickTreeItemAction targets, so the click consistently misses on jar-leaf rows. The command id bypasses the hit-target gap and exercises the same handler.
  • Cycle 5 exercises the second removeLibrary branch -- after cycle 4 the folder glob re-attaches extra-a.jar; removing it again goes through the if (removedPaths.length === 0) path that appends to referencedLibraries.exclude.

Fixtures

  • test/invisible/extraJars/extra-a.jar and extra-b.jar (added in a prior commit on this branch) enable the add-then-remove cycles without polluting the baseline lib/simple.jar.

Local verification

33/33 passed

Auto-discovered by the existing matrix in .github/workflows/e2eUI.yml via the discover-plans job -- no CI wiring needed.

wenytang-ms and others added 2 commits June 5, 2026 15:25
Cover the four java.project.* classpath commands on an invisible
(unmanaged-folder) project:

- java.project.refreshLibraries     -> Refresh inline icon, idempotent
- java.project.addLibraries         -> + inline icon + simpleFileDialog
- java.project.removeLibrary        -> include-removal branch
- java.project.addLibraryFolders    -> command id + Select Library Folders
- java.project.removeLibrary (#2)   -> exclude-addition branch

Reuse the existing 	est/invisible fixture and the two new
�xtraJars/extra-{a,b}.jar files committed earlier so all 33 steps
run deterministically against the worktree workspace.

Auto-discovered by the existing matrix in .github/workflows/e2eUI.yml,
no CI wiring needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant