Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4795449

JCK1.4a-runtime api/javax_swing/interactive/JSplitPaneTests.html#JSplitPane fail

XMLWordPrintable

    • x86, sparc
    • linux, solaris_8, windows_2000



      Name: iaR10016 Date: 12/17/2002


      Filed By : J2SE-SQA [###@###.###
      JDK : JDK1.4.2-b10, JDK1.4.0, JDK1.4.1
      JCK : JCK1.4a-runtime
      Platform[s] : RedHat Linux 8.0, RedHat Linux 7.3, Windows 2000, Solaris sparc, Solaris intel
      switch/Mode : default, plugin
      JCK test owner : http://javaweb.eng/jck/usr/owners.jto
      Falling tests : api/javax_swing/interactive/JSplitPaneTests.html#JSplitPane
                      [JSplitPaneTest0005, JSplitPaneTest0006, JSplitPaneTest0021,
                       JSplitPaneTest0022, JSplitPaneTest0023, JSplitPaneTest0024]

      JSplitPane component sometimes behaves incorrectly.

      For example, please start JCK1.4a interactive test
      api/javax_swing/interactive/JSplitPaneTests.html#JSplitPane[JSplitPaneTest0005] and do
      the following:

      1. Move tested JSplitPane divider down as far as possible.
      2. Go to the JSplitPane bottom JTextArea component and click "Enter" several times there.
      There are no visible changes in JSplitPane after the first clicking, top and bottom
      textareas and divider pozition remain the same. But after 11 clicking divider moves up
      unexpectedly, so textareas change their size.

      The following test example demonstrates another situation like the one described here:

      -------------------- test.java --------------------
      import javax.swing.*;
      import java.awt.*;
      import java.awt.event.*;

      public class test extends JFrame implements ActionListener {
         JSplitPane sp;

         public test() {
            super("JSplitPane test");

            sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, new JTextArea(), new JTextArea());
            getContentPane().add(sp,BorderLayout.CENTER);
            sp.setDividerLocation(150);
            ((JTextArea)sp.getRightComponent()).insert("1234567890123456789012345678901234567890123456789012345678901234567890",0);

            JButton b = new JButton("Check!");
            b.addActionListener(this);
            getContentPane().add(b, BorderLayout.NORTH);
          }

         public static void main(String[] args) {
            JFrame frame = new test();
            frame.setSize(new Dimension(400,200));
            frame.setVisible(true);
          }

         public void actionPerformed(ActionEvent e) {
            System.out.println("SplitPane preferred size: " + sp.getPreferredSize());
            System.out.println("Min divider location: " + sp.getMinimumDividerLocation());
            System.out.println("Max divider location: " + sp.getMaximumDividerLocation());
            System.out.println("Divider location: " + sp.getDividerLocation());
            System.out.println("Right component min size: "+sp.getRightComponent().getMinimumSize());
            System.out.println("Right component size: "+sp.getRightComponent().getSize());
            System.out.println("----------------------------------");
           }
       }
      ---------------------------------------------------

      Please, compile and run this test example.

      Tested JSplitPane contains two JTextArea components. It is expected that divider can be moved
      left because left textarea is empty and right textarea contains long string which exceed the
      splitpane size. But actually you can not move divider.

      Please, click "Check!" button to see tested splitpane and textareas parameters.
      If you did not resize tested frame, test output is:

      ...
      SplitPane preferred size: java.awt.Dimension[width=412,height=17]
      Min divider location: 1
      Max divider location: 1
      Divider location: 140
      Right component min size: java.awt.Dimension[width=400,height=15]
      Right component size: java.awt.Dimension[width=239,height=146]
      ----------------------------------
      ...

      Problem is that divider location can be more than max divider location or less then min divider
      location (as in the test example). In this case it is inpossible to move the divider manually
      even in it's correct location.

      Test source location:
      =====================
      /java/re/jck/1.4a/promoted/fcs/binaries/JCK-runtime-14a/tests/api/javax_swing/interactive/JSplitPaneTests.java

      jtr file location:
      ==================
      /net/jtgb4u4c.sfbay/export/sail15/results/mantis/b10/jck14a/linux/redhat8.0_gnomens4.7_linux-20/workDir/api-interactive/javax_swing/interactive/JSplitPaneTests_JSplitPane.jtr

      How to reproduce:
      =================
      Run the following script (you may need to change its variables)

      --- script start ---
      #!/bin/bash
      JCK="/java/re/jck/1.4a/promoted/fcs/binaries/JCK-runtime-14a"
      JDK="/net/jdk/export/disk8/local.java/jdk1.4/linux-i386"
      export CLASSPATH="$JCK/classes:$JCK/lib/javatest.jar"
      $JDK/bin/java javasoft.sqe.tests.api.javax.swing.interactive.JSplitPane.JSplitPaneTests -TestCaseID JSplitPaneTest0005
      --- script end ---

      Specific machine info:
      ======================
      Hostname: linux-20
      OS: RedHat Linux 8.0 (GNOME)

      ======================================================================

            apikalev Andrey Pikalev
            irasunw Ira Ira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: