Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-2452

FreeMarkerResultTest fails when source is checked out to path with spaces

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.1
    • 2.1.1
    • Unit Tests
    • None
    • Patch

    Description

      FreeMarkerResultTest.testWithoutWriteIfCompleted fails when the build is run from a path which contains spaces.

      The reason for this is that the following line code exists in the setUp method of FreeMarkerResultTest;

      servletContext.setRealPath(FreeMarkerResultTest.class.getResource("someFreeMarkerFile.ftl").getFile());

      getResource returns a URL, which means that any spaces are converted into %20, and thus instead of the real path being set as "a b" it gets set as "a%20b" and thus all paths are ".../a%20b/..." instead of ".../a b/..." causing the file to fail to open.

      Attachments

        Activity

          People

            mrdon Donald J. Brown
            alsutton Al Sutton
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: