jdk/test/javax/swing/JInternalFrame/Test6802868.java
author brutisso
Mon, 16 Dec 2013 13:43:06 +0100
changeset 22204 eef85c68cec0
parent 5506 202f599c92aa
child 40128 e635645d2a8a
permissions -rw-r--r--
8027440: DefNew does not log heap change information when a promotion failure occurs Reviewed-by: tamao, jmasa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3502
diff changeset
     2
 * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
     4
 *
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
     8
 *
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    13
 * accompanied this code).
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    14
 *
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3502
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3502
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3502
diff changeset
    21
 * questions.
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    22
 */
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    23
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    24
/*
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    25
 * @test
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    26
 * @bug 6802868
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    27
 * @summary JInternalFrame is not maximized when maximized parent frame
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    28
 * @author Alexander Potochkin
3502
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    29
 * @library ..
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    30
 */
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    31
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    32
import java.awt.Dimension;
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    33
import java.awt.Point;
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    34
import java.beans.PropertyVetoException;
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    35
import javax.swing.JDesktopPane;
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    36
import javax.swing.JFrame;
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    37
import javax.swing.JInternalFrame;
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    38
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    39
public class Test6802868 {
3502
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    40
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    41
    public static void main(String[] args) throws Throwable {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    42
        SwingTest.start(Test6802868.class);
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    43
    }
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    44
3502
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    45
    private final JFrame frame;
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    46
    private final JInternalFrame internal;
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    47
    private Dimension size;
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    48
    private Point location;
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    49
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    50
    public Test6802868(JFrame frame) {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    51
        JDesktopPane desktop = new JDesktopPane();
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    52
3502
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    53
        this.frame = frame;
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    54
        this.frame.add(desktop);
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    55
3502
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    56
        this.internal = new JInternalFrame(getClass().getName(), true, true, true, true);
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    57
        this.internal.setVisible(true);
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    58
3502
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    59
        desktop.add(this.internal);
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    60
    }
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    61
3502
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    62
    public void firstAction() throws PropertyVetoException {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    63
        this.internal.setMaximum(true);
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    64
    }
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    65
3502
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    66
    public void firstTest() {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    67
        this.size = this.internal.getSize();
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    68
        resizeFrame();
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    69
    }
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    70
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    71
    public void firstValidation() {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    72
        if (this.internal.getSize().equals(this.size)) {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    73
            throw new Error("InternalFrame hasn't changed its size");
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    74
        }
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    75
    }
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    76
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    77
    public void secondAction() throws PropertyVetoException {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    78
        this.internal.setIcon(true);
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    79
    }
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    80
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    81
    public void secondTest() {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    82
        this.location = this.internal.getDesktopIcon().getLocation();
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    83
        resizeFrame();
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    84
    }
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    85
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    86
    public void secondValidation() {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    87
        if (this.internal.getDesktopIcon().getLocation().equals(this.location)) {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    88
            throw new Error("JDesktopIcon hasn't moved");
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    89
        }
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    90
    }
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    91
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    92
    private void resizeFrame() {
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    93
        Dimension size = this.frame.getSize();
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    94
        size.width += 10;
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    95
        size.height += 10;
821e773cae60 6865565: Test failed: /test/closed/javax/swing/JInternalFrame/6325652/bug6325652.java
malenkov
parents: 3345
diff changeset
    96
        this.frame.setSize(size);
3345
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    97
    }
e095f8b1c3e8 6802868: JInternalFrame is not maximized when maximized parent frame.
malenkov
parents:
diff changeset
    98
}