changeset 55820:670b4794f51e

8209917: fix TODO in GatherDiagnosticInfoObserver Reviewed-by: jjg, dholmes
author iignatyev
date Mon, 10 Jun 2019 17:11:04 -0700
parents c6498066a0a5
children ddda023e6f66
files test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java	Mon Jun 10 17:33:11 2019 -0700
+++ b/test/failure_handler/src/share/classes/jdk/test/failurehandler/jtreg/GatherDiagnosticInfoObserver.java	Mon Jun 10 17:11:04 2019 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 import com.sun.javatest.Harness;
 import com.sun.javatest.Parameters;
 import com.sun.javatest.TestResult;
-import com.sun.javatest.InterviewParameters;
+import com.sun.javatest.regtest.config.RegressionParameters;
 import jdk.test.failurehandler.*;
 
 import java.io.File;
@@ -46,8 +46,8 @@
     public static final String LOG_FILENAME = "environment.log";
     public static final String ENVIRONMENT_OUTPUT = "environment.html";
 
-    private String compileJdk;
-    private String testJdk;
+    private Path compileJdk;
+    private Path testJdk;
 
     /*
      * The harness calls this method after each test.
@@ -80,7 +80,7 @@
             log.printf("%s ---%n", name);
             GathererFactory gathererFactory = new GathererFactory(
                     OS.current().family, workDir, log,
-                    Paths.get(testJdk), Paths.get(compileJdk));
+                    testJdk, compileJdk);
             gatherEnvInfo(workDir, name, log,
                     gathererFactory.getEnvironmentInfoGatherer());
         } catch (Throwable e) {
@@ -117,12 +117,9 @@
      */
     @Override
     public void startingTestRun(Parameters params) {
-        // TODO find a better way to get JDKs
-        InterviewParameters rp = (InterviewParameters) params;
-        Map<String, String> map = new HashMap<>();
-        rp.save(map);
-        compileJdk = map.get("regtest.compilejdk");
-        testJdk = map.get("regtest.testjdk");
+        RegressionParameters rp = (RegressionParameters) params;
+        compileJdk = rp.getCompileJDK().getAbsoluteFile().toPath();
+        testJdk = rp.getTestJDK().getAbsoluteFile().toPath();
     }
 
     @Override