Bug 980923

Summary: Can't build EAP 6.1.x with a non US system - tests are not locale independent
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Emmanuel Hugonnet (ehsavoie) <ehugonne>
Component: TestsuiteAssignee: Emmanuel Hugonnet (ehsavoie) <ehugonne>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.1.1CC: kkhan, myarboro, pkremens
Target Milestone: DR11   
Target Release: EAP 6.4.0   
Hardware: All   
OS: All   
URL: https://issues.jboss.org/browse/WFLY-1650
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
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: 1003603    
Bug Blocks:    

Description Emmanuel Hugonnet (ehsavoie) 2013-07-03 14:09:45 UTC
Description of problem:
Some unit tests rely on the fact that the default Locale on the plateform should be US. If you're on a non US plateform (French for example) these unit tests will fail.

Steps to Reproduce:
1. Change the locale of the system to French for example
2. Build jboss-eap with maven or with the build.sh script

Actual results:
Unit tests failure

Expected results:
No failure in unit tests as they should be independant from the plateform they are run on.

Additional info:
Tests in error :
 * org.jboss.as.domain.management.security.state.DuplicateUserCheckStateTestCase
 * org.jboss.as.threads.ThreadsSubsystemTestCase
 * org.jboss.as.txn.TransactionSubsystemTestCase
 * org.jboss.as.security.SecurityDomainModelv12UnitTestCase
most of those errors are due when the looger is created with code  like this :


@MessageLogger(projectCode = "JBAS")
public interface TransactionLogger extends BasicLogger {
    TransactionLogger ROOT_LOGGER = Logger.getMessageLogger(TransactionLogger.class, TransactionLogger.class.getPackage().getName());

which relies on the default Locale.

Comment 2 Emmanuel Hugonnet (ehsavoie) 2013-07-04 07:54:13 UTC
In fact this is more a classloading issue than a 'pure' localization issue.
The logging class are generated per language but not all languages are equal in Jboss AS versions.
For French (which was my case) there is no $looger_fr classes in JBoss AS 7.1.2 but they exist in JBoss EAP 6.1.x. Thus when the subsystem is tested for retro-compatibility with Jboss AS 7.1.2  it tries to log messages in French, since the class is not present in the subsytem jar (using a child first classloader) then the class is loaded by the parent but when we are casting it to the generic logger class we are using the generic class loaded by the child classloader and not the one in the parent which creates a ClassCastException.

Comment 8 Pavel Jelinek 2013-10-08 06:56:30 UTC
Tests mentioned above pass, but for EAP 6.2.0 ER4 with fr_FR locale there are still some failing tests:

org.jboss.as.jpa.subsystem.JPA11SubsystemTestCase.testTransformers7_1_2 	
org.jboss.as.jpa.subsystem.JPA11SubsystemTestCase.testTransformersRejectExpressions7_1_2
org.jboss.as.modcluster.ModClusterSubsystemTestCase.testTransformers712 	
org.jboss.as.modcluster.ModClusterSubsystemTestCase.testExpressionsAreRejected712 
org.jboss.as.osgi.parser.OSGiSubsystemTestCase.testTransformerAS712 
org.jboss.as.osgi.parser.OSGiSubsystemTestCase.testRejectExpressionsAS712 

See: 

https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-60-as-testsuite-RHEL-matrix-OracleJDK6-french-pjelinek/1/testReport/

https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-60-as-testsuite-RHEL-matrix-openJDK7-french-pjelinek/1/testReport/

Comment 10 Emmanuel Hugonnet (ehsavoie) 2014-09-29 17:30:33 UTC
Updated PR : 
https://github.com/jbossas/jboss-eap/pull/1738

No Upstream required

Comment 11 Emmanuel Hugonnet (ehsavoie) 2014-09-30 14:27:19 UTC
Upstream PR : https://github.com/wildfly/wildfly-core/pull/210

Comment 12 Petr Kremensky 2014-10-27 14:27:16 UTC
EAP 6.4.0.DR6:
There are still some failures with French locales:
see https://jenkins.mw.lab.eng.bos.redhat.com/hudson/job/eap-6x-as-testsuite-BZ980923-src/1/testReport/
org.jboss.as.test.integration.ejb.timerservice.mgmt.NonPersistentCalendarTimerManagementTestCase
org.jboss.as.test.integration.ejb.timerservice.mgmt.PersistentCalendarTimerManagementTestCase
org.jboss.as.test.integration.ejb.timerservice.mgmt.TimerManagementTestCase

Please ignore fails in LdapCacheInSecurityRealmsTestCase (BZ1155575)

Comment 13 Emmanuel Hugonnet (ehsavoie) 2014-11-21 17:10:00 UTC
PR: https://github.com/jbossas/jboss-eap/pull/2035

Comment 14 Petr Kremensky 2014-11-26 10:59:41 UTC
Verified on EAP 6.4.0.DR11