lbownik commented on a change in pull request #3902:
URL: https://github.com/apache/netbeans/pull/3902#discussion_r840044650



##########
File path: 
platform/openide.util/test/unit/src/org/openide/util/BaseUtilitiesTest.java
##########
@@ -111,31 +112,106 @@ public void testIsJavaIdentifier() throws Exception {
         assertFalse(BaseUtilities.isJavaIdentifier("some.thing"));
     }
 
-    public void testFileURI() throws Exception {
-        if (BaseUtilities.isWindows()) {
-            assertFileURI("C:\\some\\path #1", "file:/C:/some/path%20%231");
-            assertEquals(new File("C:\\some\\path"), BaseUtilities.toFile(new 
URI("file:/C:/some/path")));
-            assertEquals(new File("C:\\some\\path"), BaseUtilities.toFile(new 
URI("file:///C:/some/path")));
-            assertEquals(new File("C:\\some\\path"), BaseUtilities.toFile(new 
URI("file:/C:/some/path/")));
-            assertFileURI("\\\\server\\share\\path", 
"file://server/share/path");
-            assertEquals(new File("\\\\server\\share\\path"), 
BaseUtilities.toFile(new URI("file:////server/share/path")));
-            assertEquals(new File("\\\\server\\share\\path #1"), 
BaseUtilities.toFile(new URI("file:////server/share/path%20%231")));
-        } else {
-            assertFileURI("/some/path #1", "file:/some/path%20%231");
-            assertEquals(new File("/some/path"), BaseUtilities.toFile(new 
URI("file:/some/path")));
-            assertEquals(new File("/some/path"), BaseUtilities.toFile(new 
URI("file:///some/path")));
-            assertEquals(new File("/some/path"), BaseUtilities.toFile(new 
URI("file:/some/path/")));
+    
//--------------------------------------------------------------------------
+    public void test_toFile_throwsNullPonter_whenArgumentIsNull()
+            throws Exception {
+
+        try {
+            toFile(null);
+            fail();
+        } catch (final NullPointerException e) {
+            return;
+        }
+    }
+    
+    
//--------------------------------------------------------------------------
+    public void test_toFile_throwsIllegalArgument_whenGivenNonFileURI()
+            throws Exception {
+
+        try {
+            toFile(new URI("http://example.com";));
+            fail();
+        } catch (final IllegalArgumentException e) {
+            return;

Review comment:
       my mistake - I realized it as well




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to