DisplayTag

TestAll breaks if the build path contains a space

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.1
  • Fix Version/s: 1.1
  • Component/s: Build/distribution
  • Labels:
    None
  • Testcase included:
    yes

Description

The displaytag test suite would not run in my sandbox because its path contained a space, namely the space in Windoze's "c:\Documents and Settings" folder. TestAll.findAndStoreTestClasses would blow up with a null-pointer exception, blocking all unit-test execution and generating the following report.
Testsuite: org.displaytag.test.TestAll
Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0 sec

Null Test: Caused an ERROR
null
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Caused by: java.lang.NullPointerException
at org.displaytag.test.ClassFinder.findAndStoreTestClasses(TestAll.java:180)
at org.displaytag.test.ClassFinder.<init>(TestAll.java:156)
at org.displaytag.test.TestAll.suite(TestAll.java:104)
... 7 more
See http://jira.codehaus.org/browse/DISPL-243#action_46601

The problem is the encoded space in the URL used to load the test resources, such that TestAll would attempt to look for test files in "c:\Documents%20and%20Settings"/blah/blah/blah instead of "c:\Documents and Settings\blah\blah\blah.
Attached you'll find a patch that fixes this bug by decoding the URL involved before attempting to find files in the local system.
  1. DisplaytagCasePatch.txt
    20/Sep/05 5:58 PM
    0.9 kB
    Jorge L. Barroso
  2. TestAllPatch.txt
    19/Sep/05 6:56 PM
    1 kB
    Jorge L. Barroso

Activity

Hide
Jorge L. Barroso added a comment -
Same thing happens in DisplaytagCase. See attached patch.
Show
Jorge L. Barroso added a comment - Same thing happens in DisplaytagCase. See attached patch.
Hide
fabrizio giustina added a comment -
fixed in cvs. Thanks, I didn't figured out yet that such error was caused by spaces in the path.
Show
fabrizio giustina added a comment - fixed in cvs. Thanks, I didn't figured out yet that such error was caused by spaces in the path.

People

  • Reporter:
    Anonymous
Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: