JDK-6997102 : Test case has hard code, so that applet thread threw exception
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2010-11-03
  • Updated: 2011-04-06
  • Resolved: 2011-04-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7 b132Fixed
Related Reports
Relates :  
Description
bug summary: Applet thread threw exceptionsee 
Testsuite name: swing
JDK/JRE tested: jdk-7-ea-bin-b116-linux-i586-28_oct_2010.bin
jdk-7-ea-bin-b116-linux-amd64-28_oct_2010.bin
OS/architecture: x86 & x64
Reproducible: Always
Reproducible on machine:SLES11-x64 , rhel5-x64
Is it a platform specific regression: N 
Is it a Regression: N 
Test run log location: 
http://jsqalab.sfbay.sun.com/results/Evergreen/7/1.7.0b116/swing/SLES11-X64/results/workdir/javax/swing/JFileChooser/6798062/

Test run result location: http://jsqalab.sfbay.sun.com/results/Evergreen/7/1.7.0b116/swing/SLES11-X64/results/workdir
Steps to reproduce:
1.	Install test bundle JDK7b116  from http://jre.sfbay/java/re/jdk/7/promoted/ea/b116/bundles/linux-i586/ to /workspace/jdk1.7.0
2.	Install Jtreg from http://jre.sfbay.sun.com/java/re/jtreg/3.2.2_03/promoted/latest/binaries/jtreg/ 
To /workspace/reg/jct3.2
3.	Download and unzip ws from 
http://hg.openjdk.java.net/jdk7/swing/jdk
 to /workspace/reg/
4.	Modify the reg_swing.sh as:
/workspace/reg/jct3.2/linux/bin/jtreg -cpa:/workspace/reg/test  -g -v -m -jdk:/workspace/jdk1.7.0 -r:/workspace/reg/results/reportdir -w:/workspace/reg/results/workdir /workspace/reg/test
5.	Make printer work fine
6.	From command line, run ksh reg_swing.sh  
7.	After Jtreg launched, choose testlist filter:
           closed/javax/swing/
           javax/swing
8.	Choose keyword and mark it as manual

Instruction:
Execute  case javax/swing/JFileChooser/6798062/bug6798062.java

Actual behavior:
See attachment"6798062.png" Execution failed: Applet thread threw exception: java.lang.RuntimeException: Directory c: not found.

Analysis:
Source code: 
    private JPanel initialize() {
        File file = new File("c:/");
//There is a hard code there.
        try {
            folder = ShellFolder.getShellFolder(file);
        } catch (FileNotFoundException e) {
            fail("Directory " + file.getPath() + " not found");
        }
Run normal after Modify as blew:
private JPanel initialize() {
        File file = new File("/");

verify:
use jdk7b109 - JDK7b115 on Rhel5-x64 & sles11-x64 found same issue.

Comments
EVALUATION We should: 1. Specify that the test is suitable only for Windows (it actually does) 2. Replace hardcoded folder by an universal one
18-02-2011

EVALUATION "c:\" should be changed to "\"
16-11-2010

EVALUATION Looking at the "C:" in the source code and the instruction to load Windows Task Manager shows that this test should be run only on a Windows environment, Since we ran this on Linux, this test is giving java.lang.RuntimeException: Directory c: not found at bug6798062.fail(bug6798062.java:143) at bug6798062.initialize(bug6798062.java:77) at bug6798062.init(bug6798062.java:68) at com.sun.javatest.regtest.AppletWrapper$AppletRunnable.run(AppletWrapper.java:133) at java.lang.Thread.run(Thread.java:729) STATUS:Failed.Applet thread threw exception: java.lang.RuntimeException: Directory c: not found result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: Directory c: not found test result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: Directory c: not found Need to get clarification on, 1. whether this test is for Windows only. If so, how to restirct and find it before execution, is there is a flag? 2. If the test is intended for other platforms test / instructions needs to be fixed.
05-11-2010