8081311: [TEST_BUG] java/awt/ComponentOrientation/WindowTest.java does use deprecated applyResourceBundle

Reviewed-by: serb, ssadetsky
This commit is contained in:
Pankaj Bansal 2017-09-25 16:06:13 +05:30 committed by Ajit Ghaisas
parent 94a925b4f3
commit 6b7c509a0d

View File

@ -32,46 +32,38 @@
* @run main WindowTest * @run main WindowTest
*/ */
import java.awt.*; import java.awt.Frame;
import java.applet.*; import java.awt.Panel;
import java.awt.FlowLayout;
import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Component;
import java.awt.ComponentOrientation;
import java.awt.Container;
import java.util.Locale; import java.util.Locale;
import java.util.ResourceBundle; import java.util.ResourceBundle;
public class WindowTest extends Applet { public class WindowTest {
static Exception failure=null;
static Thread mainThread=null;
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
mainThread = Thread.currentThread(); Frame frame = new Frame();
WindowTest app = new WindowTest(); frame.setSize(200,200);
app.start(); frame.setVisible(true);
try { try {
Thread.sleep(300000); doTest(frame);
} catch (InterruptedException e) { } finally {
if (failure != null) { frame.setVisible(false);
throw failure; frame.dispose();
}
} }
} }
public void start() { public static void doTest (Frame myFrame) throws Exception{
try {
doTest();
} catch (Exception e) {
failure = e;
}
mainThread.interrupt();
}
public void doTest() {
System.out.println("WindowTest {"); System.out.println("WindowTest {");
ResourceBundle rb; ResourceBundle rb;
Frame myFrame;
// Create a window containing a hierarchy of components. // Create a window containing a hierarchy of components.
System.out.println(" Creating component hierarchy..."); System.out.println(" Creating component hierarchy...");
myFrame = new Frame();
myFrame.setLayout(new FlowLayout()); myFrame.setLayout(new FlowLayout());
Panel panel1 = new Panel(); Panel panel1 = new Panel();
panel1.setLayout(new BorderLayout()); panel1.setLayout(new BorderLayout());
@ -115,9 +107,6 @@ public class WindowTest extends Applet {
myFrame.applyResourceBundle(rb); myFrame.applyResourceBundle(rb);
verifyOrientation(myFrame, ComponentOrientation.LEFT_TO_RIGHT); verifyOrientation(myFrame, ComponentOrientation.LEFT_TO_RIGHT);
myFrame.setVisible(false);
myFrame.dispose();
System.out.println("}"); System.out.println("}");
} }