Path: blob/master/test/hotspot/jtreg/testlibrary_tests/ctw/ClassesListTest.java
40942 views
/*1* Copyright (c) 2013, 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* @test25* @bug 801244726* @library /test/lib /testlibrary/ctw/src27* @modules java.base/jdk.internal.access28* java.base/jdk.internal.jimage29* java.base/jdk.internal.misc30* java.base/jdk.internal.reflect31* java.management32* @build sun.hotspot.WhiteBox Foo Bar33* @run driver jdk.test.lib.helpers.ClassFileInstaller sun.hotspot.WhiteBox Foo Bar34* @run driver ClassesListTest prepare35* @run driver/timeout=600 ClassesListTest compile classes.lst36* @run driver ClassesListTest check37* @summary testing of CompileTheWorld :: list of classes in file38* @author [email protected]39*/4041import java.nio.file.Files;42import java.nio.file.Paths;43import java.nio.file.StandardCopyOption;4445public class ClassesListTest extends CtwTest {46private static final String[] SHOULD_CONTAIN47= {"# list: classes.lst", "Done (4 classes, "};4849private ClassesListTest() {50super(SHOULD_CONTAIN);51}5253public static void main(String[] args) throws Exception {54new ClassesListTest().run(args);55}5657protected void prepare() throws Exception {58String path = "classes.lst";59Files.copy(Paths.get(System.getProperty("test.src"), path),60Paths.get(path), StandardCopyOption.REPLACE_EXISTING);61}62}636465