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.

Bug 33037 - I18N - need to mount localized junit-testrunner.jar to see localized messages
Summary: I18N - need to mount localized junit-testrunner.jar to see localized messages
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: JUnit (show other bugs)
Version: 3.x
Hardware: Sun Solaris
: P3 blocker (vote)
Assignee: Marian Petras
URL:
Keywords: I18N
Depends on: 28005
Blocks:
  Show dependency tree
 
Reported: 2003-04-18 06:03 UTC by naokoyo
Modified: 2006-03-24 10:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
snapshot when selected "External" (56.65 KB, image/gif)
2003-04-18 06:05 UTC, naokoyo
Details
snapshot when selected "External". (56.65 KB, image/gif)
2003-04-18 06:09 UTC, naokoyo
Details
snapshot when selected "Internal". (56.77 KB, image/gif)
2003-04-18 06:09 UTC, naokoyo
Details
snapshot when selected "Debugger". (50.28 KB, image/gif)
2003-04-18 06:10 UTC, naokoyo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description naokoyo 2003-04-18 06:03:57 UTC
Execute testcase, we could find the difference
locale msg.
If no change in options(, English msgs are shown
at output-window.
If we selected "Internal" for "Executor for tests"
property, we could see Japanese msgs.
We think results should be localized on any type
of "Executer for tests".

Executor for tests: 
  External - shown in English.    <--- is this
correct?
  Internal - shown in Japanese.
  Debugger - shown in English.    <--- is this
correct?

Steps:
1. Create testcase code files. (tools->JUnit
test->Create tests)
2. Change "Executor for tests" at Options->Testing->
   JUnit Module setting->Expert. we can select 3
type of executor.
   ( External, Internal, Debugger )
3. Execute testcase without changes. (tools->JUnit
test->Execute tests) 
4. Watch output-window.
Comment 1 naokoyo 2003-04-18 06:05:07 UTC
Created attachment 10009 [details]
snapshot when selected "External"
Comment 2 naokoyo 2003-04-18 06:09:22 UTC
Created attachment 10010 [details]
snapshot when selected "External".
Comment 3 naokoyo 2003-04-18 06:09:50 UTC
Created attachment 10011 [details]
snapshot when selected "Internal".
Comment 4 naokoyo 2003-04-18 06:10:27 UTC
Created attachment 10012 [details]
snapshot when selected "Debugger".
Comment 5 Martin Brehovsky 2003-04-18 10:41:22 UTC
There is a problem, that by default only non-localized
junit-testrunner.jar is mounted. So we need to also somehow mount
junit-testrunner_zh_CN.jar

The mounting is done via JUnit's layer.xml (more exactly in
org/netbeans/modules/junit/resources/Mount-java-JUnit-testrunner.xml
and/or org/netbeans/modules/junit/resources/layer.xml), so we might
need to provide some localization to these files. I'll check possible
ways with core developers and let you know.
Comment 6 Martin Brehovsky 2003-04-18 14:20:59 UTC
Actually, one more question - what is your locale setting of your
tests run via external execution? Is it exactly the same as for the
ones running via internal execeution?

I actually saw similar problem, but this was caused by the fact IDE
was run with the -locale cs:CZ switch, but the operating system used
different locale as a default (en_US). In this case tests running via
internal execution run in the same locale as the IDE was running (i.e.
cs_CZ), but when using external execution, the system default locale
was used (i.e. en_US).
Comment 7 Ken Frank 2003-04-18 18:59:46 UTC
Changed the summary to indicate the issue is with need
to mount the localized junit-testrunner.jar to be able
to see localized messages.
ken.frank@sun.com
Comment 8 Martin Brehovsky 2003-04-22 11:09:55 UTC
Could be probably solved as suggested in this mailing list thread:
<http://www.netbeans.org/servlets/BrowseList?listName=nbdev&by=thread&from=14879>

Also there is already a submitted RFE for this:
<http://www.netbeans.org/issues/show_bug.cgi?id=28005>


Comment 9 Martin Brehovsky 2003-04-23 17:11:01 UTC
Will try to fix it for the next release of IDE.
Comment 10 Ken Frank 2003-07-17 20:16:50 UTC
marking as P2 since this (and related rfe) is needed by
l10n releases for next release, or hopefully first nevada
patch. This issue is part of their top list of i18n bugs that
they have analyzed that have customer impact thus marking as P2.
(rfe 28005 also marked as p2)

ken.frank@sun.com
Comment 11 Marian Petras 2003-12-10 10:31:53 UTC
The bug is now partially fixed in the trunk. The current state is that
localized messages are displayed with external execution (which is the
default) but not with internal and debugging execution.
Comment 12 Marian Petras 2003-12-11 08:27:56 UTC
I guess the problem with internal execution is that it does not try to
load the localized .jar (with localized messages). This is due to the
fact that library "junit-testrunner.jar" is loaded by a different
classloader (org.openide.execution.NbClassLoader) than module JUnit
(org.netbeans.core.modules.Module$OneModuleClassLoader).

It seems that the only special functionality of NbClassLoader over a
standard URLClassLoader is that it is able to load classes from
filesystems mounted in the IDE. But it does not try to load resource
bundles from localized .jar files. Since the localized .jar is not
mounted in the IDE repository, it is ignored.
Comment 13 Marian Petras 2003-12-11 08:31:14 UTC
The problem with internal execution is now fixed - localized messages
are displayed. So the only problem is with debugger execution now.

I fixed it by using a custom classloader which looks for resource
bundles in all appropriate localized .jar files.
Comment 14 Marian Petras 2003-12-11 08:44:10 UTC
I lowered the priority since the problem persists only for debugger
execution.
Comment 15 Marian Petras 2005-09-13 17:29:19 UTC
Fixed in the trunk.

A new JUnit Results window has been added to NetBeans 5.0. The window's content
is localizable, except the individual test failure descriptions.

Feel free to reopen this bug if you still see the I18N problem.


Note: There are no "executors" since NetBeans 4.0.
Comment 16 Max Sauer 2006-03-24 10:24:52 UTC
verified in nb5.0 fcs.