Example usage for java.util Locale US

List of usage examples for java.util Locale US

Introduction

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

Prototype

Locale US

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

Click Source Link

Document

Useful constant for country.

Usage

From source file:com.siberhus.tdfl.DflBaseTest.java

@BeforeClass
public static void init() {

    Locale locale = Locale.US;

    TemporalTypeConverter utilDateConverter = new TemporalTypeConverter(Date.class);
    utilDateConverter.setLocale(locale);
    utilDateConverter.setPattern("dd/MM/yyyy");
    ConvertUtils.register(utilDateConverter, Date.class);

    TemporalTypeConverter sqlDateConverter = new TemporalTypeConverter(java.sql.Date.class);
    sqlDateConverter.setLocale(locale);//from w ww .j  a  v a 2s.co  m
    sqlDateConverter.setPattern("dd/MM/yyyy");
    ConvertUtils.register(sqlDateConverter, java.sql.Date.class);

    TemporalTypeConverter sqlTimeConverter = new TemporalTypeConverter(java.sql.Time.class);
    sqlTimeConverter.setLocale(locale);
    sqlTimeConverter.setPattern("HH:mm:ss");
    ConvertUtils.register(sqlTimeConverter, java.sql.Time.class);

    TemporalTypeConverter sqlTimestampConverter = new TemporalTypeConverter(java.sql.Timestamp.class);
    sqlTimestampConverter.setLocale(locale);
    sqlTimestampConverter.setPattern("dd/MM/yyyy HH:mm:ss");
    ConvertUtils.register(sqlTimestampConverter, java.sql.Timestamp.class);
}

From source file:com.infullmobile.jenkins.plugin.restrictedregister.util.Utils.java

public static String getDescriptorDisplayName(Object object) {
    return String.format(Locale.US, DESCRIPTOR_NAME_FORMAT, object.getClass().getSimpleName());
}

From source file:com.vtc.global.sdk.Application.java

@Bean
public LocaleResolver localeResolver() {
    SessionLocaleResolver slr = new SessionLocaleResolver();

    slr.setDefaultLocale(Locale.US);

    return slr;
}

From source file:com.inovaworks.ObservedProperty.java

public static ObservedProperty position(double latDegs, double lonDegs, double height) {
    return new ObservedProperty("position",
            String.format(Locale.US, "%.8f,%.8f,%.3f", latDegs, lonDegs, height), "position");
}

From source file:com.aestheticsw.jobkeywords.service.termextractor.impl.fivefilters.FiveFiltersClientTest.java

@Test
public void termExtractorDeserialization() throws FileNotFoundException {
    String content = FileUtils.getClassResourceAsString("../simple-content.html", this);
    TermFrequencyList terms = fiveFiltersClient.getTermFrequencyList(content, Locale.US);

    assertNotNull(terms);/*from   w w w .  jav  a  2s.  c  o m*/
}

From source file:org.openhie.openempi.util.DateConverterTest.java

public void testInternationalization() throws Exception {
    List<Locale> locales = new ArrayList<Locale>() {
        private static final long serialVersionUID = 1L;
        {//  w  ww .j av  a  2  s.c  om
            add(Locale.US);
            add(Locale.GERMANY);
            add(Locale.FRANCE);
            add(Locale.CHINA);
            add(Locale.ITALY);
        }
    };

    for (Locale locale : locales) {
        LocaleContextHolder.setLocale(locale);
        testConvertStringToDate();
        testConvertDateToString();
        testConvertStringToTimestamp();
        testConvertTimestampToString();
    }
}

From source file:net.eledge.android.europeana.tools.UriHelper.java

public static String getPortalRecordUrl(String id) {
    return String.format(Locale.US, URL_PORTAL_RECORD, id);
}

From source file:com.aestheticsw.jobkeywords.service.termextractor.impl.indeed.IndeedClientTest.java

@Test
public void getIndeedJobSummaryList() {
    QueryKey key = new QueryKey("java spring", Locale.US, null);
    SearchParameters params = new SearchParameters(key, 5, 0, 0, null);
    List<JobSummary> jobSummaryList = indeedClient.getIndeedJobSummaryList(params);
    assertNotNull(jobSummaryList);/* ww w .  j  a v a 2  s  .  c o  m*/
    assertEquals(5, jobSummaryList.size());
}

From source file:io.syndesis.model.integration.StepDeserializerTest.java

@Test
public void shouldDeserializeRuleFilterStep() throws Exception {
    RuleFilterStep step = readTestFilter("/rule-filter-step.json");
    assertEquals("1", step.getId().get());
    assertFalse(step.getConfiguredProperties().isEmpty());
    Map<String, String> props = step.getConfiguredProperties();
    assertEquals(FilterPredicate.AND, FilterPredicate.valueOf(props.get("predicate").toUpperCase(Locale.US)));
    assertNotNull(props.get("rules"));
    assertEquals("rule-filter", step.getStepKind());
    assertEquals("${body.text} == 'antman' && ${body.kind} =~ 'DC Comics'", step.getFilterExpression());
}

From source file:com.googlesource.gerrit.plugins.xdocs.formatter.HtmlBuilder.java

@Inject
HtmlBuilder(@GerritPersonIdent PersonIdent gerritIdent) {
    rfc2822DateFormatter = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.US);
    rfc2822DateFormatter.setCalendar(Calendar.getInstance(gerritIdent.getTimeZone(), Locale.US));
}