Add the new features to the test plan (#563)

* Add the new features to the test plan

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>

* comment jdk-12 by default

Signed-off-by: Jinbo Wang <jinbwan@microsoft.com>
This commit is contained in:
Jinbo Wang 2019-04-15 13:19:27 +08:00 committed by GitHub
parent 85495a97a6
commit 99357f28bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 102 additions and 1 deletions

View File

@ -488,4 +488,34 @@ Exception in thread "main" java.lang.IllegalStateException
"shortenCommandLine": ""/"auto"/"jarmanifest"/"argfile", // argfile requires your Java version is 9 and higher.
"console": ""/"internalConsole"/"integratedTerminal"/"externalTerminal"
```
```
## Jump to source code when clicking stack trace in DEBUG CONSOLE
1. Open `28.debugfeatures` project in VS Code.
2. Open `StackTrace.java` file.
3. Click Run or Debug CodeLens, check the DEBUG CONSOLE. It's expected to render the source link for each stack trace line, and clicking the link should open the associated Java file in the editor.
![image](https://user-images.githubusercontent.com/14052197/56104487-7ecc4880-5f6a-11e9-89aa-b9c66b6f318b.png)
## Show the logical structure view for the Map and List variables
1. Open `28.debugfeatures` project in VS Code.
2. Open `LogicalStructure.java` file, and add a breakpoint at line 30.
3. Click Debug CodeLens, check the Variable viewlet.
- emptyMap - non-expandable
- bookset - Show two children (0: LinkedHashMap$Entry, 1: LinkedHashMap$Entry)
- bigStore - Lazy loading the children and show the index range first `[0..9999]` ...
- emptyList - non-expandable
- list - Show two children (0: LogicalStructure$Foo, 1: LogicalStructure$Foo).
- bigList - Lazy loading the children and show the index range first `[0..9999]` ...
![image](https://user-images.githubusercontent.com/14052197/56104630-1e89d680-5f6b-11e9-87a5-8a17a2ed33b5.png)
## Enable Java 12 preview for standalone Java files
1. Install JDK-12.
2. Open `28.debugfeatures` project in VS Code, and open `Java12Preview.java` file.
3. Uncomment `"java.home"` in `./vscode/settings.json`.
4. Run VS Code commmand `Java: clean Java language server workspace`, and click `Restart and delete` button in the prompted message box to reload VS Code.
5. Add a breakpoint at line 7 of `Java12Preview.java`, and click Debug CodeLens. The debugger should run successfully.
6. Open VS Code menu `Help -> Open Process Explorer`, find the Java Debuggger process in the `Process Explorer`. And its command line string should contain `--enable-preview` flag.
![image](https://user-images.githubusercontent.com/14052197/56105328-40d12380-5f6e-11e9-94bc-8f3f3d298750.png)

View File

@ -0,0 +1,5 @@
{
// "java.home": "C:\\Program Files\\Java\\jdk-12",
"java.debug.settings.showLogicalStructure": true,
"java.debug.settings.forceBuildBeforeLaunch": false
}

View File

@ -0,0 +1,13 @@
public class Java12Preview {
public static void main(String[] args) {
String week = "MONDAY";
switch (week) {
case "MONDAY" -> {
System.out.println("This is Monday");
}
case "TUESDAY" -> System.out.println("This is TUESDAY");
default -> System.out.println("Unknown day.");
}
}
}

View File

@ -0,0 +1,40 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class LogicalStructure {
public static void main(String[] args) {
int[] arrays = new int[] { 1 };
Object obj = new Object();
Map<String, String> emptyMap = new HashMap<>();
Map<String, Integer> bookset = new LinkedHashMap<>();
bookset.put("Algorithm Introduction", 60);
bookset.put("Thinking in JAVA", 50);
Map<String, Map<String, Integer>> bigStore = new HashMap<>();
for (int i = 0; i < 100000; i++) {
bigStore.put("key" + i, bookset);
}
List<String> emptyList = new ArrayList<>();
List<Foo> list = Arrays.asList(new Foo("One"), new Foo("Two"));
List<String> bigList = new ArrayList<>();
for (int i = 0; i < 100000; i++) {
bigList.add("key" + i);
}
System.out.println("Exit.");
}
static class Foo {
private String name;
Foo(String name) {
this.name = name;
}
}
}

View File

@ -0,0 +1,13 @@
public class StackTrace {
public static void main(String[] args) {
System.out.println("begin.");
new RuntimeException("test").printStackTrace();
System.out.println("finish.");
new RuntimeException("test1").printStackTrace(System.out);
System.out.println("exit");
throw new RuntimeException("test2");
}
}