hotspot/test/testlibrary_tests/ctw/ClassesListTest.java
author thartmann
Fri, 12 Dec 2014 09:37:38 +0100
changeset 28190 5a6b07edeb21
parent 26915 ba674d5d0f77
child 29678 dd2f3932c21e
permissions -rw-r--r--
8066433: Move Whitebox test library to top level repository Summary: Moved Whitebox test library to top level repository. Reviewed-by: iignatyev, sla, mr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26915
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
     1
/*
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
     2
 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
     4
 *
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
     8
 *
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    13
 * accompanied this code).
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    14
 *
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    18
 *
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    21
 * questions.
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    22
 */
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    23
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    24
/*
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    25
 * @test
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    26
 * @bug 8012447
28190
5a6b07edeb21 8066433: Move Whitebox test library to top level repository
thartmann
parents: 26915
diff changeset
    27
 * @library /testlibrary /../../test/lib /testlibrary/ctw/src
26915
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    28
 * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    29
 * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    30
 *                              sun.hotspot.WhiteBox$WhiteBoxPermission
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    31
 * @run main ClassesListTest prepare
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    32
 * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld classes.lst
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    33
 * @run main ClassesListTest check ctw.log
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    34
 * @summary testing of CompileTheWorld :: list of classes in file
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    35
 * @author igor.ignatyev@oracle.com
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    36
 */
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    37
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    38
import java.nio.file.Files;
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    39
import java.nio.file.Paths;
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    40
import java.nio.file.StandardCopyOption;
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    41
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    42
public class ClassesListTest extends CtwTest {
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    43
    private static final String[] SHOULD_CONTAIN
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    44
            = {"# list: classes.lst", "Done (4 classes, "};
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    45
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    46
    private ClassesListTest() {
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    47
        super(SHOULD_CONTAIN);
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    48
    }
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    49
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    50
    public static void main(String[] args) throws Exception {
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    51
        new ClassesListTest().run(args);
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    52
    }
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    53
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    54
    protected void prepare() throws Exception {
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    55
        String path = "classes.lst";
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    56
        Files.copy(Paths.get(System.getProperty("test.src"), path),
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    57
                Paths.get(path), StandardCopyOption.REPLACE_EXISTING);
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    58
    }
ba674d5d0f77 8025606: [TESTBUG] Move ctw-tests to /testlibrary_tests
vlivanov
parents:
diff changeset
    59
}