1 /*
2 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
44 /**
45 * Common library for various test helper functions.
46 */
47 public final class Utils {
48
49 /**
50 * Returns the sequence used by operating system to separate lines.
51 */
52 public static final String NEW_LINE = System.getProperty("line.separator");
53
54 /**
55 * Returns the value of 'test.vm.opts'system property.
56 */
57 public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "").trim();
58
59 /**
60 * Returns the value of 'test.java.opts'system property.
61 */
62 public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim();
63
64 private static Unsafe unsafe = null;
65
66 /**
67 * Returns the value of 'test.timeout.factor' system property
68 * converted to {@code double}.
69 */
70 public static final double TIMEOUT_FACTOR;
71 static {
72 String toFactor = System.getProperty("test.timeout.factor", "1.0");
73 TIMEOUT_FACTOR = Double.parseDouble(toFactor);
74 }
75
76 private Utils() {
77 // Private constructor to prevent class instantiation
78 }
79
80 /**
81 * Returns the list of VM options.
82 *
83 * @return List of VM options
|
1 /*
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
44 /**
45 * Common library for various test helper functions.
46 */
47 public final class Utils {
48
49 /**
50 * Returns the sequence used by operating system to separate lines.
51 */
52 public static final String NEW_LINE = System.getProperty("line.separator");
53
54 /**
55 * Returns the value of 'test.vm.opts'system property.
56 */
57 public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "").trim();
58
59 /**
60 * Returns the value of 'test.java.opts'system property.
61 */
62 public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim();
63
64 public static final String TEST_JDK = System.getProperty("test.jdk");
65
66 public static final String COMPILE_JDK= System.getProperty("compile.jdk", TEST_JDK);
67
68 public static final String TEST_SRC = System.getProperty("test.src", "").trim();
69
70 public static final String TEST_CLASSES = System.getProperty("test.classes", ".");
71
72
73 private static Unsafe unsafe = null;
74
75 /**
76 * Returns the value of 'test.timeout.factor' system property
77 * converted to {@code double}.
78 */
79 public static final double TIMEOUT_FACTOR;
80 static {
81 String toFactor = System.getProperty("test.timeout.factor", "1.0");
82 TIMEOUT_FACTOR = Double.parseDouble(toFactor);
83 }
84
85 private Utils() {
86 // Private constructor to prevent class instantiation
87 }
88
89 /**
90 * Returns the list of VM options.
91 *
92 * @return List of VM options
|