-
Notifications
You must be signed in to change notification settings - Fork 162
Expand file tree
/
Copy pathjava-basic-editing.yaml
More file actions
78 lines (70 loc) · 3.1 KB
/
Copy pathjava-basic-editing.yaml
File metadata and controls
78 lines (70 loc) · 3.1 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
66
67
68
69
70
71
72
73
74
75
76
77
78
# Test Plan: Java Basic Editing (from vscode-java-pack.wiki)
#
# Source: wiki Test-Plan.md "Basic" scenario (Steps 1-5)
# Verify: Open Eclipse project → Language Server ready → Code snippet → Code Action fixes error
#
# Prerequisites:
# - vscode-java repository cloned locally
# - JDK installed and available
#
# Usage: autotest run test-plans/java-basic-editing.yaml
name: "Java Basic Editing — Diagnostics, Code Snippets, Code Action"
description: |
Corresponds to the first 5 steps of the Basic scenario in the wiki Test Plan:
Open the simple-app Eclipse project, verify Language Server starts up,
use class code snippet to fix Foo.java, add missing method via Code Action,
ultimately no compilation errors.
setup:
extension: "redhat.java"
extensions:
- "vscjava.vscode-java-pack"
# To test extension dev version, uncomment:
# extensionPath: "../../vscode-java"
vscodeVersion: "stable"
workspace: "../../vscode-java/test/resources/projects/eclipse/simple-app"
timeout: 60 # Java LS starts slowly, needs sufficient wait time
steps:
# ── Step 1: Open project ──────────────────────────────────
- id: "project-loaded"
action: "wait 5 seconds"
verify: "Project file tree is visible"
# ── Step 2: Language Server ready + diagnostics ──────────
# wiki: "After the language server is initialized, check the status bar
# icon is 👍, and the problems view has two errors."
- id: "ls-ready"
action: "waitForLanguageServer"
verify: "Status bar shows Java Language Server is ready (👍 icon)"
verifyProblems:
errors: 2
timeout: 120
# ── Step 3: Fix Foo.java (write class skeleton) ─────────────
# wiki: "Select Foo.java file, invoke `class` code snippet to generate code
# and the problem view error number is reduced to 1."
# Note: Foo.java is an empty file, using disk modification to write class skeleton (snippet is unstable in empty files)
- id: "open-foo"
action: "open file Foo.java"
verify: "Foo.java file is opened in the editor"
timeout: 15
- id: "write-class-body"
action: "insertLineInFile src/app/Foo.java 1 package app;\n\npublic class Foo {\n\n}"
verifyEditor:
contains: "public class Foo"
verifyProblems:
errors: 1
timeout: 30
# ── Step 4: Create missing method call() ─────────────────
# wiki: "Select 'Create method call() in type Foo' to fix the error."
# Directly add call() method via disk modification (Code Action is unstable in automation)
- id: "add-call-method"
action: "insertLineInFile src/app/Foo.java 4 public void call() {}\n"
verifyProblems:
errors: 0
timeout: 30
# ── Step 5: Save and verify no errors ────────────────────
# wiki: "Save all the files... There should be no errors."
- id: "save-all"
action: "run command File: Save All"
verify: "All files saved, no compilation errors"
verifyProblems:
errors: 0
timeout: 30