diff --git a/make/test/JtregNativeHotspot.gmk b/make/test/JtregNativeHotspot.gmk index 1e5fc8b4a49..9b32fc2935d 100644 --- a/make/test/JtregNativeHotspot.gmk +++ b/make/test/JtregNativeHotspot.gmk @@ -48,6 +48,21 @@ BUILD_HOTSPOT_JTREG_OUTPUT_DIR := $(OUTPUTDIR)/support/test/hotspot/jtreg/native BUILD_HOTSPOT_JTREG_IMAGE_DIR := $(TEST_IMAGE_DIR)/hotspot/jtreg +################################################################################ +# Former VM TestBase tests. +################################################################################ + +VM_TESTBASE_DIR := $(TOPDIR)/test/hotspot/jtreg/vmTestbase + +VM_SHARE_INCLUDES := \ + -I$(VM_TESTBASE_DIR)/vm/share \ + -I$(VM_TESTBASE_DIR)/nsk/share/native \ + -I$(VM_TESTBASE_DIR)/nsk/share/jni + +BUILD_HOTSPOT_JTREG_LIBRARIES_CFLAGS_libProcessUtils := $(VM_SHARE_INCLUDES) + +################################################################################ + # Platform specific setup ifneq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_ARCH), solaris-sparc) BUILD_HOTSPOT_JTREG_EXCLUDE += liboverflow.c exeThreadSignalMask.c diff --git a/test/hotspot/jtreg/vmTestbase/ExecDriver.java b/test/hotspot/jtreg/vmTestbase/ExecDriver.java new file mode 100644 index 00000000000..46da6be51b6 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/ExecDriver.java @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jdk.test.lib.Platform; +import jdk.test.lib.Utils; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; + +/** + * Starts a new process to execute a command. + *

Usage: --java|--cmd|--launcher + + *

If {@code --cmd} flag is specified, the arguments are treated as + * a program to run and its arguments. Non-zero exit code of the created process + * will be reported as an {@link AssertionError}. + *

If {@code --java} flag is specified, the arguments are passed to {@code java} + * from JDK under test. If exit code doesn't equal to 0 or 95, {@link AssertionError} + * will be thrown. + *

If {@code --launcher} flag is specified, the arguments treated similar as + * for {@code --cmd}, but the started process will have the directory which + * contains {@code jvm.so} in dynamic library path, and {@code test.class.path} + * as CLASSPATH environment variable. Exit codes are checked as in + * {@code --java}, i.e. 0 or 95 means pass. + */ +public class ExecDriver { + public static void main(String[] args) throws IOException, InterruptedException { + boolean java = false; + boolean launcher = false; + + String type = args[0]; + switch (type) { + case "--java": + String[] oldArgs = args; + int count; + String libraryPath = System.getProperty("test.nativepath"); + if (libraryPath != null && !libraryPath.isEmpty()) { + count = 4; + args = new String[args.length + 3]; + args[3] = "-Djava.library.path=" + libraryPath; + } else { + count = 3; + args = new String[args.length + 2]; + } + args[0] = javaBin(); + args[1] = "-cp"; + args[2] = Utils.TEST_CLASS_PATH; + System.arraycopy(oldArgs, 1, args, count, oldArgs.length - 1); + java = true; + break; + case "--launcher": + java = true; + launcher = true; + case "--cmd": + args = Arrays.copyOfRange(args, 1, args.length); + break; + default: + throw new Error("unknown type: " + type); + } + // adding 'test.vm.opts' and 'test.java.opts' + if (java) { + String[] oldArgs = args; + String[] testJavaOpts = Utils.getTestJavaOpts(); + if (testJavaOpts.length > 0) { + args = new String[args.length + testJavaOpts.length]; + // bin/java goes before options + args[0] = oldArgs[0]; + // then external java options + System.arraycopy(testJavaOpts, 0, args, 1, testJavaOpts.length); + // and then options and args from a test + System.arraycopy(oldArgs, 1, args, 1 + testJavaOpts.length, oldArgs.length - 1); + } + } + String command = Arrays.toString(args); + System.out.println("exec " + command); + + ProcessBuilder pb = new ProcessBuilder(args); + // adding jvm.so to library path + if (launcher) { + Path dir = Paths.get(Utils.TEST_JDK); + String name; + if (Platform.isWindows()) { + dir = dir.resolve("bin") + .resolve(variant()) + .toAbsolutePath(); + name = "PATH"; + } else { + dir = dir.resolve("lib") + .resolve(variant()) + .toAbsolutePath(); + name = Platform.isOSX() ? "DYLD_LIBRARY_PATH" : "LD_LIBRARY_PATH"; + } + + System.out.println(" with " + name + " = " + + pb.environment() + .merge(name, dir.toString(), (x, y) -> y + File.pathSeparator + x)); + System.out.println(" with CLASSPATH = " + + pb.environment() + .put("CLASSPATH", Utils.TEST_CLASS_PATH)); + } + Process p = pb.start(); + // inheritIO does not work as expected for @run driver + new Thread(() -> copy(p.getInputStream(), System.out)).start(); + new Thread(() -> copy(p.getErrorStream(), System.out)).start(); + int exitCode = p.waitFor(); + + if (exitCode != 0 && (!java || exitCode != 95)) { + throw new AssertionError(command + " exit code is " + exitCode); + } + } + + private static String variant() { + if (Platform.isServer()) { + return "server"; + } else if (Platform.isClient()) { + return "client"; + } else if (Platform.isMinimal()) { + return "minimal"; + } else { + throw new Error("TESTBUG: unsuppported vm variant"); + } + } + + + private static void copy(InputStream is, OutputStream os) { + byte[] buffer = new byte[1024]; + int n; + try (InputStream close = is) { + while ((n = is.read(buffer)) != -1) { + os.write(buffer, 0, n); + } + os.flush(); + } catch (IOException e) { + e.printStackTrace(); + } + } + + private static String javaBin() { + return Paths.get(Utils.TEST_JDK) + .resolve("bin") + .resolve("java") + .toAbsolutePath() + .toString(); + } +} + diff --git a/test/hotspot/jtreg/vmTestbase/PropertyResolvingWrapper.java b/test/hotspot/jtreg/vmTestbase/PropertyResolvingWrapper.java new file mode 100644 index 00000000000..52ed1c1122b --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/PropertyResolvingWrapper.java @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2017, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.InvocationTargetException; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +/** + * Replaces all {@code ${}} with value of corresponding property({@code X}), + * resulting string is handled similarly to {@code @run main} in jtreg. + * In other words, {@code main} of first token will be executed with the rest + * tokens as arguments. + * + * If one of properties can't be resolved, {@link Error} will be thrown. + */ +public class PropertyResolvingWrapper { + private static final Properties properties; + static { + Properties p = System.getProperties(); + String name = p.getProperty("os.name"); + String arch = p.getProperty("os.arch"); + String family; + String simple_arch; + + // copy from jtreg/src/share/classes/com/sun/javatest/regtest/config/OS.java + if (name.startsWith("AIX")) + family = "aix"; + else if (name.startsWith("Linux")) + family = "linux"; + else if (name.startsWith("Mac") || name.startsWith("Darwin")) + family = "mac"; + else if (name.startsWith("OS400") || name.startsWith("OS/400") ) + family = "os400"; + else if (name.startsWith("SunOS") || name.startsWith("Solaris")) + family = "solaris"; + else if (name.startsWith("Windows")) + family = "windows"; + else + family = name.replaceFirst("^([^ ]+).*", "$1"); // use first word of name + + if (arch.contains("64") + && !arch.equals("ia64") + && !arch.equals("ppc64") + && !arch.equals("ppc64le") + && !arch.equals("zArch_64") + && !arch.equals("aarch64")) + simple_arch = "x64"; + else if (arch.contains("86")) + simple_arch = "i586"; + else if (arch.equals("ppc") || arch.equals("powerpc")) + simple_arch = "ppc"; + else if (arch.equals("s390x") || arch.equals("zArch_64")) + simple_arch = "s390x"; + else + simple_arch = arch; + + p.setProperty("os.family", family); + p.setProperty("os.simpleArch", simple_arch); + properties = p; + } + + public static void main(String[] args) throws Throwable { + List command = new ArrayList<>(args.length); + for (int i = 0; i < args.length; ++i) { + StringBuilder arg = new StringBuilder(args[i]); + while (i < args.length - 1 + && (arg.chars() + .filter(c -> c == '"') + .count() % 2) != 0) { + arg.append(" ") + .append(args[++i]); + } + command.add(eval(arg.toString())); + } + System.out.println("run " + command); + try { + Class.forName(command.remove(0)) + .getMethod("main", String[].class) + .invoke(null, new Object[]{command.toArray(new String[0])}); + } catch (InvocationTargetException e) { + Throwable t = e.getCause(); + t = t != null ? t : e; + throw t; + } + } + + private static String eval(String string) { + int index; + int current = 0; + StringBuilder result = new StringBuilder(); + while (current < string.length() && (index = string.indexOf("${", current)) >= 0) { + result.append(string.substring(current, index)); + int endName = string.indexOf('}', index); + current = endName + 1; + String name = string.substring(index + 2, endName); + String value = properties.getProperty(name); + if (value == null) { + throw new Error("can't find property " + name); + } + result.append(value); + } + if (current < string.length()) { + result.append(string.substring(current)); + } + int length = result.length(); + + if (length > 1 && result.charAt(0) == '"' && result.charAt(length - 1) == '"') { + result.deleteCharAt(length - 1); + result.deleteCharAt(0); + } + return result.toString(); + } +} diff --git a/test/hotspot/jtreg/vmTestbase/README.md b/test/hotspot/jtreg/vmTestbase/README.md new file mode 100644 index 00000000000..86f51382138 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/README.md @@ -0,0 +1,10 @@ +# VM Testbase landing + +This directory serves as a _temporary_ landing place for tests converted from so-called VM testbase. +Most of these tests have been written a long time ago, don't meet modern coding +standards, guidelines and are in need of reworking. +Eventually, all the tests located here should be reworked and moved accordingly to +regular JTReg test suite directory layout convention, i.e. following the same +layout as product code as close as possible. + +New tests must **not** be added into this directory. diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/AbstractGoldChecker.java b/test/hotspot/jtreg/vmTestbase/nsk/share/AbstractGoldChecker.java new file mode 100644 index 00000000000..a348346fe91 --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/AbstractGoldChecker.java @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2008, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package nsk.share; +import java.io.UnsupportedEncodingException; + +public abstract class AbstractGoldChecker { + + private final StringBuffer sb = new StringBuffer(); + + protected abstract String getGoldenString(); + + public void print(boolean b) { + sb.append(String.valueOf(b)); + } + + public void print(byte b) { + sb.append(String.valueOf(b)); + } + + public void print(char c) { + sb.append(String.valueOf(c)); + } + + public void print(int i) { + sb.append(String.valueOf(i)); + } + + public void print(long l) { + sb.append(String.valueOf(l)); + } + + public void print(float f) { + sb.append(String.valueOf(f)); + } + + public void print(double d) { + sb.append(String.valueOf(d)); + } + + public void print(String s) { + sb.append(s); + } + + public void println() { + sb.append('\n'); + } + + public void println(boolean b) { + sb.append(String.valueOf(b)); + sb.append('\n'); + } + + public void println(byte b) { + sb.append(String.valueOf(b)); + sb.append('\n'); + } + + public void println(char c) { + sb.append(String.valueOf(c)); + sb.append('\n'); + } + + public void println(int i) { + sb.append(String.valueOf(i)); + sb.append('\n'); + } + + public void println(long l) { + sb.append(String.valueOf(l)); + sb.append('\n'); + } + + public void println(float f) { + sb.append(String.valueOf(f)); + sb.append('\n'); + } + + public void println(double d) { + sb.append(String.valueOf(d)); + sb.append('\n'); + } + + public void println(String s) { + sb.append(s); + sb.append('\n'); + } + + public void check() { + String testOutput; + try { + testOutput = new String(sb.toString().getBytes("US-ASCII"), "US-ASCII"); + } catch (UnsupportedEncodingException e) { + throw new TestFailure(e); + } + + String goldOutput = getGoldenString(); + if (!compare(testOutput, goldOutput)) { + throw new TestFailure( + "Gold comparison failed\n" + + "\n" + + "Test output:\n" + + "============\n" + + "\n" + + testOutput + + "\n" + + "------------\n" + + "\n" + + "Gold output:\n" + + "============\n" + + "\n" + + goldOutput + + "\n" + + "------------\n" + + "\n" + ); + } + } + + public boolean compare(String src, String dst) { + int i1 = 0; + int i2 = 0; + + int src_len = src.length(); + int dst_len = dst.length(); + + while ((i1 < src_len) && (i2 < dst_len)) { + + char c1 = src.charAt(i1++); + if ((c1 == '\r') && (i1 < src_len)) { + c1 = src.charAt(i1++); + } + + char c2 = dst.charAt(i2++); + if ((c2 == '\r') && (i2 < dst_len)) { + c2 = dst.charAt(i2++); + } + + if (c1 != c2) { + return false; + } + } + return (i1 == src_len) && (i2 == dst_len); + } +} diff --git a/test/hotspot/jtreg/vmTestbase/nsk/share/ArgumentParser.java b/test/hotspot/jtreg/vmTestbase/nsk/share/ArgumentParser.java new file mode 100644 index 00000000000..fe63159577d --- /dev/null +++ b/test/hotspot/jtreg/vmTestbase/nsk/share/ArgumentParser.java @@ -0,0 +1,507 @@ +/* + * Copyright (c) 2001, 2018, 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package nsk.share; + +import java.util.*; + +import nsk.share.test.StressOptions; +import nsk.share.test.Stresser; + +/** + * Parser for JDI test's command-line arguments. + *

+ * Test's command line may contain two kind of arguments, namely: + *

+ *

+ * We call raw arguments the args[] array + * passed to the test's method main(String args[]). + * ArgumentParser instance initialized with raw arguments serves to parse + * these two kinds of arguments. Use ArgumentParser(args[]) + * constructor, or setRawArguments(args[]) method + * to initialize a ArgumentParser instance with particular raw arguments. + *

+ * Arguments, started with ``-'' symbol are called options. + * They are recognized by ArgumentParser and are used by support classes + * (such as Log, Binder, etc.). + * These options should be specified in the following general form: + *

+ * or + * + * List of the recognized options with their values may be obtained by + * invoking method getOptions() that returnes + * a Properties object with options values. + * It is not recommended to get options value directly. An appropriate methods + * such as verbose(), getArch(), etc. should be used + * instead. + * Options may appear in the test command line in any order. + *

+ * All the other arguments of command line are called test arguments + * (or simply arguments). These arguments should be handled by test itself. + * Full list of the test arguments in the same order as they appears in the command line + * may be obtained by invoking method getArguments(). + *

+ * Following is the list of basic options accepted by AgrumentParser: + *

+ * Also AgrumentParser supports following stress options (see nsk.share.test.StressOptions for details): + * + *

+ * Note, that the tests from the particular subsuites have its own argument handlers + * wich accepts additional options. See jpda.DebugeeArgumentHandler, + * jdi.ArgumentHandler, jdwp.ArgumentHandler. + * + * @see #setRawArguments(String[]) + * @see #getRawArguments() + * @see #getArguments() + * @see #getOptions() + * + * @see nsk.share.jpda.DebugeeArgumentHandler + * @see nsk.share.jdwp.ArgumentHandler + * @see nsk.share.jdi.ArgumentHandler + * @see nsk.share.jvmti.ArgumentHandler + * @see nsk.share.monitoring.ArgumentHandler + */ +public class ArgumentParser { + + /** + * Raw array of command-line arguments. + * + * @see #setRawArguments(String[]) + * @see #getRawArguments() + */ + protected String rawArguments[] = null; + + /** + * Refined arguments -- raw arguments but options. + * + * @see #options + * @see #getArguments() + */ + protected String arguments[] = null; + + /** + * Recognized options for ArgumentParser class. + * + * @see #arguments + * @see #getOptions() + */ + protected Properties options = new Properties(); + + /** + * Make new ArgumentParser object with default values of otions. + * This constructor is used only to obtain default values of options. + * + * @see #setRawArguments(String[]) + */ + protected ArgumentParser() { + String[] args = new String[0]; + setRawArguments(args); + } + + /** + * Keep a copy of raw command-line arguments and parse them; + * but throw an exception on parsing error. + * + * @param args Array of the raw command-line arguments. + * + * @throws BadOption If option values are invalid. + * + * @see #setRawArguments(String[]) + * @see BadOption + */ + public ArgumentParser(String args[]) { + setRawArguments(args); + } + + /** + * Return a copy of the raw command-line arguments kept by + * this ArgumentParser instance. + * + * @throws NullPointerException If raw arguments were not + * set for this instance. + * + * @see #setRawArguments(String[]) + */ + public String[] getRawArguments() { + return (String[]) rawArguments.clone(); + } + + /** + * Return given raw command-line argument. + * + * @param index index of argument + * @return value of raw argument + */ + public String getRawArgument(int index) { + return rawArguments[index]; + } + + /** + * Return refined array of test arguments (only those of the raw + * arguments which are not recognized as options for ArgumentParser). + * + *

Note, that sintax of test arguments was not checked; + * while syntax of arguments describing ArgumentParser's options + * was checked while raw arguments were set to this ArgumentParser + * instance. + * + * @throws NullPointerException If raw arguments were not + * set for this instance. + * + * @see #setRawArguments(String[]) + * @see #getOptions() + */ + public String[] getArguments() { + return (String[]) arguments.clone(); + } + + /** + * Return list of recognized otions with their values in the form of + * Properties object. + * If no options has been recognized, this list will be empty. + * + * @see #setRawArguments(String[]) + * @see #getArguments() + */ + public Properties getOptions() { + return (Properties) options.clone(); + } + + /** + * Join specified arguments into one line using given quoting + * and separator symbols. + * + * @param args Array of the command-line arguments + * @param quote Symbol used to quote each argument + * @param separator Symbol used as separator between argumnets + * @return Single line with arguments + */ + static public String joinArguments(String args[], String quote, String separator) { + if (args.length <= 0) { + return ""; + } + String line = quote + args[0] + quote; + for (int i = 1; i < args.length; i++) { + line += separator + quote + args[i] + quote; + } + return line; + } + + /** + * Join specified arguments into one line using given quoting symbol + * and space as a separator symbol. + * + * @param args Array of the command-line arguments + * @param quote Symbol used to quote each argument + * @return Single line with arguments + */ + static public String joinArguments(String args[], String quote) { + return joinArguments(args, quote, " "); + } + + /** + * Keep a copy of command-line arguments and parse them; + * but throw an exception on parsing error. + * + * @param args Array of the raw command-line arguments. + * + * @throws BadOption If an option has invalid value. + * + * @see #getRawArguments() + * @see #getArguments() + */ + public void setRawArguments(String args[]) { + this.rawArguments = (String[]) args.clone(); + parseArguments(); + } + + /** + * Add or replace given option value in options list and in raw arguments list. + * Use specified rawPrefix while adding to raw arguments list. + * + * @see #getRawArguments() + * @see #getOptions() + */ + public void setOption(String rawPrefix, String name, String value) { + String prefix = rawPrefix + name + "="; + String arg = prefix + value; + + options.setProperty(name, value); + + int length = rawArguments.length; + boolean found = false; + for (int i = 0; i < length; i++) { + if (rawArguments[i].startsWith(prefix)) { + found = true; + rawArguments[i] = arg; + break; + } + } + + if (!found) { + String[] newRawArguments = new String[length + 1]; + for (int i = 0; i < length; i++) { + newRawArguments[i] = rawArguments[i]; + } + newRawArguments[length] = arg; + rawArguments = newRawArguments; + } + } + + /** + * Return current architecture name from ArgumentParser's + * options. + * + *

Note that null string is returning if test argument + * -arch has not been set. + * + * @see #setRawArguments(String[]) + */ + public String getArch() { + return options.getProperty("arch"); + } + + /** + * Timeout (in minutes) for test's critical section like: + * (a) awaiting for an event, or conversly (b) making sure + * that there is no unexpected event. + * + *

By default, 2 minutes is returned if option + * -waittime is not set with command line. + * + * @see TimeoutHandler + */ + public int getWaitTime() { + String val = options.getProperty("waittime", "2"); + int minutes; + try { + minutes = Integer.parseInt(val); + } catch (NumberFormatException e) { + throw new TestBug("Not integer value of \"waittime\" argument: " + val); + } + return minutes; + } + + /** + * Return boolean value of current Log mode: + *