-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathjava-maven-resolve-type.yaml
More file actions
65 lines (57 loc) · 2.78 KB
/
Copy pathjava-maven-resolve-type.yaml
File metadata and controls
65 lines (57 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Test Plan: Maven for Java — Resolve Unknown Type (from vscode-java-pack.wiki)
#
# Source: wiki Test-Plan.md "Maven for Java" scenario
# Verify: Type unknown type → hover shows "Resolve unknown type" → add dependency and import
#
# Prerequisites:
# - JDK 11+ installed and available on PATH (the workflow installs JDK 21)
# - Maven installed (or the redhat.java embedded one)
#
# Usage: autotest run test-plans/java-maven-resolve-type.yaml
#
# Fixture: test-fixtures/maven-resolve-type — self-contained, owned by this
# repo. Uses JDK 11 compliance to ensure JDT runs full semantic analysis
# and publishes the unresolved-type diagnostic (see fixture README).
name: "Maven for Java — Resolve Unknown Type"
description: |
Corresponds to the Maven for Java scenario in the wiki Test Plan:
Type an unknown type (e.g. Gson) in a Maven project,
verify that hover and Code Action can resolve the unknown type and add the dependency.
setup:
extension: "redhat.java"
extensions:
- "vscjava.vscode-java-pack"
vscodeVersion: "stable"
workspace: "../test-fixtures/maven-resolve-type"
timeout: 90
steps:
# ── Wait for LS ready ─────────────────────────────────────────
- id: "ls-ready"
action: "waitForLanguageServer"
verify: "Status bar shows Java language server is ready"
timeout: 120
# ── Open Java file ──────────────────────────────────────
- id: "open-app"
action: "open file App.java"
verify: "App.java file is open in the editor"
timeout: 15
# ── Type unknown type ─────────────────────────────────────────
# wiki: "type 'Gson gson;'" — use insertLineInFile so LS detects the change.
# Line 4 places the field directly inside the class body of App.java.
- id: "insert-unknown-type"
action: "insertLineInFile src/main/java/com/example/App.java 4 Gson gson;"
waitBefore: 3
# ── Verify Code Action: Resolve unknown type ────────────
# wiki: hover shows "Resolve unknown type" → apply Code Action.
# navigateToError polls for diagnostics up to 30s and fails clearly if
# the LS hasn't published the unresolved-type error yet.
- id: "navigate-to-error"
action: "navigateToError 1"
waitBefore: 5
- id: "check-code-action"
action: "applyCodeAction Resolve unknown type"
verify: "Code Action applied to resolve unknown type"
# ── Verify save and check result ────────────────────────
- id: "save-after-resolve"
action: "saveFile"
verify: "File saved after resolving unknown type"