JDK-6383432 : REGRESSION: testcase 6192376 is failing on Solaris but Passing on Windows and Linux with Tiger JDKS.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0u7
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_10
  • CPU: x86
  • Submitted: 2006-02-09
  • Updated: 2011-02-08
  • Resolved: 2006-05-26
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.
Other
5.0u10Resolved
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Testcase from regression workspace, bug6192376.java is failing on Solaris but passing on Windows and Linux platforms with Tiger JDKS.

Testcase Location:
==================
/net/urts071.india/export6/testSuites/Regression/workspace_150/test/javax/swing/JPopupMenu/6192376/bug6192376.java

JDK:
====
java -version
java version "1.5.0_07-ea"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-ea-b01)
Java HotSpot(TM) Client VM (build 1.5.0_07-ea-b01, mixed mode, sharing)

Operating System: 
================
cat /etc/release
Solaris 10 1/06 s10x_u1wos_17 X86
Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
Use is subject to license terms.
Assembled 25 October 2005


Steps to reproduce:
===================
1. Install JDK in test machine.
2. copy attached bug6192376.java, Util.java and JRobot.java files into test machine.
3. Compile all .java files with tested JDK with following command:
   <jdk location>/bin/javac *.java
4. Start the test with the following command:
   <jdk location>/bin/java bug6192376

Expected:
--------
Test should PASS .
Actual:
--------
bash-3.00$ /export/updates/jdks/jdk1.5.0_07/bin/java bug6192376
Exception in thread "main" java.lang.RuntimeException: Popup does not disappear on focus lost with custom key set
        at bug6192376.main(bug6192376.java:89)

Comments
WORK AROUND Use XToolkit.
24-05-2006

EVALUATION It's a bug of MToolkit. This is told in 4851685. In Tiger MToolkit is still the default toolkit on Solaris (not on Mustang). So, this is actually a duplicate of 4851685.
24-05-2006

EVALUATION The test works in right way (it is a denial for the first Andrey Dmitriev's statement in the evaluation section). We shouldn't invert 'if' statement in the frame2 focus listener. See description for the 6192376 for mustang release: popup mustn't hide when frame2 gets focus. I think, the bug is caused by 4851685: Component.requestFocus() fails on Solaris and Linux. The test on Solaris platform fails because frame2 doesn't get focus and frame2.FocusListener.focusGained() is never called. Interesting observation: while the 4851685 bug isn't fixed and is targeted to the dolphin, it doesn't appear in mustang. Probably, it was fixed accidentally by a fix for another bug. For requestFocus() testing I used the following test case from 4851685: ---SOURCE BEGIN--- import java.awt.event.*; import javax.swing.*; public class Test { public static void main(String args[]) { final JFrame frame = new JFrame(); JButton button = new JButton("Test"); frame.getContentPane().add(button); frame.pack(); frame.addFocusListener(new NoisyFocusListener("Frame")); button.addFocusListener(new NoisyFocusListener("Button")); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { JWindow window = new JWindow(frame); JTextField field = new JTextField("Edit Me!"); window.getContentPane().add(field); window.pack(); field.addFocusListener(new NoisyFocusListener("Field")); window.addFocusListener(new NoisyFocusListener("Window")); window.setVisible(true); field.requestFocus(); } }); frame.setVisible(true); } static class NoisyFocusListener implements FocusListener { private String name; public NoisyFocusListener(String name) { this.name = name; } public void focusGained(FocusEvent e) { System.out.println(name + (e.isTemporary() ? " got temporary focus." : " got focus.")); } public void focusLost(FocusEvent e) { System.out.println(name + (e.isTemporary() ? " lost temporary focus." : " lost focus.")); } } ---SOURCE END--- If requestFocus() is working, the 'Field got focus.' message must be shown after button click. I tested two platforms and several JDKs with the following results: --- Platform: SunOS spb-fusion 5.10 Generic sun4u sparc SUNW,Sun-Blade-1000 Test result: FAILED JDK version: java version "1.5.0_04" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_04-b05) Java HotSpot(TM) Server VM (build 1.5.0_04-b05, mixed mode) Test result: FAILED JDK version: java version "1.5.0_08" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_08-b01) Java HotSpot(TM) Server VM (build 1.5.0_07-b02, mixed mode) Test result: PASSED JDK version: java version "1.6.0-beta2" Java(TM) SE Runtime Environment (build 1.6.0-beta2-b78) Java HotSpot(TM) Server VM (build 1.6.0-beta2-b78, mixed mode) --- Platform: Windows XP SP2 Test result: PASSED JDK version: java version "1.5.0_06" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05) Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode) Test result: PASSED JDK version: 1.5.0_08 (self build) Test result: PASSED JDK version: java version "1.6.0-rc" Java(TM) 2 Runtime Environment, Standard Edition (build 1.6.0-rc-b65) Java HotSpot(TM) Client VM (build 1.6.0-rc-b65, mixed mode) --- Because it is a problem with focus, I redirected it to the AWT team.
17-05-2006

EVALUATION Fix for 6192376 works, some problems with test case fixing test in progress...
03-03-2006

EVALUATION Reassigned to Swing as this is the test for the fix in Swing space.
13-02-2006

EVALUATION At first I tried the test on Windows and it got failed. frame2 obtain focus and popup menu become closed. I looked into the test and found it interesting: frame2.addFocusListener(new FocusListener() { public void focusGained(FocusEvent ev) { if(popup.isVisible()) { passed = true; } else { cause = "Popup does not disappear on focus lost with" + " custom key set"; } } Suppose we should invert that statement and thest should pass if popup is NOT visible and vice versa. So this seems a bug in test. (got it from pointed location). This test uses frame.requestFocus() to transfer it to frame2. Then I run it on KDE linux with lastest JDK6.0 build with XAWT enabled and observed that popup menu stay opened and focus WAS transfered on frame2. And it looks like the test should fail here but under that statement it passes. With MToolkit popup menu stay opened and focus doesn't transfer to frame2 and test fails without messages just exception is thrown. Although we already have reports about requestFocus() on Linux we should consider this case too.
10-02-2006