8133731: [TEST_BUG] Unmappable in ASCII character such as Thai should be escaped in the regtests targeted for a regular non-I18n runs
authoraivanov
Mon, 30 May 2016 12:43:18 +0300
changeset 39011 6649a38574b0
parent 39010 37ea10c369c7
child 39012 10d463f0d47a
8133731: [TEST_BUG] Unmappable in ASCII character such as Thai should be escaped in the regtests targeted for a regular non-I18n runs Reviewed-by: serb, alexsch
jdk/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java
--- a/jdk/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java	Mon May 30 11:08:27 2016 +0300
+++ b/jdk/test/javax/swing/JTextField/I18NViewNoWrapMinSpan/I18NViewNoWrapMinSpan.java	Mon May 30 12:43:18 2016 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -28,34 +28,29 @@
    @author Semyon Sadetsky
 */
 
-import javax.swing.*;
+import javax.swing.JTextField;
 import javax.swing.SwingUtilities;
 import javax.swing.text.BadLocationException;
-import java.lang.Override;
-import java.lang.Runnable;
 
 public class I18NViewNoWrapMinSpan {
 
     public static void main(String[] args) throws Exception {
-        SwingUtilities.invokeAndWait(new Runnable() {
-            @Override
-            public void run() {
-                try {
-                    JTextField textField = new JTextField(15);
-                    textField.setText("ม12345");
-                    float noSpaceMin = textField.getUI().getRootView(textField)
-                            .getMinimumSpan(0);
-                    textField.getDocument().insertString(3, " ", null);
-                    if (noSpaceMin > textField.getUI().getRootView(textField)
-                            .getMinimumSpan(0)) {
-                        throw new RuntimeException(
-                                "Minimum span is calculated for wrapped text");
-                    }
-                } catch (BadLocationException e) {
-                    throw new RuntimeException(e);
+        SwingUtilities.invokeAndWait(() -> {
+            try {
+                JTextField textField = new JTextField(15);
+                textField.setText("\u0E2112345");
+                float noSpaceMin = textField.getUI().getRootView(textField)
+                        .getMinimumSpan(0);
+                textField.getDocument().insertString(3, " ", null);
+                if (noSpaceMin > textField.getUI().getRootView(textField)
+                        .getMinimumSpan(0)) {
+                    throw new RuntimeException(
+                            "Minimum span is calculated for wrapped text");
                 }
+            } catch (BadLocationException e) {
+                throw new RuntimeException(e);
             }
         });
         System.out.println("ok");
     }
-}
\ No newline at end of file
+}