test/runtime/LoadClass/LoadClassNegative.java

Tue, 26 Nov 2013 16:03:57 -0500

author
hseigel
date
Tue, 26 Nov 2013 16:03:57 -0500
changeset 6133
e567d5afd4dd
parent 5603
7e7dd25666da
child 6876
710a3c8b516e
permissions
-rw-r--r--

8028160: [TESTBUG] Exclude failing (runtime) jtreg tests using @ignore
Summary: Use @ignore to exclude failing tests
Reviewed-by: coleenp, ctornqvi, mseledtsov
Contributed-by: george.triantafillou@oracle.com

ccheung@5603 1 /*
ccheung@5603 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
ccheung@5603 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ccheung@5603 4 *
ccheung@5603 5 * This code is free software; you can redistribute it and/or modify it
ccheung@5603 6 * under the terms of the GNU General Public License version 2 only, as
ccheung@5603 7 * published by the Free Software Foundation.
ccheung@5603 8 *
ccheung@5603 9 * This code is distributed in the hope that it will be useful, but WITHOUT
ccheung@5603 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ccheung@5603 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ccheung@5603 12 * version 2 for more details (a copy is included in the LICENSE file that
ccheung@5603 13 * accompanied this code).
ccheung@5603 14 *
ccheung@5603 15 * You should have received a copy of the GNU General Public License version
ccheung@5603 16 * 2 along with this work; if not, write to the Free Software Foundation,
ccheung@5603 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ccheung@5603 18 *
ccheung@5603 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ccheung@5603 20 * or visit www.oracle.com if you need additional information or have any
ccheung@5603 21 * questions.
ccheung@5603 22 */
ccheung@5603 23
ccheung@5603 24 /*
hseigel@6133 25 * @ignore 8028095
ccheung@5603 26 * @test
ccheung@5603 27 * @key regression
ccheung@5603 28 * @bug 8020675
ccheung@5603 29 * @summary make sure there is no fatal error if a class is loaded from an invalid jar file which is in the bootclasspath
ccheung@5603 30 * @library /testlibrary
ccheung@5603 31 * @build TestForName
ccheung@5603 32 * @build LoadClassNegative
ccheung@5603 33 * @run main LoadClassNegative
ccheung@5603 34 */
ccheung@5603 35
ccheung@5603 36 import java.io.File;
ccheung@5603 37 import com.oracle.java.testlibrary.*;
ccheung@5603 38
ccheung@5603 39 public class LoadClassNegative {
ccheung@5603 40
ccheung@5603 41 public static void main(String args[]) throws Exception {
ccheung@5603 42 String bootCP = "-Xbootclasspath/a:" + System.getProperty("test.src")
ccheung@5603 43 + File.separator + "dummy.jar";
ccheung@5603 44 ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
ccheung@5603 45 bootCP,
ccheung@5603 46 "TestForName");
ccheung@5603 47
ccheung@5603 48 OutputAnalyzer output = new OutputAnalyzer(pb.start());
ccheung@5603 49 output.shouldContain("ClassNotFoundException");
ccheung@5603 50 output.shouldHaveExitValue(0);
ccheung@5603 51 }
ccheung@5603 52 }

mercurial