0N/A/*
2362N/A * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A/**
0N/A * <p>This is the base class for automatic main tests.
0N/A * <p>When using jtreg you would include this class into
0N/A * the build list via something like:
0N/A * <pre>
0N/A @library ../../../regtesthelpers
0N/A @build AbstractTest
0N/A @run main YourTest
0N/A </pre>
0N/A * Note that if you are about to create a test based on
0N/A * Applet-template, then put those lines into html-file, not in java-file.
0N/A * <p> And put an
0N/A * import test.java.awt.regtesthelpers.AbstractTest;
0N/A * into the java source.
0N/A */
0N/A
0N/Apackage test.java.awt.regtesthelpers;
0N/A
0N/Apublic abstract class AbstractTest
0N/A{
0N/A public static void pass()
0N/A {
0N/A Sysout.println( "The test passed." );
0N/A Sysout.println( "The test is over, hit Ctl-C to stop Java VM" );
0N/A }//pass()
0N/A
0N/A public static void fail()
0N/A {
0N/A //test writer didn't specify why test failed, so give generic
0N/A fail("no reason given.");
0N/A }
0N/A
0N/A public static void fail( String whyFailed )
0N/A {
0N/A Sysout.println( "The test failed: " + whyFailed );
0N/A Sysout.println( "The test is over, hit Ctl-C to stop Java VM" );
0N/A throw new RuntimeException( whyFailed );
0N/A }
0N/A
0N/A public static void fail(Exception ex) throws Exception
0N/A {
0N/A Sysout.println( "The test failed with exception:" );
0N/A ex.printStackTrace();
0N/A Sysout.println( "The test is over, hit Ctl-C to stop Java VM" );
0N/A throw ex;
0N/A }
0N/A}