47 /** 48 * Common library for various test helper functions. 49 */ 50 public final class Utils { 51 52 /** 53 * Returns the sequence used by operating system to separate lines. 54 */ 55 public static final String NEW_LINE = System.getProperty("line.separator"); 56 57 /** 58 * Returns the value of 'test.vm.opts' system property. 59 */ 60 public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "").trim(); 61 62 /** 63 * Returns the value of 'test.java.opts' system property. 64 */ 65 public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim(); 66 67 private static Unsafe unsafe = null; 68 69 /** 70 * Defines property name for seed value. 71 */ 72 public static final String SEED_PROPERTY_NAME = "jdk.test.lib.random.seed"; 73 74 /* (non-javadoc) 75 * Random generator with (or without) predefined seed. Depends on 76 * "jdk.test.lib.random.seed" property value. 77 */ 78 private static volatile Random RANDOM_GENERATOR; 79 80 /** 81 * Contains the seed value used for {@link java.util.Random} creation. 82 */ 83 public static final long SEED = Long.getLong(SEED_PROPERTY_NAME, new Random().nextLong()); 84 /** 85 * Returns the value of 'test.timeout.factor' system property 86 * converted to {@code double}. | 47 /** 48 * Common library for various test helper functions. 49 */ 50 public final class Utils { 51 52 /** 53 * Returns the sequence used by operating system to separate lines. 54 */ 55 public static final String NEW_LINE = System.getProperty("line.separator"); 56 57 /** 58 * Returns the value of 'test.vm.opts' system property. 59 */ 60 public static final String VM_OPTIONS = System.getProperty("test.vm.opts", "").trim(); 61 62 /** 63 * Returns the value of 'test.java.opts' system property. 64 */ 65 public static final String JAVA_OPTIONS = System.getProperty("test.java.opts", "").trim(); 66 67 /** 68 * Returns the value of 'test.src' system property. 69 */ 70 public static final String TEST_SRC = System.getProperty("test.src", "").trim(); 71 72 private static Unsafe unsafe = null; 73 74 /** 75 * Defines property name for seed value. 76 */ 77 public static final String SEED_PROPERTY_NAME = "jdk.test.lib.random.seed"; 78 79 /* (non-javadoc) 80 * Random generator with (or without) predefined seed. Depends on 81 * "jdk.test.lib.random.seed" property value. 82 */ 83 private static volatile Random RANDOM_GENERATOR; 84 85 /** 86 * Contains the seed value used for {@link java.util.Random} creation. 87 */ 88 public static final long SEED = Long.getLong(SEED_PROPERTY_NAME, new Random().nextLong()); 89 /** 90 * Returns the value of 'test.timeout.factor' system property 91 * converted to {@code double}. |