Bug 534321 (RHQ-1129) - MonitorUtils.formatMetrics fails to use passed locale
Summary: MonitorUtils.formatMetrics fails to use passed locale
Alias: RHQ-1129
Product: RHQ Project
Classification: Other
Component: Core UI
Version: 1.2
Hardware: All
OS: All
medium vote
Target Milestone: ---
: ---
Assignee: RHQ Project Maintainer
QA Contact:
URL: http://jira.rhq-project.org/browse/RH...
Depends On:
Blocks: jon3
TreeView+ depends on / blocked
Reported: 2008-11-19 09:20 UTC by Heiko W. Rupp
Modified: 2014-05-02 20:20 UTC (History)
3 users (show)

Clone Of:
Last Closed: 2014-05-02 20:20:38 UTC

Attachments (Terms of Use)

Description Heiko W. Rupp 2008-11-19 09:20:00 UTC
MonitorUtilTest tests fail if the server locale is not US :

java.lang.AssertionError: expected:<5.1h> but was:<5,1h>
	at org.testng.AssertJUnit.assertEquals(AssertJUnit.java:97)
	at org.testng.AssertJUnit.assertEquals(AssertJUnit.java:104)
	at org.rhq.enterprise.gui.legacy.util.MonitorUtilsTest.testFormatTimeMetrics(MonitorUtilsTest.java:96)

Looking at the code shows that the test method explicitly asks for US locale, but that the code in 
MonitorUtils.formatMetrics(MetricDisplaySummary, Locale) ignores it 
MonitorUtils.formatMetrics(List,...) only uses it in one case.

The formatting code is indeed returning the right formatting for my non-US locale.

Comment 1 Heiko W. Rupp 2008-12-03 13:01:55 UTC
NOTE: Revision 2179 changes the tests in a way that the returned data (which is in the user locale) gets compared against localized versions of the reference data.
If MonitorUtils.formatMetrics() is fixed, then it will be also necessary to basically revert rev2179.

Comment 2 Red Hat Bugzilla 2009-11-10 20:24:36 UTC
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1129

Comment 3 Jay Shaughnessy 2011-02-11 21:38:56 UTC
The original issue may or may not still be valid but we need to look into unit conversion and unit labels in the new interface, and taking I18N into consideration.

Note You need to log in before you can comment on or make changes to this bug.