You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-dev@portals.apache.org by "Neil Griffin (JIRA)" <ji...@apache.org> on 2018/05/07 22:24:00 UTC

[jira] [Created] (PLUTO-712) Contesting V3AnnotationPortletConfigTests_SPEC2_28_SupportedLocales_declaringSupportedLocales1

Neil Griffin created PLUTO-712:
----------------------------------

             Summary: Contesting V3AnnotationPortletConfigTests_SPEC2_28_SupportedLocales_declaringSupportedLocales1
                 Key: PLUTO-712
                 URL: https://issues.apache.org/jira/browse/PLUTO-712
             Project: Pluto
          Issue Type: Bug
          Components: tck
    Affects Versions: 3.0.0
            Reporter: Neil Griffin
            Assignee: Neil Griffin
             Fix For: 3.0.1


The V3AnnotationPortletConfigTests_SPEC2_28_SupportedLocales_declaringSupportedLocales1 test relies on the the {{@PortletConfiguration}} annotation to define supported locales:
{code:java|title=AnnotationPortletConfigTests_SPEC2_28_SupportedLocales.java}
@PortletConfiguration(
   portletName = "AnnotationPortletConfigTests_SPEC2_28_SupportedLocales",
   supportedLocales = {"en_US", "de"}
)
public class AnnotationPortletConfigTests_SPEC2_28_SupportedLocales implements Portlet {
    ...
}
{code}
The test code looks like the following:
{code:java}
Enumeration<Locale> supportedLocales = portletConfig.getSupportedLocales();
List<Locale> supportedLocalesList = Collections.list(supportedLocales);
if(supportedLocalesList.size()==2
    && supportedLocalesList.get(0).toString().equals("en_us")
    && supportedLocalesList.get(1).toString().equals("de")){
        result.setTcSuccess(true);
}
{code}

The problem is that the TCK uses a {{String}} comparison for lower-case {{"en_us"}} which is relying on Pluto's incorrect implementation of {{portletConfig.getSupportedLocales()}}. For more information, see PLUTO-711.

Proposed fix to the test:
{code:java}
if(supportedLocalesList.size()==2
    && supportedLocalesList.get(0).equals(Locale.US)
    && supportedLocalesList.get(1).equals(Locale.GERMAN)) {
        result.setTcSuccess(true);
}
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)