Path: blob/master/test/jdk/java/rmi/testlibrary/TestParams.java
41149 views
/*1* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/**24*25*/26import java.io.File;2728/**29* Setup static variables to represent properties in test environment.30*/31public class TestParams {3233/** variables that hold value property values */34public static final String testSrc;35public static final String testClasses;36public static final String testClassPath;3738/** name of default security policy for test JVM */39public static final String defaultPolicy;4041/** name of default security policy for RegistryVM */42public static final String defaultRegistryPolicy;4344/** name of default security manager */45public static final String defaultSecurityManager;4647/** VM options string */48public static final String testVmOpts;4950/** Java options string */51public static final String testJavaOpts;5253/* Initalize commonly used strings */54static {55testSrc = TestLibrary.getProperty("test.src", ".");56testClasses = TestLibrary.getProperty("test.classes", ".");57testClassPath = TestLibrary.getProperty("test.class.path", ".");5859String dp = TestLibrary.getProperty("java.security.policy", null);60if (dp == null) {61dp = testSrc + File.separatorChar + "security.policy";62}63defaultPolicy = dp;6465defaultRegistryPolicy =66testSrc + File.separatorChar + "registry.security.policy";6768String tmp = TestLibrary.getProperty("java.security.manager", null);69if (tmp == null || tmp.equals("allow")) {70tmp = "java.lang.SecurityManager";71}72defaultSecurityManager = tmp;7374testVmOpts = TestLibrary.getProperty("test.vm.opts", "");7576testJavaOpts = TestLibrary.getProperty("test.java.opts", "");77}78}798081