Bug 42020 - I18N - JUnit Test can't run when NetBeans has been installed in the directory which name has white space
I18N - JUnit Test can't run when NetBeans has been installed in the directory...
Status: CLOSED FIXED
Product: java
Classification: Unclassified
Component: JUnit
3.x
PC All
: P2 (vote)
: 4.x
Assigned To: junit-issues@java
junit-issues@java
: I18N, RELNOTE, SIMPLEFIX, SPACE_IN_PATH
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-04-15 13:35 UTC by Keiichi Oono
Modified: 2004-09-02 15:27 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
The error message when this problem is caused. (637 bytes, text/plain)
2004-04-15 13:36 UTC, Keiichi Oono
Details
one-line patch (808 bytes, patch)
2004-04-19 12:07 UTC, Marian Petras
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Keiichi Oono 2004-04-15 13:35:32 UTC
3.6  Build 20040407

To reproduce:
- install NetBeans into the directory which name 
  has white space 
  (e.g. c:\Program Files\NetBeans36)

- Create JUnit test and run

The attached error is displayed in output window, 
and test can't be run.
When NetBeans is installed in the direcotry that 
name does not include white space, JUnit test can 
work correctly.

This problem is not caused in English environment.
Comment 1 Keiichi Oono 2004-04-15 13:36:42 UTC
Created attachment 14413 [details]
The error message when this problem is caused.
Comment 2 Keiichi Oono 2004-04-15 13:41:29 UTC
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.
Comment 3 Marian Petras 2004-04-19 11:41:44 UTC
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.
Comment 4 Marian Petras 2004-04-19 12:07:43 UTC
Created attachment 14454 [details]
one-line patch
Comment 5 Marian Petras 2004-04-19 12:13:22 UTC
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.
Comment 6 Keiichi Oono 2004-04-19 14:05:57 UTC
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?
Comment 7 Patrick Keegan 2004-04-21 18:20:58 UTC
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.
Comment 8 Marian Petras 2004-04-22 08:21:51 UTC
Correction:

This happens also on Linux and probably on all other operating systems.
Comment 9 Patrick Keegan 2004-04-22 13:54:55 UTC
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.
Comment 10 Marian Petras 2004-04-22 14:00:22 UTC
The release note seems to be correct now. Thank you.
Comment 11 Marian Petras 2004-06-16 17:12:12 UTC
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.
Comment 12 dmladek 2004-09-02 15:27:20 UTC
I'm clossing it since Keichii confirm it as working.
Please reopen it, if you find regresion


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo