JDK-4880721 : Regression-test .../ActivateFocusTest.html fails on Windows
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86,itanium
  • Submitted: 2003-06-18
  • Updated: 2007-05-15
  • Resolved: 2007-05-15
Related Reports
Duplicate :  
Relates :  
Description
Name: vsR10238			Date: 06/18/2003


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.4.2 (b26,b27), JDK1.4.1 (b21)
Testbase       : Regression-test
Platform[s]    : Windows 2003 Enterprise, Windows 2000
Falling test[s]: 
        java/awt/Focus/ActivateFocusTest/ActivateFocusTest.html 

Regression-test java/awt/Focus/ActivateFocusTest/ActivateFocusTest.html test fails intermittently
with JDK1.4.2 (tested with b26, b27), JDK1.4.1 (tested with b21) 
on Windows 2003 (both 32 and 64 bit), Windows 2000.

When the test fails its test frames flicker yielding focus to each other.

Test source location:
=====================
/java/re/jdk/1.4.2/promoted/latest/ws/j2se/test/java/awt/Focus/ActivateFocusTest/ActivateFocusTest.html

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="h:/jct-tools/3.1.2"                                                                                               
#JAVA_HOME="c:/j2sdk1.4.2"                                                                                                 
JAVA_HOME="z:/jdk/1.4.1/archive/fcs/binaries/windows-ia64"                                                                 
#JAVA_HOME="z:/jdk/1.4.2/promoted/fcs/b27/binaries/windows-ia64"                                                           
#JAVA_HOME="z:/jdk/1.4.2/promoted/rc/b26/binaries/windows-ia64"                                                            
TEST_BASE_PATH="z:/jdk/1.4.2/promoted/rc/b26/ws/j2se/test"                                                                 
                                                                                                                           
JEMMY_JAR=h:/Jemmy/jemmy.jar                                                                                               
                                                                                                                           
HOST=`uname -n`                                                                                                            
                                                                                                                           
TESTWITH=$JAVA_HOME                                                                                                        
TESTJAVA=$JAVA_HOME                                                                                                        
                                                                                                                           
JTOPTS="-server"                                                                                                           
TESTVMOPTS="-server"                                                                                                       
                                                                                                                           
CLASSPATH="$JT_HOME/classes;$JT_HOME/lib/javatest.jar;$JT_HOME/lib/jtreg.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 -version                                                                                               
                                                                                                                           
$JAVA_HOME/bin/java -cp $CLASSPATH $JTOPTS \                                                                               
-DenvVars=TESTJAVAHOME=$JAVA_HOME,TESTVMOPTS=$TESTVMOPTS,\                                                                 
DISPLAY=:0,HOME=$HOME/.regtest,SystemRoot=d:/w2k,PATH=C:/PROGRA~2/MKSTOO~1/mksnt,CPAPPEND=$JEMMY_JAR,\                     
TZ=,LC_ALL=en_US,LC_CTYPE=en_US,LANG=en_US,LPDEST= \                                                                       
-DDISPLAY=:0 -DlocalHost="$HOST" -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/java/awt/Focus/ActivateFocusTest/ActivateFocusTest.html"                                                  

--- script end ---


Test output (jtr part):
=======================
----------System.out:(0/0)----------
----------System.err:(5/385)----------
java.lang.RuntimeException: TEST FAILED - focus is gained more than one time
	at ActivateFocusTest.start(ActivateFocusTest.java:81)
	at com.sun.javatest.regtest.AppletWrapper$AppletThread.run(AppletWrapper.java:133)
	at java.lang.Thread.run(Thread.java:534)
STATUS:Failed.Applet thread threw exception: java.lang.RuntimeException: TEST FAILED - focus is gained more than one time
result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: TEST FAILED - focus is gained more than one time


test result: Failed. Execution failed: Applet thread threw exception: java.lang.RuntimeException: TEST FAILED - focus is gained more than one time


Specific machine info:
======================
Hostname: JCC-ITANIUM-02
OS: Windows 2003 Enterprise

Hostname: jck-win6
OS: Windows 2003 Enterprise

Hostname: bublik
OS: Windows 2000


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

Comments
EVALUATION Name: osR10079 Date: 07/09/2003 I'm unable to reproduce the problem on our Windows 2000 machines. ###@###.### 2003-07-09 ====================================================================== Name: osR10079 Date: 09/01/2003 If modify the test so window listener will request focus after next SequencedEvent posted It fails every time on Windows. This happens because original fix for 4369903 was lost after complete rewriting of focus request architecture. We should consider refixing it. Here are the changes for the test: *** /tmp/geta24015 Mon Sep 1 15:30:51 2003 *************** *** 102,109 **** num=i; addWindowListener(new WindowAdapter() { public void windowActivated(WindowEvent e) { ! if (lw != null) ! { lw.requestFocus(); } } num=i; addWindowListener(new WindowAdapter() { public void windowActivated(WindowEvent e) { ! System.err.println(e); ! EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); ! AWTEvent next_event = null; ! while ((next_event = eq.peekEvent(FocusEvent.FOCUS_LAST + 1)) == null) { ! try { ! Sysout.println("next event is null"); ! Thread.sleep(10); ! } catch (InterruptedException ie) { ! ie.printStackTrace(); ! } ! } ! Sysout.println(next_event.toString()); ! if (lw != null) { ! Sysout.println("requesting on lw"); lw.requestFocus(); } } *************** *** 294,299 **** public void displayMessage( String messageIn ) { messageText.append( messageIn + "\n" ); + System.err.println(messageIn); } }// TestDialog class ###@###.### 2003-9-1 ======================================================================
01-09-2003