Skip to content

Commit 8da068a

Browse files
authored
Update testplan for setting environment variables. (#394)
* Update testplan for setting environment variables. * Update TestPlan.md
1 parent e0335fa commit 8da068a

5 files changed

Lines changed: 64 additions & 0 deletions

File tree

TestPlan.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,3 +419,13 @@ Exception in thread "main" java.lang.IllegalStateException
419419
7. Verify that the program starts, and there is no information in "watch" and "callstack" view.
420420
8. Click the "pause" button in the toolbar, it should NOT pause the program.
421421
9. Click the "stop" button in the toolbar, it should stop the program.
422+
423+
424+
## Environment Variables
425+
1. Open `26.environmentVariables` in vscode.
426+
2. Press <kbd>F5</kbd> to start.
427+
3. Verify the output in Debug Console should be as following:
428+
```
429+
CustomEnv: This env is for test plan.
430+
SystemPath: <value of PATH >
431+
```
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="src" path="src/main/java"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8/"/>
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"?>
2+
<projectDescription>
3+
<name>26.environmentVariables</name>
4+
<comment></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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"type": "java",
10+
"name": "Debug (Launch)-EnvrionmentVariable<26.environmentVariables>",
11+
"request": "launch",
12+
"cwd": "${workspaceFolder}",
13+
"console": "internalConsole",
14+
"stopOnEntry": false,
15+
"mainClass": "EnvrionmentVariable",
16+
"args": "",
17+
"projectName": "26.environmentVariables",
18+
"env": {
19+
"CUSTOM_ENV_FOR_TEST_PLAN": "This env is for test plan."
20+
}
21+
}
22+
]
23+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public class EnvrionmentVariable {
2+
public static void main(String[] args) {
3+
String customEnv = System.getenv("CUSTOM_ENV_FOR_TEST_PLAN");
4+
String systemPath = System.getenv("PATH");
5+
System.out.println(String.format("CustomEnv: %s", customEnv));
6+
System.out.println(String.format("SystemPath: %s", systemPath));
7+
}
8+
}

0 commit comments

Comments
 (0)