From 42bc84d3496204cd552803e7b3dbd08badafe673 Mon Sep 17 00:00:00 2001 From: Sophia Guo Date: Thu, 5 Nov 2020 10:14:55 -0500 Subject: [PATCH] Set vm.bits property Fail the test harness if property is wrong Signed-off-by: Sophia Guo --- .../jtreg-ext/requires/OpenJ9PropsExt.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java b/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java index d3047068e0f..96cdedcdfa0 100644 --- a/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java +++ b/closed/test/jtreg-ext/requires/OpenJ9PropsExt.java @@ -1,6 +1,6 @@ /* * =========================================================================== - * (c) Copyright IBM Corp. 2019, 2019 All Rights Reserved + * (c) Copyright IBM Corp. 2019, 2020 All Rights Reserved * =========================================================================== * * This code is free software; you can redistribute it and/or modify it @@ -35,10 +35,26 @@ public class OpenJ9PropsExt implements Callable> { public Map call() { Map map = new HashMap<>(); - map.put("vm.graal.enabled", "false"); - + try { + map.put("vm.graal.enabled", "false"); + map.put("vm.bits", vmBits()); + } + catch (Exception e) { + e.printStackTrace(); + System.exit(1); + } return map; } + /** + * @return VM bitness, the value of the "sun.arch.data.model" property. + */ + protected String vmBits() throws Exception { + String dataModel = System.getProperty("sun.arch.data.model"); + if (dataModel != null) { + return dataModel; + } else { + throw new Exception("Can't get 'sun.arch.data.model' property"); + } + } } -