8209917: fix TODO in GatherDiagnosticInfoObserver

Reviewed-by: jjg, dholmes
This commit is contained in:
Igor Ignatyev 2019-06-10 17:11:04 -07:00
parent 6758853b54
commit 6a7c8b3e01

View File

@ -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. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,7 +26,7 @@ package jdk.test.failurehandler.jtreg;
import com.sun.javatest.Harness; import com.sun.javatest.Harness;
import com.sun.javatest.Parameters; import com.sun.javatest.Parameters;
import com.sun.javatest.TestResult; import com.sun.javatest.TestResult;
import com.sun.javatest.InterviewParameters; import com.sun.javatest.regtest.config.RegressionParameters;
import jdk.test.failurehandler.*; import jdk.test.failurehandler.*;
import java.io.File; import java.io.File;
@ -46,8 +46,8 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer {
public static final String LOG_FILENAME = "environment.log"; public static final String LOG_FILENAME = "environment.log";
public static final String ENVIRONMENT_OUTPUT = "environment.html"; public static final String ENVIRONMENT_OUTPUT = "environment.html";
private String compileJdk; private Path compileJdk;
private String testJdk; private Path testJdk;
/* /*
* The harness calls this method after each test. * The harness calls this method after each test.
@ -80,7 +80,7 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer {
log.printf("%s ---%n", name); log.printf("%s ---%n", name);
GathererFactory gathererFactory = new GathererFactory( GathererFactory gathererFactory = new GathererFactory(
OS.current().family, workDir, log, OS.current().family, workDir, log,
Paths.get(testJdk), Paths.get(compileJdk)); testJdk, compileJdk);
gatherEnvInfo(workDir, name, log, gatherEnvInfo(workDir, name, log,
gathererFactory.getEnvironmentInfoGatherer()); gathererFactory.getEnvironmentInfoGatherer());
} catch (Throwable e) { } catch (Throwable e) {
@ -117,12 +117,9 @@ public class GatherDiagnosticInfoObserver implements Harness.Observer {
*/ */
@Override @Override
public void startingTestRun(Parameters params) { public void startingTestRun(Parameters params) {
// TODO find a better way to get JDKs RegressionParameters rp = (RegressionParameters) params;
InterviewParameters rp = (InterviewParameters) params; compileJdk = rp.getCompileJDK().getAbsoluteFile().toPath();
Map<String, String> map = new HashMap<>(); testJdk = rp.getTestJDK().getAbsoluteFile().toPath();
rp.save(map);
compileJdk = map.get("regtest.compilejdk");
testJdk = map.get("regtest.testjdk");
} }
@Override @Override