Skip to content

Commit 810dfb9

Browse files
yaohaizhfbricon
authored andcommitted
Adopt JDT.LS test project for client side test plan. (#748)
Signed-off-by: Yaohai Zheng <[email protected]>
1 parent c2d0dfc commit 810dfb9

File tree

38 files changed

+1026
-0
lines changed

38 files changed

+1026
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ node_modules
77
undefined
88
target
99
dist
10+
bin/

test/Test Plan.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Test platform
2+
3+
## Windows 10/maxOS/Linux
4+
5+
# Scenarios
6+
7+
## Basic
8+
1. Open .\resources\eclipse\simple-app. After the language server is initialized, check the status bar icon is :thumbsup:, and the problems view has two errors.
9+
2. Select Foo.java file, invoke `class` code snippet to generate code as below and the problem view error number is reduced to 1.
10+
11+
```java
12+
package app;
13+
14+
/**
15+
* Foo
16+
*/
17+
public class Foo {
18+
19+
20+
}
21+
```
22+
3. Click the remain error in the diagnostic window, the code action icon should pop up both on the problems view and the side bar of the editor. Select the code action of `Create method 'call()' in type 'Foo'` to fix the error.
23+
4. Save all the files, and invoke VSCode command "Java: Force Java compilation". There should be no errors.
24+
5. Typing the following file of code into the App.main method, the completion should work for File and there should be two errors in the problem view.
25+
```java
26+
File f = new File("demo.txt");
27+
```
28+
6. Invoke the context menu command `Source Action...` ==> `Organize Imports`, there should be only one warning remains in the problem view.
29+
30+
## Maven
31+
1. Open .\resources\maven\salut. After the language server is initialized, check the status bar icon is :thumbsup:, and the problems views has several warnings but without errors.
32+
2. Editing experience is correctly working including diagnostics, code completion and code actions.
33+
34+
## Maven - Multimodule
35+
1. Open .\resources\maven\multimodule. After the language server is initialized, check the status bar icon is :thumbsup:, and there should be no errors/warning in the problems view.
36+
2. Open Foo.java file, make sure the editing experience is correctly working including diagnostics, code completion and code action on both modules.
37+
- module1\Foo.java
38+
- module2\Foo.java
39+
40+
## Gradle
41+
1. Open .\resources\gradle\simple-gradle. After the language server is initialized, check the status bar icon is :thumbsup:, and there should be no errors/problems in the problems view.
42+
2. Open Foo.java file, make sure the editing experience is correctly working including diagnostics, code completion and code action
43+
44+
## Maven - Java 11
45+
1. Install JDK 11, and change the VSCode java.home to the JDK 11 path.
46+
2. Open .\resources\maven\salut-java11. After the language server is initialized, check the status bar icon is :thumbsup:, and there should be no errors/problems in the problems view.
47+
3. Open Bar.java, make sure the editing experience is correctly working including diagnostics, code completion and code action
48+
49+
## Gradle - Java 11
50+
1. Install JDK 11.
51+
2. Open .\resources\gradle\gradle-11. After the language server is initialized, check the status bar icon is :thumbsup:, and there should be no errors/problems in the problems view.
52+
2. Open Foo.java file, make sure the editing experience is correctly working including diagnostics, code completion and code action.
53+
54+
## Single file
55+
1. Open/Create an empty folder
56+
2. Add a new Java file, name it Test.java. Check the language server is initialized, and the status bar icon is :thumbsup: after that.
57+
3. Type code snippet `class` to generate the class body, type `main` to generate the main methods.
58+
4. In the Test.java file, make sure the editing experience is correctly working including diagnostics, code completion and code action.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
4+
<classpathentry kind="src" path="src"/>
5+
<classpathentry kind="output" path="bin"/>
6+
</classpath>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<projectDescription>
3+
<name>simple-app</name>
4+
<comment/>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
</buildSpec>
14+
<natures>
15+
<nature>org.eclipse.jdt.core.javanature</nature>
16+
</natures>
17+
</projectDescription>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.compliance=1.8
5+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
6+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
7+
org.eclipse.jdt.core.compiler.source=1.8
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package app;
2+
3+
public class App {
4+
public static void main(String[] args) throws Exception {
5+
System.out.println("Hello Java");
6+
}
7+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package app;
2+
3+
/**
4+
* Bar
5+
*/
6+
public class Bar {
7+
8+
public void name() {
9+
Foo f = new Foo();
10+
f.call();
11+
}
12+
}

test/resources/projects/eclipse/simple-app/src/app/Foo.java

Whitespace-only changes.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* This file was generated by the Gradle 'init' task.
3+
*
4+
* This is a general purpose Gradle build.
5+
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
6+
*/
7+
plugins {
8+
id 'java'
9+
}
10+
11+
sourceCompatibility = '11'
12+
targetCompatibility = '11'
13+
version = '0.0.1-SNAPSHOT'
Binary file not shown.

0 commit comments

Comments
 (0)