提交 44ea06ca 编写于 作者: A aivanov

8133731: [TEST_BUG] Unmappable in ASCII character such as Thai should be...

8133731: [TEST_BUG] Unmappable in ASCII character such as Thai should be escaped in the regtests targeted for a regular non-I18n runs
Summary: Lambdafy, and replace character string literal characters with unicode.
Reviewed-by: serb, alexsch
上级 1a80de80
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2019, 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,32 +28,27 @@
@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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册