Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4733196

Invalid regression test: sun/misc/URLClassPath/FileLoaderTest.java

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.4.1
    • Fix Version/s: 1.4.2
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      mantis
    • CPU:
      x86
    • OS:
      windows_98, windows_xp
    • Verification:
      Verified

      Description

      Name: aaR10208 Date: 08/19/2002


      Filed By : J2SE-SQA [###@###.###
      JDK/JRE : jdk1.4.1-rc-b19
      Testbase : Hopper-regression
      Platform[s] : Windows XP
      Failing Test : sun/misc/URLClassPath/FileLoaderTest.java

      The test uses File.separator constant (which is platform-dependent) to manipulate with
      an URL (which always uses '/' as delimiter), so the test fails on Windows boxes where
      File.separator differs from the URL's delimiter.

      Here is a part of the test (file: sun/misc/URLClassPath/FileLoaderTest.java).

      =====
      [...]
            String basestr = tempFile.toURL().toString();
      ! basestr = basestr.substring(0, basestr.lastIndexOf(File.separator)+1);
            URL url = new URL(basestr+"."+File.separator);
      [...]
      =====
      The line marked with '!' will always return an empty string, as URL never
      contains any File.separator when running on Windows boxes.

      Test source location:
      =====================
      sun/misc/URLClassPath/FileLoaderTest.java

      jtr file location:
      ==================
      /net/jtgb4u4c.eng/export/sail15/results/hopper/b19/regtest/win32/winXP_smp_linux-21/workDir/test/sun/misc/URLClassPath/FileLoaderTest.jtr

      How to reproduce:
      =================
      Compile and run the test on Windows box.

      Test output:
      ============
      [...]
      ----------System.err:(16/850)*----------
      java.net.MalformedURLException: no protocol: .\ at java.net.URL.(URL.java:579)
              at java.net.URL.(URL.java:476)
              at java.net.URL.(URL.java:425)
              at FileLoaderTest.main(FileLoaderTest.java:14)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:324)
              at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:82)
              at java.lang.Thread.run(Thread.java:536)

      JavaTest Message: Test threw exception: java.net.MalformedURLException: no protocol: .\[...]
      Specific Machine Info:
      ======================
      Hostname: linux-21
      Os: Windows XP Home

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

        Attachments

          Activity

            People

            • Assignee:
              ywangsunw Yingxian Wang (Inactive)
              Reporter:
              sundrsunw Sundr Sundr (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: