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

TEST_BUG: Regression-test javax/print/attribute/URLPDFPrinting.java fails

XMLWordPrintable

    • 2d
    • tiger
    • generic
    • generic
    • Verified



      Name: iaR10016 Date: 09/23/2003


      Filed By : J2SE-SQA [###@###.###
      JDK : JDK1.5.0-b20
                        (fails with error using previous JDK builds because of bug 4908692
                         integrated in JDK1.5.0-b20)
      Testbase : Regression-test
      Platform[s] : any platform without printer installed
      switch/Mode : -client
      Falling test[s]: javax/print/attribute/URLPDFPrinting.java

      Regression-test javax/print/attribute/URLPDFPrinting.java (JDK1.5.0-b20) test fails with
      JDK1.5.0-b20 on any system which has no printer installed.

      Here is the test source fragment:
      --------- javax/print/attribute/URLPDFPrinting.java ---------
      ...
           28 PrintService service[] = null, defService = null;
           29
           30 service = PrintServiceLookup.lookupPrintServices(DocFlavor.URL.PDF, null);
           31 if (service.length == 0) {
           32 System.out.println("Np PrintService support DocFlavor.URL.PDF");
           33 System.exit(1);
           34 } else {
           35 defService = service[0];
           36 System.out.println("Print Service which supports DocFlavor.URL.PDF: "+defService);
           37 }
      ...
      -------------------------------------------------------------

      JDK1.5.0 API Specification reads:
      ...
      Interface PrintService is the factory for a DocPrintJob.
      A PrintService describes the capabilities of a Printer and can be queried regarding a printer's
      supported attributes.
      ...
      public static final PrintService[] lookupPrintServices(DocFlavor flavor, AttributeSet attributes)
      Locates print services capable of printing the specified DocFlavor.
      Parameters:
         flavor - the flavor to print. If null, this constraint is not used.
         attributes - attributes that the print service must support. If null this constraint is not used.
      Returns:
         array of matching PrintService objects representing print services that support the specified
         flavor attributes. If no services match, the array is zero-length.
      ...

      So, if the tested system has no printer installed, PrintServiceLookup.lookupPrintServices call at
      the line 30 returns null and this is correct behavior, so the test should not fail in this case.

      Test source location:
      =====================
      /java/re/jdk/1.5.0/promoted/latest/ws/j2se/test/javax/print/attribute/URLPDFPrinting.java

      jtr file location:
      ==================
      /net/jtgb4u4c.sfbay/export/sail15/results.2/tiger/b20/regtest/x86/sol10_x86_gnome_linux-18/workDir/test/javax/print/attribute/URLPDFPrinting.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
      #KOORI_ONESTOP is your path to koori.sfbay/onestop (/net/koori/onestop, /java/re)
      KOORI_ONESTOP="/java/re"
      #JPSE04 is your path to /net/jdk/export/jpse04
      JPSE04="/net/jdk/export/jpse04"
      #JT_HOME="/net/linux-15/export/home/java/jct"
      JT_HOME="$KOORI_ONESTOP/jct-tools/3.1.2/archive/fcs/binaries"
      #JEMMY_JAR="$JT_HOME/jemmy/jemmy.jar"
      JEMMY_JAR="$JPSE04/Jemmy/jemmy.jar"
      #JAVA_HOME="/net/linux-15/export/home/java/jdk1.5.0/x86"
      JAVA_HOME="$KOORI_ONESTOP/jdk/1.5.0/promoted/all/b20/binaries/solaris-i586"
      #TEST_BASE_PATH="/net/linux-15/export/home/java/regtest.tiger/test"
      TEST_BASE_PATH="$KOORI_ONESTOP/jdk/1.5.0/promoted/all/b20/ws/j2se/test"
      TESTVMOPTS="-client"
      CLASSPATH="$JT_HOME/classes:$JT_HOME/lib/javatest.jar:$JT_HOME/lib/jtreg.jar"
      TEST="javax/print/attribute/URLPDFPrinting.java"

      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 -server -cp $CLASSPATH -DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,DISPLAY=:0,HOME=$HOME/.regtest,PATH=/bin:/usr/bin,CPAPPEND=$JEMMY_JAR,TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= -DDISPLAY=:0 -DlocalHost="linux-18" -Dprogram=jtreg com.sun.javatest.regtest.Main -a -v default -batch -params -w "$WORK_DIR" -r "$REPORT_DIR" -t "$TEST_BASE_PATH" "$TEST_BASE_PATH/$TEST"
      --- script end ---

      Test output (jtr part):
      =======================
      ----------System.out:(1/42)----------
      Np PrintService support DocFlavor.URL.PDF
      ----------System.err:(0/0)----------
      result: Failed. Unexpected exit from test [exit code: 1]

      test result: Failed. Unexpected exit from test [exit code: 1]

      Specific machine info:
      ======================
      Hostname: linux-18
      OS: Solaris 10 (x86) (CDE)

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

            jgodinez Jennifer Godinez (Inactive)
            irasunw Ira Ira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: