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

JCK1.4, api/javax_swing/SpringLayout/index.html#putget

XMLWordPrintable

    • x86, sparc
    • generic, linux, windows_2000



      Name: iaR10016 Date: 10/01/2001


      JDK : JDK1.4.0-beta-b81
                       (The test passes with JDK1.4.0-beta-b80)
      JCK : JCK1.4-b10
      Platform[s] : RedHat Linux 7.1, Windows 2000
      switch/Mode : -client -Xmixed -Xfuture
      JCK test owner : http://javaweb.eng/jck/usr/owners.jto
      Failing Test : api/javax_swing/SpringLayout/index.html#putget [SpringLayout2009]

      JavaTM 2 Platform Std. Ed. v1.4.0 Specification reads about SpringLayout.getConstraints(Component c)
      method:
      ...
      public SpringLayout.Constraints getConstraints(Component c)
            Returns the constraints for the specified component. Note that, unlike the GridBagLayout getConstraints method, this
            method does not clone constraints. If no constraints have been associated with this component, this method returns a
            default constraints object positioned at 0,0 relative to the parent's Insets and its width/height constrained to the
            minimum, maximum, and preferred sizes of the component.
      ...

      But in JDK1.4.0-beta-b81 this method returns Constraints object with null X and Y properties
      if no constraints have been associated with the component.

      The following test example demonstrates the bug:

      -------------------- test.java --------------------
      import javax.swing.*;
      public class test {
          public static void main(String argv[]) {
              SpringLayout.Constraints sc=(new SpringLayout()).getConstraints(new JButton("aButton"));
              System.out.println("X,Y: " + sc.getX() + " " + sc.getY());
          }
      }
      ---------------------------------------------------

      Sample output is:
      ...
      X,Y: null null
      ...

      Test source location:
      =====================
      /net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14/tests/api/javax_swing/SpringLayout/putgetTests.java

      jtr file location:
      ==================
      /net/jtgb4u4c.eng/export/sail15/results/merlin/b81/jck14/linux/redhat7.1_kde2_client_linux-13/workDir/api/javax_swing/SpringLayout/index_putget.jtr

      How to reproduce:
      ====================
      Run the following script under RedHat Linux 7.1
      (probably, you need to change JCK and JAVA_HOME paths):
      --------Script START---------------------
      #!/bin/sh
      JAVA_HOME=/net/jdk/export/disk8/local.java/jdk1.4/linux-i386
      JCK=/net/jdk/export/disk8/local.java/jck1.4/JCK-runtime-14
      export CLASSPATH="$JCK/classes:$JCK/javatest.jar"
      executeClass="javasoft.sqe.tests.api.javax.swing.SpringLayout.putgetTests -TestCaseID SpringLayout2009"
      $JAVA_HOME/bin/java -Xfuture ${executeClass}
      ---------Script END----------------------

      Test output:
      ============
      SpringLayout2009: Failed. FAILED
      ====== SpringLayout2009 ====== public SpringLayout.Constraints getConstraints(Component c)
      getConstraints() does not use location and size of current component
      STATUS:Failed.tests: 1; failed: 1; first test case failure: SpringLayout2009
      Test failed

      Specific Machine Info:
      =====================
      Hostname: Linux-14
      OS: RedHat 7.1

      Hostname: Linux-2
      OS: Windows 2000

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

            svioletsunw Scott Violet (Inactive)
            irasunw Ira Ira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: