Bug 534321 (RHQ-1129)

Summary: MonitorUtils.formatMetrics fails to use passed locale
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: Core UIAssignee: RHQ Project Maintainer <rhq-maint>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: high    
Version: 1.2CC: cwelton, jshaughn, mazz
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
URL: http://jira.rhq-project.org/browse/RHQ-1129
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-02 20:20:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 678340    

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 
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 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.