<Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF.

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

<Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF.

amresh-sahu
Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java

Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.

Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.

-------------

Commit messages:
 - Checked-in fix for JDK-8075909.
 - Merge pull request #2 from openjdk/master

Changes: https://git.openjdk.java.net/jdk/pull/2587/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2587&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8075909
  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2587.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2587/head:pull/2587

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF.

amresh-sahu
On Tue, 16 Feb 2021 13:42:09 GMT, Amresh Sahu <[hidden email]> wrote:

> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>
> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>
> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.

@shurymury @akolarkunnu Please review my changes.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF.

Alexey Ivanov-2
In reply to this post by amresh-sahu
On Tue, 16 Feb 2021 13:42:09 GMT, Amresh Sahu <[hidden email]> wrote:

> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>
> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>
> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.

test/jdk/javax/swing/JFileChooser/6698013/bug6698013.java line 56:

> 54:         chooser.showOpenDialog(null);
> 55:     }
> 56: }

Shall we eliminate code duplication between main() and init()?

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF.

amresh-sahu
On Tue, 16 Feb 2021 14:11:49 GMT, Alexey Ivanov <[hidden email]> wrote:

>> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>>
>> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>>
>> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.
>
> test/jdk/javax/swing/JFileChooser/6698013/bug6698013.java line 56:
>
>> 54:         chooser.showOpenDialog(null);
>> 55:     }
>> 56: }
>
> Shall we eliminate code duplication between main() and init()?

init method is part of applet version of test case. It needs to be completely converted to java version. I will do the appropriate changes.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF.

Alexey Ivanov-2
On Tue, 16 Feb 2021 15:26:38 GMT, Amresh Sahu <[hidden email]> wrote:

>
>
> init method is part of applet version of test case. It needs to be completely converted to java version. I will do the appropriate changes.

No, it's not necessary. I meant the opposite. You can create an instance of the test class and call init():
SwingUtilities.invokeAndWait(() -> new bug6698013().init());
Moreover, Swing components should be created and manipulated on EDT, which does not hold for the current main().

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF.

amresh-sahu
On Tue, 16 Feb 2021 15:32:02 GMT, Alexey Ivanov <[hidden email]> wrote:

>> init method is part of applet version of test case. It needs to be completely converted to java version. I will do the appropriate changes.
>
>>
>>
>> init method is part of applet version of test case. It needs to be completely converted to java version. I will do the appropriate changes.
>
> No, it's not necessary. I meant the opposite. You can create an instance of the test class and call init():
> SwingUtilities.invokeAndWait(() -> new bug6698013().init());
> Moreover, Swing components should be created and manipulated on EDT, which does not hold for the current main().

I will incorporate the suggested change.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF. [v2]

amresh-sahu
In reply to this post by amresh-sahu
> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>
> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>
> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.

Amresh Sahu has updated the pull request incrementally with one additional commit since the last revision:

  Update bug6698013.java
 
  Removed duplicate code.

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2587/files
  - new: https://git.openjdk.java.net/jdk/pull/2587/files/0beb1e01..bc0b46eb

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2587&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2587&range=00-01

  Stats: 6 lines in 1 file changed: 3 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2587.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2587/head:pull/2587

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF. [v2]

Alexandre Iline
On Tue, 16 Feb 2021 16:02:56 GMT, Amresh Sahu <[hidden email]> wrote:

>> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>>
>> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>>
>> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.
>
> Amresh Sahu has updated the pull request incrementally with one additional commit since the last revision:
>
>   Update bug6698013.java
>  
>   Removed duplicate code.

test/jdk/javax/swing/JFileChooser/6698013/bug6698013.java line 50:

> 48:             SwingUtilities.invokeAndWait(() -> new bug6698013().init());
> 49:         } catch (InvocationTargetException | InterruptedException e) {
> 50:            e.printStackTrace();

The test should, probably, fail in case of the exception.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF. [v2]

Alexey Ivanov-2
On Tue, 16 Feb 2021 16:06:27 GMT, Alexandre Iline <[hidden email]> wrote:

>> Amresh Sahu has updated the pull request incrementally with one additional commit since the last revision:
>>
>>   Update bug6698013.java
>>  
>>   Removed duplicate code.
>
> test/jdk/javax/swing/JFileChooser/6698013/bug6698013.java line 50:
>
>> 48:             SwingUtilities.invokeAndWait(() -> new bug6698013().init());
>> 49:         } catch (InvocationTargetException | InterruptedException e) {
>> 50:            e.printStackTrace();
>
> The test should, probably, fail in case of the exception.

Yes, it's safe to declare `main` with `throws Exception`; `main` is for convenience to run the test quickly on the command line.

The test harness does not use `main`, it runs the test as applet.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF [v3]

amresh-sahu
In reply to this post by amresh-sahu
> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>
> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>
> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.

Amresh Sahu has updated the pull request incrementally with one additional commit since the last revision:

  Update bug6698013.java

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2587/files
  - new: https://git.openjdk.java.net/jdk/pull/2587/files/bc0b46eb..1558d65f

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2587&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2587&range=01-02

  Stats: 6 lines in 1 file changed: 0 ins; 4 del; 2 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2587.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2587/head:pull/2587

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF [v3]

Prasanta Sadhukhan-2
On Wed, 17 Feb 2021 03:56:56 GMT, Amresh Sahu <[hidden email]> wrote:

>> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>>
>> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>>
>> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.
>
> Amresh Sahu has updated the pull request incrementally with one additional commit since the last revision:
>
>   Update bug6698013.java

I guess since you are modifying the test, it's better to convert into main based  from applet.
Please remove %W% %E% from @test tag and also @author tag
Also, JFileChooser.showOpenDialog() can throw HeadlessException, so you need to mark the test @headful once you convert to main based.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF [v3]

Alexey Ivanov-2
On Wed, 17 Feb 2021 04:06:36 GMT, Prasanta Sadhukhan <[hidden email]> wrote:

>
>
> I guess since you are modifying the test, it's better to convert into main based from applet.
> Please remove %W% %E% from @test tag and also @author tag
> Also, JFileChooser.showOpenDialog() can throw HeadlessException, so you need to mark the test @headful once you convert to main based.

@mrserb is against converting manual applet-based tests one-by-one, see [his comment](https://github.com/openjdk/jdk/pull/2094#discussion_r558717221) in #2094. Thus, I'd rather leave the test as is. However, I agree `%W% %E%` can be removed from `@test` tag and `@author` tag can be dropped completely.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF [v3]

Alexey Ivanov-2
On Wed, 17 Feb 2021 13:47:19 GMT, Alexey Ivanov <[hidden email]> wrote:

>> I guess since you are modifying the test, it's better to convert into main based  from applet.
>> Please remove %W% %E% from @test tag and also @author tag
>> Also, JFileChooser.showOpenDialog() can throw HeadlessException, so you need to mark the test @headful once you convert to main based.
>
>>
>>
>> I guess since you are modifying the test, it's better to convert into main based from applet.
>> Please remove %W% %E% from @test tag and also @author tag
>> Also, JFileChooser.showOpenDialog() can throw HeadlessException, so you need to mark the test @headful once you convert to main based.
>
> @mrserb is against converting manual applet-based tests one-by-one, see [his comment](https://github.com/openjdk/jdk/pull/2094#discussion_r558717221) in #2094. Thus, I'd rather leave the test as is. However, I agree `%W% %E%` can be removed from `@test` tag and `@author` tag can be dropped completely.

I would also suggest expanding the wildcard import
import javax.swing.*;
with imports of specific classes that are used by the test and then sorting the imports. An IDE can do this for you.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF [v3]

Alexey Ivanov-2
In reply to this post by amresh-sahu
On Wed, 17 Feb 2021 03:56:56 GMT, Amresh Sahu <[hidden email]> wrote:

>> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>>
>> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>>
>> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.
>
> Amresh Sahu has updated the pull request incrementally with one additional commit since the last revision:
>
>   Update bug6698013.java

test/jdk/javax/swing/JFileChooser/6698013/bug6698013.java line 46:

> 44:     final static VirtualFile subdirFile = new VirtualFile("testdir/subdir/subtest.txt", false);
> 45:
> 46:     public static void main(String[] args) throws InvocationTargetException, InterruptedException {

Suggestion:

    public static void main(String[] args) throws Exception {
For simplicity.

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF [v4]

amresh-sahu
In reply to this post by amresh-sahu
> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>
> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>
> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.

Amresh Sahu has updated the pull request incrementally with two additional commits since the last revision:

 - Update bug6698013.java
 - Update bug6698013.java

-------------

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2587/files
  - new: https://git.openjdk.java.net/jdk/pull/2587/files/1558d65f..8201db90

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2587&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2587&range=02-03

  Stats: 10 lines in 1 file changed: 4 ins; 3 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2587.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2587/head:pull/2587

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

Re: <Swing Dev> RFR: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF [v4]

Alexey Ivanov-2
On Thu, 18 Feb 2021 07:39:00 GMT, Amresh Sahu <[hidden email]> wrote:

>> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>>
>> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>>
>> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.
>
> Amresh Sahu has updated the pull request incrementally with two additional commits since the last revision:
>
>  - Update bug6698013.java
>  - Update bug6698013.java

Marked as reviewed by aivanov (Reviewer).

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587
Reply | Threaded
Open this post in threaded view
|

<Swing Dev> Integrated: JDK-8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF

amresh-sahu
In reply to this post by amresh-sahu
On Tue, 16 Feb 2021 13:42:09 GMT, Amresh Sahu <[hidden email]> wrote:

> Test name(s): javax/swing/JFileChooser/6698013/bug6698013.java
>
> Problem: A manual regression test case instructions does not match with the UI shown to the user. Instruction says to click Open button while the File chooser dialog shows the Save button.
>
> Fix: There is code in test case to open file save dialog instead of file open dialog. Test case modified to show open file dialog. Fix has been tested on windows platform. This issue is not OS specific.

This pull request has now been integrated.

Changeset: 0e9c5aed
Author:    Amresh Sahu <[hidden email]>
Committer: Alexandre Iline <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/0e9c5aed
Stats:     14 lines in 1 file changed: 5 ins; 5 del; 4 mod

8075909: [TEST_BUG] The regression-swing case failed as it does not have the 'Open' button when select 'subdir' folder with NimbusLAF

Reviewed-by: aivanov

-------------

PR: https://git.openjdk.java.net/jdk/pull/2587