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.
Summary: | I18N - JUnit Test can't run when NetBeans has been installed in the directory which name has white space | ||
---|---|---|---|
Product: | java | Reporter: | Keiichi Oono <keiichio> |
Component: | JUnit | Assignee: | junit-issues@java <junit-issues> |
Status: | CLOSED FIXED | ||
Severity: | blocker | CC: | jf4jbug, pkeegan |
Priority: | P2 | Keywords: | I18N, RELNOTE, SIMPLEFIX, SPACE_IN_PATH |
Version: | 3.x | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
The error message when this problem is caused.
one-line patch |
Description
Keiichi Oono
2004-04-15 13:35:32 UTC
Created attachment 14413 [details]
The error message when this problem is caused.
Is it possible to fix this problem by NetBeans 3.6 localized version is released? (The final qa needs to be finished by April/30). I would like to request to fix this before NetBeans 3.6 localized version is released. Because the NetBeans default installation directory name has white space (c:\Program Files\NetBeans 3.6), The JUnit testing can not be run in default installed environment. I've not tested in Chinese or other environment, but I think the same problem is caused when NetBeans is installed into the default directory. Confirmed. The reason why it works with US locale but not with other locales is that when running in other locale, the classpath is modified - localized variants of JUnit testrunner library is added to it. The code that manages the classpath modification is in method org.netbeans.modules.junit.JUnitExternalExecutor.prepareClassPath(...) The method detects if the original (unmodified) classpath contained a space and if full name of any of the localized libraries contains a space. If necessary, quotes should be added to the beginning and to the end of the modified classpath. It seems the method is buggy in this part. Created attachment 14454 [details]
one-line patch
The problem is that the method not only adds quotes to the beginning and to the end of the whole modified classpath but it also quotes full names of localized libraries being added to the classpath. The result is that the classpath may contain multiple quote strings which means that part of the resulting classpath is not quoted. The suggested fix (attached) simple eliminates extra quoting of individual parts of classpath. It is a very simple fix - one line is replaced with another one. I made the fix on Linux. It did not work before I had applied the patch and it works now that the patch is applied. Thank you very much quick fixing! The attached path works in Japanese Winodws 2000. I've tested the attached patch with release36 as follows: - checkout junit with '-r release36' option - apply patch and build - test the built junit.jar with NetBeans 3.6 in Japanese Windows 2000 The tested NetBeans 3.6 was installed into 'C:\Program Files\NetBeans36' Is it possible to apply this patch to relase36 branch? Proposed relnote: Description: JUnit tests can not run in the IDE. This occurs on Microsoft Windows systems in all locales other than en_US when there is a space in the path name of the IDE's installation. Workaround: Re-install the IDE into a folder that does not have a space in its path name. Correction: This happens also on Linux and probably on all other operating systems. proposed relnote fix: Description: JUnit tests can not run in the IDE. This occurs in all locales other than en_US when there is a space in the path name of the IDE's installation. Workaround: Re-install the IDE into a folder that does not have a space in its path name. The release note seems to be correct now. Thank you. Fixed together with adaptation of JUnit for the new build system. The testrunner library is not used any more, so there is no need for modification of classpath, so there is no problem with classpath and execution. One problem that needs to be solved is how to make the messages localized again. I'm clossing it since Keichii confirm it as working. Please reopen it, if you find regresion |