8224778: test/jdk/demo/jfc/J2Ddemo/J2DdemoTest.java cannot find J2Ddemo.jar
authorprr
Mon, 27 May 2019 12:24:26 -0700
changeset 55183 4929c53ff29d
parent 55182 779a8d44523b
child 55184 8cddb14bb234
8224778: test/jdk/demo/jfc/J2Ddemo/J2DdemoTest.java cannot find J2Ddemo.jar Reviewed-by: erikj, psadhukhan
make/RunTests.gmk
test/jdk/demo/jfc/J2Ddemo/J2DdemoTest.java
--- a/make/RunTests.gmk	Fri May 24 13:52:33 2019 -0700
+++ b/make/RunTests.gmk	Mon May 27 12:24:26 2019 -0700
@@ -881,7 +881,8 @@
     $1_JTREG_BASIC_OPTIONS += -e:JIB_HOME=$$(JIB_HOME)
   endif
 
-  $1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_GRAAL_DIR=${TEST_IMAGE_DIR}/hotspot/jtreg/graal
+  $1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_DIR=$(TEST_IMAGE_DIR)
+  $1_JTREG_BASIC_OPTIONS += -e:TEST_IMAGE_GRAAL_DIR=$(TEST_IMAGE_DIR)/hotspot/jtreg/graal
 
   ifneq ($$(JTREG_FAILURE_HANDLER_OPTIONS), )
     $1_JTREG_LAUNCHER_OPTIONS += -Djava.library.path="$(JTREG_FAILURE_HANDLER_DIR)"
--- a/test/jdk/demo/jfc/J2Ddemo/J2DdemoTest.java	Fri May 24 13:52:33 2019 -0700
+++ b/test/jdk/demo/jfc/J2Ddemo/J2DdemoTest.java	Mon May 27 12:24:26 2019 -0700
@@ -39,7 +39,7 @@
         DemoRun test;
 
         /* Run the J2Ddemo.jar with the -runs=1 option */
-        test = new DemoRun("demo/jfc/J2Ddemo/J2Ddemo.jar", "-runs=1");
+        test = new DemoRun("jfc/J2Ddemo/J2Ddemo.jar", "-runs=1");
         test.runit();
 
         /* Make sure patterns in output look ok */
@@ -158,7 +158,18 @@
             }
             cmdLine += (cmd[i++] = "-jar");
             cmdLine += " ";
-            cmdLine += (cmd[i++] = sdk_home + File.separator + demo_name);
+            String demo_path;
+            String test_dir = System.getenv("TEST_IMAGE_DIR");
+            System.out.println("TEST_IMAGE_DIR="+test_dir);
+            if (test_dir != null) {
+                demo_path = test_dir + File.separator + "jdk" + File.separator +
+                            "demos" + File.separator + demo_name;
+            } else {
+                demo_path = sdk_home + File.separator +
+                            "demo" + File.separator + demo_name;
+            }
+            System.out.println("demo_path="+demo_path);
+            cmdLine += cmd[i++] = demo_path;
             cmdLine += " ";
             cmdLine += (cmd[i++] = demo_options);