--- old/test/java/awt/ComponentOrientation/WindowTest.java 2017-09-08 16:16:18.896149868 +0530 +++ new/test/java/awt/ComponentOrientation/WindowTest.java 2017-09-08 16:16:18.760149868 +0530 @@ -27,51 +27,31 @@ * @bug 4108453 4778440 6304785 * @summary Test Window.applyResourceBundle orientation support * - * @build TestBundle TestBundle_es TestBundle_iw - * @build TestBundle1 TestBundle1_ar * @run main WindowTest */ import java.awt.*; -import java.applet.*; -import java.util.Locale; -import java.util.ResourceBundle; - -public class WindowTest extends Applet { - static Exception failure=null; - static Thread mainThread=null; - public static void main(String args[]) throws Exception { - mainThread = Thread.currentThread(); - WindowTest app = new WindowTest(); - app.start(); - try { - Thread.sleep(300000); - } catch (InterruptedException e) { - if (failure != null) { - throw failure; - } - } - } +public class WindowTest { - public void start() { + + public static void main(String args[]) throws Exception { + Frame frame = new Frame(); + frame.setSize(200,200); + frame.setVisible(true); try { - doTest(); - } catch (Exception e) { - failure = e; + doTest(frame); + } finally { + frame.setVisible(false); + frame.dispose(); } - mainThread.interrupt(); } - public void doTest() { + public static void doTest (Frame myFrame) throws Exception{ System.out.println("WindowTest {"); - ResourceBundle rb; - Frame myFrame; - // Create a window containing a hierarchy of components. System.out.println(" Creating component hierarchy..."); - myFrame = new Frame(); myFrame.setLayout(new FlowLayout()); Panel panel1 = new Panel(); panel1.setLayout(new BorderLayout()); @@ -96,28 +76,14 @@ System.out.println(" Verifying orientation is UNKNOWN..."); verifyOrientation(myFrame, ComponentOrientation.UNKNOWN); - // This will load TestBundle1 using the default locale and apply - // it to the component hierarchy. Since the bundle has no Orientation - // specified, this should fall back to the bundle-locale's orientation - System.out.println(" Applying TestBundle1 by name and verifying..."); - myFrame.applyResourceBundle("TestBundle1"); - verifyOrientation(myFrame, - ComponentOrientation.getOrientation( - ResourceBundle.getBundle("TestBundle1", Locale.getDefault()))); - - System.out.println(" Applying TestBundle_iw and verifying..."); - rb = ResourceBundle.getBundle("TestBundle", new Locale("iw", "")); - myFrame.applyResourceBundle(rb); + System.out.println(" Applying RIGHT_TO_LEFT orientation and verifying..."); + myFrame.applyComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);; verifyOrientation(myFrame, ComponentOrientation.RIGHT_TO_LEFT); - System.out.println(" Applying TestBundle_es and verifying..."); - rb = ResourceBundle.getBundle("TestBundle", new Locale("es", "")); - myFrame.applyResourceBundle(rb); + System.out.println(" Applying LEFT_TO_RIGHT orientation and verifying..."); + myFrame.applyComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT); verifyOrientation(myFrame, ComponentOrientation.LEFT_TO_RIGHT); - - myFrame.setVisible(false); - myFrame.dispose(); System.out.println("}"); }