Path: blob/master/test/hotspot/jtreg/vmTestbase/gc/g1/unloading/GenClassesBuilder.java
64506 views
/*1* Copyright (c) 2017, 2019, 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*/2223package gc.g1.unloading;2425import jdk.test.lib.Utils;2627import java.nio.file.Files;28import java.nio.file.Path;29import java.nio.file.Paths;3031/**32* Uses {@link gc.g1.unloading.GenClassPoolJar} to build {@code classPool.jar}33* in current directory.34*/35public class GenClassesBuilder {36public static void main(String[] args) {37Path template = Paths.get(Utils.TEST_ROOT)38.resolve("vmTestbase")39.resolve("gc")40.resolve("g1")41.resolve("unloading")42.resolve("ClassNNN.java.template")43.toAbsolutePath();44Path dir = Paths.get(".").toAbsolutePath();45String count = "1000";46if (Files.notExists(template)) {47throw new Error("can't find template file: " + template);48}49try {50GenClassPoolJar.main(new String[]{template.toString(), dir.toString(), count});51} catch (Exception e) {52throw new Error("can't generate classPool.jar", e);53}54}55}5657585960