File tree Expand file tree Collapse file tree
testprojects/26.environmentVariables Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -419,3 +419,13 @@ Exception in thread "main" java.lang.IllegalStateException
4194197 . Verify that the program starts, and there is no information in "watch" and "callstack" view.
4204208 . Click the "pause" button in the toolbar, it should NOT pause the program.
4214219 . 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+ ```
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments