jdk/test/javax/swing/DataTransfer/6456844/bug6456844.java
author xuelei
Thu, 18 Oct 2012 01:14:00 -0700
changeset 14194 971f46db533d
parent 7501 d5bcfa712fe8
child 31448 1066345d2a8a
permissions -rw-r--r--
7068321: Support TLS Server Name Indication (SNI) Extension in JSSE Server Reviewed-by: mullan, weijun, wetmore
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7501
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
     1
/*
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
     2
 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
     4
 *
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
     7
 * published by the Free Software Foundation.
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
     8
 *
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    13
 * accompanied this code).
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    14
 *
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    18
 *
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    21
 * questions.
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    22
 */
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    23
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    24
/* @test
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    25
   @bug 6456844
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    26
   @summary Tests that JTextComponent doesn't create drop locations with null bias.
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    27
   @author Shannon Hickey
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    28
*/
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    29
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    30
import sun.swing.SwingAccessor;
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    31
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    32
import javax.swing.*;
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    33
import javax.swing.border.EmptyBorder;
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    34
import javax.swing.text.JTextComponent;
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    35
import java.awt.*;
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    36
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    37
public class bug6456844 {
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    38
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    39
    public static void main(String[] args) {
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    40
        JEditorPane ep = new JEditorPane();
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    41
        ep.setContentType("text/html");
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    42
        ep.setText("<html><body>abc</body></html>");
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    43
        ep.setBorder(new EmptyBorder(20, 20, 20, 20));
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    44
        ep.setBounds(0, 0, 100, 100);
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    45
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    46
        JTextComponent.DropLocation location =
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    47
                (JTextComponent.DropLocation) SwingAccessor.getJTextComponentAccessor().dropLocationForPoint(ep,
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    48
                        new Point(0, 0));
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    49
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    50
        if (location.getBias() == null) {
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    51
            throw new RuntimeException("null bias");
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    52
        }
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    53
    }
d5bcfa712fe8 6988205: Test failed due to compilation failed, JTextComponent doesn't create drop locations with null bias.
rupashka
parents:
diff changeset
    54
}