< prev index next >
test/jtreg-ext/requires/VMProps.java
Print this page
rev 2327 : 8170228: register closed @requires property setter
Reviewed-by:
*** 23,32 ****
--- 23,33 ----
package requires;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
+ import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
*** 60,70 ****
map.put("vm.flightRecorder", vmFlightRecorder());
map.put("vm.simpleArch", vmArch());
map.put("vm.debug", vmDebug());
vmGC(map); // vm.gc.X = true/false
! dump(map);
return map;
}
/**
* @return vm.simpleArch value of "os.simpleArch" property of tested JDK.
--- 61,71 ----
map.put("vm.flightRecorder", vmFlightRecorder());
map.put("vm.simpleArch", vmArch());
map.put("vm.debug", vmDebug());
vmGC(map); // vm.gc.X = true/false
! VMProps.dump(map);
return map;
}
/**
* @return vm.simpleArch value of "os.simpleArch" property of tested JDK.
*** 178,196 ****
* This functionality could be helpful to know context in the real
* execution.
*
* @param map
*/
! protected void dump(Map<String, String> map) {
String dumpFileName = System.getProperty("vmprops.dump");
if (dumpFileName == null) {
return;
}
List<String> lines = new ArrayList<>();
map.forEach((k, v) -> lines.add(k + ":" + v));
try {
! Files.write(Paths.get(dumpFileName), lines);
} catch (IOException e) {
throw new RuntimeException("Failed to dump properties into '"
+ dumpFileName + "'", e);
}
}
--- 179,197 ----
* This functionality could be helpful to know context in the real
* execution.
*
* @param map
*/
! protected static void dump(Map<String, String> map) {
String dumpFileName = System.getProperty("vmprops.dump");
if (dumpFileName == null) {
return;
}
List<String> lines = new ArrayList<>();
map.forEach((k, v) -> lines.add(k + ":" + v));
try {
! Files.write(Paths.get(dumpFileName), lines, StandardOpenOption.APPEND);
} catch (IOException e) {
throw new RuntimeException("Failed to dump properties into '"
+ dumpFileName + "'", e);
}
}
< prev index next >