This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 238625 - ProxyURLStreamHandlerFactoryTest.testUNCFileURLStreamHandler fails on windows
Summary: ProxyURLStreamHandlerFactoryTest.testUNCFileURLStreamHandler fails on windows
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Module System (show other bugs)
Version: 8.0
Hardware: PC Linux
: P1 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: TEST
Depends on:
Blocks:
 
Reported: 2013-11-20 16:36 UTC by Jaroslav Tulach
Modified: 2013-11-26 13:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2013-11-20 16:36:49 UTC
Since we switched Utililites.toURI(file) to file.toPath().toUri() the org.bootstrap.ProxyURLStreamHandlerFactoryTest.testUNCFileURLStreamHandler is failing.

I can fix the test, but I don't know if that is what should be done. CCing Jesse and Jirka. Both touched the test and related URI conversion infrastructure.
Comment 2 Jaroslav Tulach 2013-11-20 17:23:42 UTC
Please review: http://hg.netbeans.org/ergonomics/rev/03f653d52e6c
Comment 3 Jesse Glick 2013-11-20 17:52:39 UTC
Looks right to me. Not sure why this test was here rather than in UtilitiesTest.
Comment 4 Jiri Skrivanek 2013-11-22 10:26:26 UTC
I am far from filesystems for a long time but URI "file://computerName/sharedFolder/a/b/c/d.txt" does not seem correct to me. The following fails:

new File(URI.create("file://computerName/sharedFolder/a/b/c/d.txt"));

java.lang.IllegalArgumentException: URI has an authority component
	at java.io.File.<init>(File.java:423)

----
Comment above test reads:

 /** Tests UNC path is correctly treated. On JDK1.5 UNCFileStreamHandler should 
  * be installed in ProxyURLStreamHandlerFactory to workaround JDK bug
  * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5086147.
  */

I really don't remember all consequences but UNCFileStreamHandler class seems to be gone, so it is possible to move the test to UtilitiesTest.
Comment 5 Jesse Glick 2013-11-22 15:52:18 UTC
(In reply to Jiri Skrivanek from comment #4)
> The following fails:
> 
> new File(URI.create("file://computerName/sharedFolder/a/b/c/d.txt"));

Because this call is known to be broken. You have to use Paths.get(URI) in JDK 7, or Utilities.toFile(URI) which works also in JDK 6.

(Did I hear that the NB source code is now JDK 7+ only? Then Utilities.toFile and a bunch of related code can be simplified to use java.nio.file unconditionally and not bother with JDK 6 fallbacks.)
Comment 7 Jaroslav Tulach 2013-11-26 13:16:09 UTC
OK, Jesse explained that the current behavior is correct. Closing again.