2362N/A * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. 103N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 103N/A * This code is free software; you can redistribute it and/or modify it 103N/A * under the terms of the GNU General Public License version 2 only, as 103N/A * published by the Free Software Foundation. 103N/A * This code is distributed in the hope that it will be useful, but WITHOUT 103N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 103N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 103N/A * version 2 for more details (a copy is included in the LICENSE file that 103N/A * accompanied this code). 103N/A * You should have received a copy of the GNU General Public License version 103N/A * 2 along with this work; if not, write to the Free Software Foundation, 103N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 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 103N/A @summary Shape should be correctly updated on invalid components 103N/A @author anthony.petrov@...: area=awt.mixing 103N/A @library ../regtesthelpers 103N/A * summary: Shape should be correctly updated on invalid components 103N/A //*** Create instructions for the user here *** 103N/A "This is an AUTOMATIC test, simply wait until it is done.",
103N/A "The result (passed or failed) will be shown in the",
103N/A "message window below." 103N/A // Create the frame and the button 103N/A // Let's make the button much smaller first... 103N/A // ... and now let's enlarge it. 103N/A // If the button doesn't receive the click, it means that the test 103N/A // failed: the shape of the button was not enlarged. 103N/A /***************************************************** 103N/A * Standard Test Machinery Section 103N/A * DO NOT modify anything in this section -- it's a 103N/A * standard chunk of code which has all of the 103N/A * synchronisation necessary for the test harness. 103N/A * By keeping it the same in all tests, it is easier 103N/A * to read and understand someone else's test, as 103N/A * well as insuring that all tests behave correctly 103N/A * with the test harness. 103N/A * There is a section following this for test- 103N/A ******************************************************/ 103N/A // Not sure about what happens if multiple of this test are 103N/A // instantiated in the same VM. Being static (and using 103N/A // static vars), it aint gonna work. Not worrying about 103N/A //The test passed, so just return from main and harness will 103N/A // interepret this return as a pass 103N/A //At this point, neither test pass nor test fail has been 103N/A // called -- either would have thrown an exception and ended the 103N/A // test, so we know we have multiple threads. 103N/A //Test involves other threads, so sleep and wait for them to 103N/A // called pass() or fail() 103N/A //Timed out, so fail the test 103N/A //The test harness may have interrupted the test. If so, rethrow the exception 103N/A // so that the harness gets it and deals with it. 103N/A //reset flag in case hit this code more than once for some reason (just safety) 103N/A //first check if this is executing in main thread 103N/A //Still in the main thread, so set the flag just for kicks, 103N/A // and throw a test passed exception which will be caught 103N/A //test writer didn't specify why test failed, so give generic 103N/A //check if this called from main thread 103N/A //If main thread, fail now 'cause not sleeping 103N/A//This exception is used to exit from any level of call nesting 103N/A// when it's determined that the test has passed, and immediately 103N/A//*********** End Standard Test Machinery Section ********** 103N/A//************ Begin classes defined for the test **************** 103N/A// if want to make listeners, here is the recommended place for them, then instantiate 103N/A/* Example of a class which may be written as part of a test 103N/Aclass NewClass implements anInterface 103N/A public void eventDispatched(AWTEvent e) 103N/A //Counting events to see if we get enough 103N/A //got enough events, so pass 103N/A //tried too many times without getting enough events so fail 103N/A//************** End classes defined for the test ******************* 103N/A/**************************************************** 103N/A Standard Test Machinery 103N/A DO NOT modify anything below -- it's a standard 103N/A chunk of code whose purpose is to make user 103N/A interaction uniform, and thereby make it simpler 103N/A to read and understand someone else's test. 103N/A ****************************************************/ 103N/A This is part of the standard test machinery. 103N/A It creates a dialog (with the instructions), and is the interface 103N/A for sending text messages to the user. 103N/A To print the instructions, send an array of strings to Sysout.createDialog 103N/A WithInstructions method. Put one line of instructions per array entry. 103N/A To display a message for the tester to see, simply call Sysout.println 103N/A with the string to be displayed. 103N/A This mimics System.out.println but works within the test harness as well 103N/A println(
"Any messages for the tester will display here." );
103N/A println(
"Any messages for the tester will display here." );
103N/A This is part of the standard test machinery. It provides a place for the 103N/A test instructions to be displayed, and a place for interactive messages 103N/A to the user to be displayed. 103N/A To have the test instructions displayed, see Sysout. 103N/A To have a message to the user be displayed, see Sysout. 103N/A Do not call anything in this dialog directly. 103N/A //DO NOT call this directly, go through Sysout 103N/A //DO NOT call this directly, go through Sysout 103N/A //Clear out any current instructions 103N/A //Go down array of instruction strings 103N/A //chop up each into pieces maxSringLength long 103N/A //if longer than max then chop off first max chars to print 103N/A //Try to chop on a word boundary 103N/A //DO NOT call this directly, go through Sysout