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

TEST_BUG: Incorrect rendering in RegTest-CTE .../4394882/Rotate.java

    XMLWordPrintable

Details

    • rc
    • x86
    • linux
    • Verified

    Description



      Name: asR10013 Date: 02/04/2003


      Filed By : J2SE-SQA [###@###.###
      JDK : JDK1.4.2-b14
      Testbase : RegTest-CTE-Manual
      Platform[s] : SuSe 8.0 (GNOME), RedHat 7.2 (GNOME)
      Falling test[s]:
              CTE_REGTEST/Generic/4394882/Rotate.java

      RegTest-CTE CTE_REGTEST/Generic/4394882/Rotate.java test incorrectly renders the content
      of the frame after some window that overlaps the frame is moved. The test treats the
      upper-left corner of the clipping area to be repainted as actual upper-left corner of the frame.
      Because of this and because the the test frame always appears behind the test description window
      it is very hard to evaluate the test result. The same behavior is observed as using JDK1.4.2-b14
      as using JDK1.4.1-b21.

      After I had modified Rotate.java as follows:

          public static class MyCanvas extends javax.swing.JComponent
          {
              public void paintComponent(java.awt.Graphics p1)
              {
      // OPTIONAL MODIFICATION - as suggested by the paintComponent specification,
      // but the test renders properly without this modification -->
                  java.awt.Graphics2D g2 = (java.awt.Graphics2D)p1.create();
      // <-- OPTIONAL MODIFICATION
                  //
                  g2.setRenderingHint(java.awt.RenderingHints.KEY_ANTIALIASING,
                             java.awt.RenderingHints.VALUE_ANTIALIAS_ON ); //_OFF
                  g2.setFont( new java.awt.Font( "Helvetica", java.awt.Font.BOLD, 12 ) );
                  //
      // KEY MODIFICATION - the test pains in the clipping area, not in the frame -->
                  java.awt.Rectangle rect=g2.getClipBounds();
      // <-- KEY MODIFICATION
                  for( double angle = 0; angle< 360; angle+=15 )
                  {
                      String text = "Test_rotate_0123456789_Test_rotate_end";
                      java.awt.geom.AffineTransform af = new java.awt.geom.AffineTransform();

      // KEY MODIFICATION - the test pains in the clipping area, not in the frame -->
                      af.translate( 400-rect.x, 400-rect.y );
      // <-- KEY MODIFICATION
                      af.rotate( Math.toRadians( angle ) );
                      g2.setTransform( af );
                      //
                      g2.setColor( java.awt.Color.black );
                      g2.drawString( text, 0, 0 );
                      g2.setColor( java.awt.Color.red );
                      g2.drawLine(0, 0, 400, 0 );
                  }
                //
              }

          }

      the test rendered its content properly and
      its "PASSED" conditions were satisfied (the circle at the center was round).


      Test source location:
      =====================
      /net/jdk/export/jpse04/Regression/1.4.2/test/CTE_REGTEST/Generic/4394882/Rotate.java

      jtr file location:
      ==================
      /net/jtgb4u4c.sfbay/export/sail15/results/mantis/b14/regtest/linux/suse8.0_gnome_-client_linux-19/workDir/cte/CTE_REGTEST/Generic/4394882/Rotate.jtr

      How to reproduce:
      =================
      Run the following script (you may need to change its variables)
       
      --- script start ---
      #!/bin/sh

      RESULT_DIR=`pwd`
      WORK_DIR=$RESULT_DIR/workDir/test
      REPORT_DIR=$RESULT_DIR/reportDir
      JT_HOME="/net/linux-15/export/home/java/jct"
      JAVA_HOME="/net/linux-15/export/home/java/jdk1.4.2/linux"
      TEST_BASE_PATH="/net/linux-15/export/home/java/regtest/cte"

      TESTWITH=$JAVA_HOME
      TESTJAVA=$JAVA_HOME

      JTOPTS="-client"
      TESTVMOPTS="-client"

      CLASSPATH="$JT_HOME/classes:$JT_HOME/lib/javatest.jar:$JT_HOME/lib/jtreg.jar:$JT_HOME/jemmy/jemmy.jar"

      export JAVA_HOME
      export JT_HOME
      export TESTWITH
      export CLASSPATH

      mkdir -p $WORK_DIR/scratch 2>&1
      mkdir -p $WORK_DIR/jtData 2>&1
      mkdir -p $REPORT_DIR 2>&1

      #rm $WORK_DIR/jtData/ResultCache.jtw 2>&1

      cd $WORK_DIR/scratch

      $JAVA_HOME/bin/java -cp $CLASSPATH $JTOPTS -DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,DISPLAY=:0,HOME=$HOME/.regtest,PATH=/bin:/usr/bin,CPAPPEND=$JT_HOME/jemmy/jemmy.jar,TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= -DDISPLAY=:0 -DlocalHost="linux-19" -Dprogram=jtreg com.sun.javatest.regtest.Main -manual -v default -batch -params -w "$WORK_DIR" -r "$REPORT_DIR" -t "$TEST_BASE_PATH" -keywords manual "$TEST_BASE_PATH/CTE_REGTEST/Generic/4394882/Rotate.java"

      --- script end ---

      Test output (jtr part):
      =======================
      JavaTest Message: Test threw exception: java.lang.RuntimeException: Failure Reported by Test Operator
      JavaTest Message: shutting down test

      STATUS:Failed.`main' threw exception: java.lang.RuntimeException: Failure Reported by Test Operator
      result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Failure Reported by Test Operator


      test result: Failed. Execution failed: `main' threw exception: java.lang.RuntimeException: Failure Reported by Test Operator


      Specific machine info:
      ======================
      Hostname: linux-19
      OS: SuSe 8.0 (GNOME)



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

      Attachments

        Activity

          People

            asaha Abhijit Saha
            alssunw Als Als (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: