This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 534321 - (RHQ-1129) MonitorUtils.formatMetrics fails to use passed locale
MonitorUtils.formatMetrics fails to use passed locale
Status: CLOSED CURRENTRELEASE
Product: RHQ Project
Classification: Other
Component: Core UI (Show other bugs)
1.2
All All
high Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
http://jira.rhq-project.org/browse/RH...
:
Depends On:
Blocks: jon3
  Show dependency treegraph
 
Reported: 2008-11-19 04:20 EST by Heiko W. Rupp
Modified: 2014-05-02 16:20 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-05-02 16:20:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Heiko W. Rupp 2008-11-19 04:20:00 EST
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 
and
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 08:01:55 EST
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 15:24:36 EST
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1129
Comment 3 Jay Shaughnessy 2011-02-11 16:38:56 EST
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.