jdk/test/java/security/testlibrary/Proc.java
changeset 43803 e1881d258206
parent 42338 a60f280f803c
equal deleted inserted replaced
43802:5f95a1b1f73d 43803:e1881d258206
     1 /*
     1 /*
     2  * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   174     // Specifies a Java system property. Can be called multiple times.
   174     // Specifies a Java system property. Can be called multiple times.
   175     public Proc prop(String a, String b) {
   175     public Proc prop(String a, String b) {
   176         prop.put(a, b);
   176         prop.put(a, b);
   177         return this;
   177         return this;
   178     }
   178     }
       
   179     // Inherit the value of a system property
       
   180     public Proc inheritProp(String k) {
       
   181         String v = System.getProperty(k);
       
   182         if (v != null) {
       
   183             prop.put(k, v);
       
   184         }
       
   185         return this;
       
   186     }
   179     // Sets classpath. If not called, Proc will choose a classpath. If called
   187     // Sets classpath. If not called, Proc will choose a classpath. If called
   180     // with no arg, no classpath will be used. Can be called multiple times.
   188     // with no arg, no classpath will be used. Can be called multiple times.
   181     public Proc cp(String... s) {
   189     public Proc cp(String... s) {
   182         if (cp == null) {
   190         if (cp == null) {
   183             cp = new ArrayList<>();
   191             cp = new ArrayList<>();