Skip to content

Commit 58e11da

Browse files
Add test case for enable toString object view (#593)
Signed-off-by: Jinbo Wang <[email protected]>
1 parent ad82471 commit 58e11da

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

TestPlan.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,13 @@ Exception in thread "main" java.lang.IllegalStateException
523523
524524
![image](https://user-images.githubusercontent.com/14052197/56104630-1e89d680-5f6b-11e9-87a5-8a17a2ed33b5.png)
525525
526+
## Show toString object view
527+
1. Open `28.debugfeatures` project in VS Code.
528+
2. Open `Variables.java` file, and add a breakpoint at line 39.
529+
3. Click Debug CodeLens, check the Variable viewlet.
530+
4. Verify the highlight value in the screenshot below.
531+
![image](https://user-images.githubusercontent.com/14052197/58676978-c9741980-838c-11e9-9f0e-48658fa06bd7.png)
532+
526533
## Enable Java 12 preview for standalone Java files
527534
1. Install JDK-12.
528535
2. Open `28.debugfeatures` project in VS Code, and open `Java12Preview.java` file.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
import java.util.*;
2+
3+
public class Variables {
4+
5+
public static void main(String[] args) {
6+
int[] a = new int[100000];
7+
Integer intObj = new Integer(20);
8+
Float floatObj = new Float("1.354");
9+
Character character = new Character('a');
10+
Boolean bool = new Boolean(true);
11+
12+
Map<String, String> emptyMap = new HashMap<>();
13+
Map<String, Integer> bookset = new LinkedHashMap<>();
14+
bookset.put("Algorithm Introduction", 60);
15+
bookset.put("Thinking in JAVA", 50);
16+
17+
Map<String, Map<String, Integer>> smallStore = new HashMap<>();
18+
smallStore.put("Computer Science", bookset);
19+
20+
Map<String, Map<String, Integer>> bigStore = new HashMap<>();
21+
for (int i = 0; i < 100000; i++) {
22+
bigStore.put("key" + i, bookset);
23+
}
24+
25+
List<String> smallList = Arrays.asList("Algorithm Introduction");
26+
List<String> bigList = new ArrayList<>();
27+
for (int i = 0; i < 100000; i++) {
28+
bigList.add("key" + i);
29+
}
30+
31+
School school = new School();
32+
Person person = new Person();
33+
Person person1 = null;
34+
Employee employee = new Employee();
35+
StringException stringException = new StringException();
36+
NullString nullString =new NullString();
37+
Date date = new Date();
38+
String name = "Test";
39+
System.out.println("Exit.");
40+
}
41+
42+
public static class School {
43+
String name = "test";
44+
45+
}
46+
47+
public static class Person {
48+
String name = "jinbo";
49+
50+
@Override
51+
public String toString() {
52+
return "Person [name=" + name + "]";
53+
}
54+
}
55+
56+
public static class Employee extends Person {
57+
58+
}
59+
60+
public static class StringException {
61+
62+
@Override
63+
public String toString() {
64+
throw new RuntimeException("Unimplemented method exception");
65+
}
66+
}
67+
68+
public static class NullString {
69+
70+
@Override
71+
public String toString() {
72+
return null;
73+
}
74+
}
75+
}

0 commit comments

Comments
 (0)