Example usage for java.util Locale ENGLISH

List of usage examples for java.util Locale ENGLISH

Introduction

In this page you can find the example usage for java.util Locale ENGLISH.

Prototype

Locale ENGLISH

To view the source code for java.util Locale ENGLISH.

Click Source Link

Document

Useful constant for language.

Usage

From source file:org.osiam.resource_server.storage.query.UserFilterParser.java

@Override
protected QueryField<UserEntity> getFilterField(String sortBy) {
    return UserQueryField.fromString(sortBy.toLowerCase(Locale.ENGLISH));
}

From source file:de.devbliss.apitester.ApiRequest.java

/**
 * Get the cookie value with the given name
 * //w ww  .  j a va  2 s.  c o m
 * @param name The name of the cookie.
 * @return The value, or null if no cookie with that name was found
 */
public String getCookie(String name) {
    return cookies.get(name.toLowerCase(Locale.ENGLISH));
}

From source file:org.openmrs.module.pihcore.reporting.dataset.manager.EncounterDataSetManagerTest.java

@Before
@Override//from w  w  w. j a v  a2s  .  c o m
public void setup() throws Exception {
    super.setup();
    Context.setLocale(Locale.ENGLISH);
    deployService.installBundle(haitiPatientIdentifierTypeBundle);
    deployService.installBundle(socioEconomicConcepts);
    deployService.installBundle(mockConcepts);
    ;
}

From source file:org.terasoluna.gfw.common.codelist.i18n.SimpleI18nCodeListTest.java

@Test
public void testSetRows01() {
    assertThat(testSetRows01.codeListTable.size(), is(14)); // 2 rows x 7
                                                            // columns

    Map<String, String> row1 = testSetRows01.asMap(Locale.ENGLISH);
    assertThat(row1, is(notNullValue()));
    assertThat(row1.keySet().toString(), is("[0, 1, 2, 3, 4, 5, 6]")); // check
                                                                       // order
    assertThat(row1.get("0"), is("Sun."));
    assertThat(row1.get("1"), is("Mon."));
    assertThat(row1.get("2"), is("Tue."));
    assertThat(row1.get("3"), is("Wed."));
    assertThat(row1.get("4"), is("Thu."));
    assertThat(row1.get("5"), is("Fri."));
    assertThat(row1.get("6"), is("Sat."));

    Map<String, String> row2 = testSetRows01.asMap(Locale.JAPANESE);
    assertThat(row2, is(notNullValue()));
    assertThat(row2.keySet().toString(), is("[0, 1, 2, 3, 4, 5, 6]")); // check
                                                                       // order
    assertThat(row2.get("0"), is(""));
    assertThat(row2.get("1"), is(""));
    assertThat(row2.get("2"), is("?"));
    assertThat(row2.get("3"), is(""));
    assertThat(row2.get("4"), is(""));
    assertThat(row2.get("5"), is(""));
    assertThat(row2.get("6"), is(""));
}

From source file:org.gravidence.gravifon.util.BasicUtils.java

/**
 * Converts a string to lower case using {@link Locale.ENGLISH ENGLISH} locale.
 * /*from   w  w  w . j  a  v  a  2  s. c  o  m*/
 * @param value string value
 * @return string value in lower case
 */
public static String lowerCase(String value) {
    return StringUtils.lowerCase(value, Locale.ENGLISH);
}

From source file:org.alfresco.error.AlfrescoRuntimeExceptionTest.java

@Override
protected void setUp() throws Exception {
    // Re-set the current locale to be the default
    Locale.setDefault(Locale.ENGLISH);
    I18NUtil.setLocale(Locale.getDefault());
}

From source file:MondrianConnector.java

public ArrayList<LinkedHashMap<String, String>> ExecuteQuery(Query queryObject) throws Exception {
    System.setProperty("mondrian.olap.SsasCompatibleNaming", "true");
    String connectionString = getConnectionString(queryObject);
    RolapConnection connection = (RolapConnection) DriverManager.getConnection(connectionString, null);
    mondrian.olap.Query query = connection.parseQuery(queryObject.getMdxQuery());
    Result result = connection.execute(query);
    ArrayList<LinkedHashMap<String, String>> data = new ArrayList<LinkedHashMap<String, String>>();
    DecimalFormat df = new DecimalFormat("0", DecimalFormatSymbols.getInstance(Locale.ENGLISH));
    df.setMaximumFractionDigits(340); //340 = DecimalFormat.DOUBLE_FRACTION_DIGITS
    if (result.getAxes().length == 1) {
        //Only One Axis has come so
        ArrayList<String> measures = new ArrayList<String>();
        for (Position p : result.getAxes()[0].getPositions()) {
            measures.add(p.get(0).getUniqueName().toString());
        }/*from   ww  w .java 2  s  . c om*/
        LinkedHashMap<String, String> row = new LinkedHashMap<String, String>();
        for (int i = 0; i < measures.size(); i++) {

            Object value = result.getCell(new int[] { i }).getValue();
            if (value == null) {
                row.put(measures.get(i), null);
            } else if (value instanceof Integer) {
                row.put(measures.get(i), ((Integer) value).toString());
            } else if (value instanceof Double) {
                row.put(measures.get(i), df.format(value));
            } else {
                row.put(measures.get(i), value.toString());
            }
        }
        data.add(row);
    } else if (result.getAxes().length == 2) {
        ArrayList<String> measures = new ArrayList<String>();
        for (Position p : result.getAxes()[0].getPositions()) {
            measures.add(p.get(0).getUniqueName().toString());
        }
        ArrayList<ArrayList<DimensionItem>> dimensionItems = new ArrayList<ArrayList<DimensionItem>>();
        for (Position p : result.getAxes()[1].getPositions()) {
            ArrayList<DimensionItem> itemsAtRow = new ArrayList<DimensionItem>();
            for (Object item : p.toArray()) {
                RolapMemberBase member = (RolapMemberBase) item;
                itemsAtRow.add(new DimensionItem(member.getLevel().getHierarchy().toString(),
                        member.getCaption().toString()));
            }
            dimensionItems.add(itemsAtRow);
        }
        for (int ix = 0; ix < dimensionItems.size(); ix++) {
            LinkedHashMap<String, String> row = new LinkedHashMap<String, String>();
            for (DimensionItem item : dimensionItems.get(ix)) {
                row.put(item.getLevel(), item.getCaption());
            }
            for (int i = 0; i < measures.size(); i++) {
                Object value = result.getCell(new int[] { i, ix }).getValue();
                if (value == null) {
                    row.put(measures.get(i), "0");
                } else {
                    if (value instanceof Integer) {
                        row.put(measures.get(i), ((Integer) value).toString());
                    } else if (value instanceof Double) {
                        row.put(measures.get(i), df.format(value));
                    } else {
                        row.put(measures.get(i), value.toString());
                    }
                }
            }
            data.add(row);
        }
    }
    return data;
}

From source file:net.pms.test.RendererConfigurationTest.java

@Before
public void setUp() {
    // Silence all log messages from the PMS code that is being tested
    LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
    context.reset();/*from   w  ww.  j  a  v  a  2s .  co m*/

    // Set locale to EN to ignore translations for renderers
    Locale.setDefault(Locale.ENGLISH);

    // Cases that are too generic should not match anything
    testCases.put("User-Agent: UPnP/1.0 DLNADOC/1.50", null);
    testCases.put("User-Agent: Unknown Renderer", null);
    testCases.put("X-Unknown-Header: Unknown Content", null);

    // AirPlayer:
    testCases.put("User-Agent: AirPlayer/1.0.09 CFNetwork/485.13.9 Darwin/11.0.0", "AirPlayer");
    testCases.put("User-Agent: Lavf52.54.0", "AirPlayer");

    // BraviaEX:
    testCases.put("X-AV-Client-Info: av=5.0; cn=\"Sony Corporation\"; mn=\"BRAVIA KDL-32CX520\"; mv=\"1.7\";",
            "Sony Bravia EX");

    // DLinkDSM510:
    testCases.put("User-Agent: DLNADOC/1.50 INTEL_NMPR/2.1", "D-Link DSM-510");

    // iPad-iPhone:
    testCases.put("User-Agent: 8player lite 2.2.3 (iPad; iPhone OS 5.0.1; nl_NL)", "iPad / iPhone");
    testCases.put("User-Agent: yxplayer2%20lite/1.2.7 CFNetwork/485.13.9 Darwin/11.0.0", "iPad / iPhone");
    testCases.put("User-Agent: MPlayer 1.0rc4-4.2.1", "iPad / iPhone");
    testCases.put("User-Agent: NSPlayer/4.1.0.3856", "iPad / iPhone");

    // Philips:
    testCases.put("User-Agent: Allegro-Software-WebClient/4.61 DLNADOC/1.00", "Philips Aurea");

    // PhilipsPFL:
    testCases.put("User-Agent: Windows2000/0.0 UPnP/1.0 PhilipsIntelSDK/1.4 DLNADOC/1.50", "Philips TV");

    // PS3:
    testCases.put("User-Agent: PLAYSTATION 3", "Playstation 3");
    testCases.put(
            "X-AV-Client-Info: av=5.0; cn=\"Sony Computer Entertainment Inc.\"; mn=\"PLAYSTATION 3\"; mv=\"1.0\"",
            "Playstation 3");

    // Realtek:
    // FIXME: Actual conflict here! Popcorn Hour is returned...
    //testCases.put("User-Agent: POSIX UPnP/1.0 Intel MicroStack/1.0.2718, RealtekMediaCenter, DLNADOC/1.50", "Realtek");
    testCases.put("User-Agent: RealtekVOD neon/0.27.2", "Realtek");

    // SamsungAllShare:
    testCases.put("User-Agent: SEC_HHP_[HT]D5500/1.0", "Samsung AllShare");
    testCases.put("User-Agent: SEC_HHP_[TV]UE32D5000/1.0", "Samsung AllShare");
    testCases.put("User-Agent: SEC_HHP_ Family TV/1.0", "Samsung AllShare");
    testCases.put("User-Agent: SEC_HHP_[TV]PS51D6900/1.0", "Samsung AllShare");
    testCases.put("User-Agent: DLNADOC/1.50 SEC_HHP_[TV]UE32D5000/1.0", "Samsung AllShare");
    testCases.put("User-Agent: DLNADOC/1.50 SEC_HHP_[TV]UN55D6050/1.0", "Samsung AllShare");
    testCases.put("User-Agent: DLNADOC/1.50 SEC_HHP_ Family TV/1.0", "Samsung AllShare");

    // WDTVLive:
    testCases.put("User-Agent: INTEL_NMPR/2.1 DLNADOC/1.50 Intel MicroStack/1.0.1423", "WD TV Live");

    // XBMC:
    testCases.put("User-Agent: XBMC/10.0 r35648 (Mac OS X; 11.2.0 x86_64; http://www.xbmc.org)", "XBMC");
    testCases.put("User-Agent: Platinum/0.5.3.0, DLNADOC/1.50", "XBMC");
}

From source file:com.qcadoo.mes.genealogies.GenealogyControllerTest.java

@Test
public void shouldPrepareViewForGenealogyAttributes() throws Exception {
    // // given/* ww  w  .j  ava  2  s.co m*/
    Map<String, String> arguments = ImmutableMap.of("context", "{\"form.id\":\"13\"}");
    ModelAndView expectedMav = mock(ModelAndView.class);
    CrudService crudController = mock(CrudService.class);
    given(crudController.prepareView(GenealogiesConstants.PLUGIN_IDENTIFIER,
            GenealogiesConstants.VIEW_CURRENT_ATTRIBUTE, arguments, Locale.ENGLISH)).willReturn(expectedMav);

    GenealogyAttributeService genealogyAttributeService = mock(GenealogyAttributeService.class);
    given(genealogyAttributeService.getGenealogyAttributeId()).willReturn(13L);

    GenealogyController genealogyController = new GenealogyController();
    setField(genealogyController, "crudController", crudController);
    setField(genealogyController, "genealogyService", genealogyAttributeService);

    // // when
    ModelAndView mav = genealogyController.getGenealogyAttributesPageView(Locale.ENGLISH);

    // // then
    assertEquals(expectedMav, mav);
}

From source file:ru.mystamps.web.controller.SitemapController.java

@GetMapping(Url.SITEMAP_XML)
public void getSitemapXml(HttpServletResponse response) {
    response.setContentType("application/xml");
    response.setCharacterEncoding("UTF-8");

    DateFormat dateFormatter = new SimpleDateFormat(DATE_FORMAT, Locale.ENGLISH);

    try {//from  w ww.  j  a  v  a  2s . c o m
        PrintWriter writer = response.getWriter();

        writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        writer.println("<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">");

        writer.print("\t<url>\t\t<loc>");
        writer.print(Url.PUBLIC_URL);
        writer.print(Url.INDEX_PAGE);
        writer.println("</loc>\t</url>");

        for (SitemapInfoDto item : seriesService.findAllForSitemap()) {
            writer.println("\t<url>");

            writer.print("\t\t<loc>");
            writer.print(createLocEntry(item));
            writer.println("</loc>");

            writer.print("\t\t<lastmod>");
            writer.print(createLastModEntry(dateFormatter, item));
            writer.println("</lastmod>");

            writer.println("\t</url>");
        }

        writer.println("</urlset>");
    } catch (IOException ex) {
        LOG.error("Can't return sitemap.xml: {}", ex.getMessage());
    }
}