Harmony
  1. Harmony
  2. HARMONY-1892

[test][swing] j.s.filechooser.FileSystemViewTest prompts to insert disk into drive A:

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: build - test - ci
    • Labels:
      None
    • Environment:
      Windows
    • Estimated Complexity:
      Novice

      Description

      When running tests, javax.swing.filechooser.FileSystemViewTest.testGetSystemDisplayName() prompts to insert disk into drive A:. This popup dialog stops this test and it fails.
      When running this test from Eclipse, there's no dialog popped up.

      I suggest removing the last two lines from testGetSystemDisplayName() to avoid this popup dialog. The problem lines are (85-86):
      file = File.listRoots()[0];
      assertNotSame(file.getName(), view.getSystemDisplayName(file));

      1. H1892-FileSystemViewTest.2.patch
        0.8 kB
        Alexey A. Ivanov
      2. H1892-FileSystemViewTest.patch
        0.7 kB
        Alexey A. Ivanov

        Issue Links

          Activity

          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open In Progress In Progress
          7d 21h 14m 1 Stepan Mishura 25/Oct/06 08:23
          In Progress In Progress Resolved Resolved
          1h 47m 1 Stepan Mishura 25/Oct/06 10:10
          Resolved Resolved Closed Closed
          966d 10h 40m 1 Mark Hindess 17/Jun/09 20:51
          Mark Hindess made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Hide
          Mark Hindess added a comment -

          This test is not in the exclude list and I've not heard anyone complaining about it so I assume this resolved issue can be closed now.

          Show
          Mark Hindess added a comment - This test is not in the exclude list and I've not heard anyone complaining about it so I assume this resolved issue can be closed now.
          Hide
          Alexey A. Ivanov added a comment -

          Sorry, Stepan,
          I must not have applied the patch when tested it on Linux.

          We have a problem with Linux here since RI returns "/" whereas Harmony returns "". Therefore it's bug in Harmony.

          Show
          Alexey A. Ivanov added a comment - Sorry, Stepan, I must not have applied the patch when tested it on Linux. We have a problem with Linux here since RI returns "/" whereas Harmony returns "". Therefore it's bug in Harmony.
          Hide
          Stepan Mishura added a comment -

          Hi Alexey,

          With the second patch the test fails on Linux with:

          name is empty

          junit.framework.AssertionFailedError: name is empty at javax.swing.filechooser.FileSystemViewTest.assertNotEmpty(FileSystemViewTest.java:150) at javax.swing.filechooser.FileSystemViewTest.testGetSystemDisplayName(FileSystemViewTest.java:87) at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) at javax.swing.BasicSwingTestCase.runBareSuper(BasicSwingTestCase.java:117) at javax.swing.SwingTestCase$1.run(SwingTestCase.java:45) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:88) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:77) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:131) at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:75) at java.awt.EventDispatchThread.run(EventDispatchThread.java:48)

          Could you comment/verify this?

          Thanks,
          Stepan.

          Show
          Stepan Mishura added a comment - Hi Alexey, With the second patch the test fails on Linux with: name is empty junit.framework.AssertionFailedError: name is empty at javax.swing.filechooser.FileSystemViewTest.assertNotEmpty(FileSystemViewTest.java:150) at javax.swing.filechooser.FileSystemViewTest.testGetSystemDisplayName(FileSystemViewTest.java:87) at java.lang.reflect.AccessibleObject.invokeV(AccessibleObject.java:25) at javax.swing.BasicSwingTestCase.runBareSuper(BasicSwingTestCase.java:117) at javax.swing.SwingTestCase$1.run(SwingTestCase.java:45) at java.awt.event.InvocationEvent.runAndNotify(InvocationEvent.java:88) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:77) at java.awt.EventQueueCore.dispatchEventImpl(EventQueueCore.java:131) at java.awt.EventQueue.dispatchEvent(EventQueue.java:144) at java.awt.EventDispatchThread.runModalLoop(EventDispatchThread.java:75) at java.awt.EventDispatchThread.run(EventDispatchThread.java:48) Could you comment/verify this? Thanks, Stepan.
          Alexey A. Ivanov made changes -
          Link This issue is blocked by HARMONY-1893 [ HARMONY-1893 ]
          Hide
          Alexey A. Ivanov added a comment -

          The new patch are to be applied after the patch from HARMONY-1893.

          I confirm that modification of code at r467585 have resolved the problem.

          Show
          Alexey A. Ivanov added a comment - The new patch are to be applied after the patch from HARMONY-1893 . I confirm that modification of code at r467585 have resolved the problem.
          Alexey A. Ivanov made changes -
          Attachment H1892-FileSystemViewTest.2.patch [ 12343616 ]
          Hide
          Alexey A. Ivanov added a comment -

          This new (.2.) patch modifies the last assertion in testGetSystemDisplayName() to coincide with similar assertions that get patched with HARMONY-1893.

          Show
          Alexey A. Ivanov added a comment - This new (.2.) patch modifies the last assertion in testGetSystemDisplayName() to coincide with similar assertions that get patched with HARMONY-1893 .
          Hide
          Alexey A. Ivanov added a comment -

          Stepan, thank you for finding the root cause. I must have missed it while looking at the test.
          But I have some corrections: file.deleteOnExit() is always safe because it is called on the object created in setUp(). It is file.delete() from tearDown() that caused problems. It is needed there to make sure any files created are removed from the system, because several tests assign another object to the file field.

          In regards to the fixes from HARMONY-1893, I'd prefer to modify the last assertion in testGetSystemDisplayName(). I'll prepare another patch.
          And once again thank you for your great effort!

          Show
          Alexey A. Ivanov added a comment - Stepan, thank you for finding the root cause. I must have missed it while looking at the test. But I have some corrections: file.deleteOnExit() is always safe because it is called on the object created in setUp(). It is file.delete() from tearDown() that caused problems. It is needed there to make sure any files created are removed from the system, because several tests assign another object to the file field. In regards to the fixes from HARMONY-1893 , I'd prefer to modify the last assertion in testGetSystemDisplayName(). I'll prepare another patch. And once again thank you for your great effort!
          Stepan Mishura made changes -
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Resolved [ 5 ]
          Hide
          Stepan Mishura added a comment -

          I disagreed with removing these two line. I like them
          The problem is that test tries to delete drive A:. Let's look into the test:

          private File file;

          protected void setUp() throws Exception

          { .... file = new File(new File(System.getProperty("user.home")), new Integer((int)(Math.random() * 1000)).toString()); file.deleteOnExit(); // <====== THE TEST TRIES TO DELETE IT HERE }

          protected void tearDown() throws Exception

          { .... file.delete();// <====== AND HERE }

          public void testGetSystemDisplayName() throws Exception

          { .... file = File.listRoots()[0]; //<========= IT IS DRIVE A: (of cause if you have one) assertNotSame(file.getName(), view.getSystemDisplayName(file)); }

          The bug was fixed in SWING module at r467585. Please check that the fix fully resolves your problem.

          Show
          Stepan Mishura added a comment - I disagreed with removing these two line. I like them The problem is that test tries to delete drive A:. Let's look into the test: private File file; protected void setUp() throws Exception { .... file = new File(new File(System.getProperty("user.home")), new Integer((int)(Math.random() * 1000)).toString()); file.deleteOnExit(); // <====== THE TEST TRIES TO DELETE IT HERE } protected void tearDown() throws Exception { .... file.delete();// <====== AND HERE } public void testGetSystemDisplayName() throws Exception { .... file = File.listRoots()[0]; //<========= IT IS DRIVE A: (of cause if you have one) assertNotSame(file.getName(), view.getSystemDisplayName(file)); } The bug was fixed in SWING module at r467585. Please check that the fix fully resolves your problem.
          Stepan Mishura made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Stepan Mishura made changes -
          Assignee Stepan Mishura [ smm ]
          Show
          Alexei Fedotov added a comment - See http://wiki.apache.org/harmony/Unit_Tests_Pass_on_DRLVM
          Hide
          Paulex Yang added a comment -

          Neither do I, any committer has a machine with A:/ ?

          Show
          Paulex Yang added a comment - Neither do I, any committer has a machine with A:/ ?
          Mark Hindess made changes -
          Assignee Mark Hindess [ hindessm ]
          Hide
          Mark Hindess added a comment -

          I can't reproduce this so I'll leave it to someone who can.

          Show
          Mark Hindess added a comment - I can't reproduce this so I'll leave it to someone who can.
          Mark Hindess made changes -
          Assignee Mark Hindess [ hindessm ]
          Alexey A. Ivanov made changes -
          Field Original Value New Value
          Attachment H1892-FileSystemViewTest.patch [ 12343173 ]
          Hide
          Alexey A. Ivanov added a comment -

          Removed the problem lines.

          Show
          Alexey A. Ivanov added a comment - Removed the problem lines.
          Hide
          Alexey A. Ivanov added a comment -

          See the corresponding discussion on the mailing list: http://thread.gmane.org/gmane.comp.java.harmony.devel/16243/focus=16243

          See also HARMONY-1893

          Show
          Alexey A. Ivanov added a comment - See the corresponding discussion on the mailing list: http://thread.gmane.org/gmane.comp.java.harmony.devel/16243/focus=16243 See also HARMONY-1893
          Alexey A. Ivanov created issue -

            People

            • Assignee:
              Stepan Mishura
              Reporter:
              Alexey A. Ivanov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development