Path: blob/master/test/functional/CacheManagement/src/tests/sharedclasses/CreateConfig.java
6004 views
/*******************************************************************************1* Copyright (c) 2010, 2019 IBM Corp. and others2*3* This program and the accompanying materials are made available under4* the terms of the Eclipse Public License 2.0 which accompanies this5* distribution and is available at https://www.eclipse.org/legal/epl-2.0/6* or the Apache License, Version 2.0 which accompanies this distribution and7* is available at https://www.apache.org/licenses/LICENSE-2.0.8*9* This Source Code may also be made available under the following10* Secondary Licenses when the conditions for such availability set11* forth in the Eclipse Public License, v. 2.0 are satisfied: GNU12* General Public License, version 2 with the GNU Classpath13* Exception [1] and GNU General Public License, version 2 with the14* OpenJDK Assembly Exception [2].15*16* [1] https://www.gnu.org/software/classpath/license.html17* [2] http://openjdk.java.net/legal/assembly-exception.html18*19* SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception20*******************************************************************************/2122package tests.sharedclasses;2324import java.io.FileWriter;2526/**27* Based on input parameters and environment variables, this will create a config.properties file suitable for28* running the tests.29*/30public class CreateConfig {3132public static void main(String[] args) throws Exception {3334// Properties p = System.getProperties();35// p.list(System.out);3637// format is:38// # Which java.exe to call39// #java_exe=c:/andyc/j9vmwi3224/sdk/jre/bin/java.exe40// #java_exe=c:/ipartrid/j9vmwi3224/jre/bin/java.exe41// java_exe=c:/ben/j9vmwi3224/sdk/jre/bin/java.exe42//43// # Default location for cache files and javasharedresources44// defaultCacheLocation=C:/Documents and Settings/clemas/Local Settings/Application Data45// # These are used if set, otherwise just the default is assumed46// # cacheDir=47// # controlDir=48//49// # and a java for creating old incompatible cache files50// java5_exe=c:/andyc/j9vmwi3223/sdk/jre/bin/java.exe51//52// # If set, this will tell us what commands are executing53// logCommands=true5455String javaForTesting = System.getProperty("testjava");56String cacheDir = System.getProperty("cachedir");57String java5 = System.getProperty("refjava");5859// make sure '/' the right way round!60javaForTesting = javaForTesting.replace('\\','/');61cacheDir = cacheDir.replace('\\','/');62java5 = java5.replace('\\','/');6364FileWriter writer = new FileWriter("config.properties");65writer.write("# Java to be tested\n");66writer.write("java_exe="+javaForTesting+"\n\n");67writer.write("# Cache directory\n");68writer.write("cacheDir="+cacheDir+"\n\n");69writer.write("# Old jdk for creating old caches\n");70writer.write("java5_exe="+java5+"\n");71writer.flush();72writer.close();73}7475}767778