Example usage for java.util Locale FRANCE

List of usage examples for java.util Locale FRANCE

Introduction

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

Prototype

Locale FRANCE

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

Click Source Link

Document

Useful constant for country.

Usage

From source file:org.vaadin.spring.i18n.I18NTest.java

@Test
public void getLocale_currentUI_uiLocaleIsReturned() {
    final Locale locale = Locale.FRANCE;
    when(ui.getLocale()).thenReturn(locale);
    UI.setCurrent(ui);//from  w w w.  ja va  2s  . c  o  m
    assertEquals(locale, i18n.getLocale());
}

From source file:org.pac4j.oauth.client.TestFacebookClient.java

@Override
protected void verifyProfile(final UserProfile userProfile) {
    final FacebookProfile profile = (FacebookProfile) userProfile;
    logger.debug("userProfile : {}", profile);
    assertEquals("100003571536393", profile.getId());
    assertEquals(FacebookProfile.class.getSimpleName() + UserProfile.SEPARATOR + "100003571536393",
            profile.getTypedId());/*from   w w w . j  a v  a 2  s . c  o m*/
    assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), FacebookProfile.class));
    assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
    assertCommonProfile(userProfile, "testscribeup@gmail.com", "Jerome", "Testscribeup", "Jerome Testscribeup",
            "jerome.testscribeup", Gender.MALE, Locale.FRANCE,
            "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-", "http://www.facebook.com/jerome.testscribeup",
            "New York, New York");
    assertNull(profile.getMiddleName());
    final List<FacebookObject> languages = profile.getLanguages();
    assertTrue(languages.get(0).getName().startsWith("Fr"));
    assertTrue(StringUtils.isNotBlank(profile.getThirdPartyId()));
    assertEquals(1, profile.getTimezone().intValue());
    assertEquals(TestsHelper.getFormattedDate(1343375150000L, "yyyy-MM-dd'T'HH:mm:ssz", null),
            profile.getUpdateTime().toString());
    assertNull(profile.getVerified());
    assertEquals("A propos de moi", profile.getBio());
    assertEquals("03/10/1979", profile.getBirthday().toString());
    final List<FacebookEducation> educations = profile.getEducation();
    FacebookEducation education = educations.get(0);
    assertEquals("lyce mixte", education.getSchool().getName());
    assertEquals("2000", education.getYear().getName());
    assertEquals("High School", education.getType());
    education = educations.get(1);
    assertEquals("Ingnieur", education.getDegree().getName());
    assertEquals("testscribeup@gmail.com", profile.getEmail());
    assertEquals("San Francisco, California", (profile.getHometown()).getName());
    assertEquals("female", (profile.getInterestedIn()).get(0));
    assertEquals("New York, New York", (profile.getLocationObject()).getName());
    assertEquals("Sans Opinion (desc)", profile.getPolitical());
    final List<FacebookObject> favoriteAthletes = profile.getFavoriteAthletes();
    assertEquals("Surfing", favoriteAthletes.get(0).getName());
    final List<FacebookObject> favoriteTeams = profile.getFavoriteTeams();
    assertEquals("Handball Fminin de France", favoriteTeams.get(0).getName());
    assertEquals("citation", profile.getQuotes());
    assertEquals(FacebookRelationshipStatus.MARRIED, profile.getRelationshipStatus());
    assertEquals("Athisme (desc)", profile.getReligion());
    assertNull(profile.getSignificantOther());
    assertEquals("web site", profile.getWebsite());
    final List<FacebookWork> works = profile.getWork();
    final FacebookWork work = works.get(0);
    assertEquals("Employeur", work.getEmployer().getName());
    assertEquals("Paris, France", work.getLocation().getName());
    assertEquals("Architecte Web", work.getPosition().getName());
    assertEquals("Description", work.getDescription());
    assertTrue(work.getStartDate() instanceof Date);
    assertNull(work.getEndDate());
    final List<FacebookObject> friends = profile.getFriends();
    assertEquals(1, friends.size());
    final FacebookObject friend = friends.get(0);
    assertEquals("Jrme Leleu", friend.getName());
    assertEquals("100002406067613", friend.getId());
    final List<FacebookInfo> movies = profile.getMovies();
    assertEquals(1, movies.size());
    final FacebookInfo movie = movies.get(0);
    assertEquals("Jean-Claude Van Damme", movie.getName());
    assertEquals("21497365045", movie.getId());
    assertEquals("Actor/director", movie.getCategory());
    assertEquals(1330030350000L, movie.getCreatedTime().getTime());
    final List<FacebookInfo> musics = profile.getMusic();
    assertEquals(1, musics.size());
    final FacebookInfo music = musics.get(0);
    assertEquals("Hard rock", music.getName());
    assertEquals("112175695466436", music.getId());
    assertEquals("Musical genre", music.getCategory());
    assertEquals(1330030350000L, music.getCreatedTime().getTime());
    final List<FacebookInfo> books = profile.getBooks();
    assertEquals(1, books.size());
    final FacebookInfo book = books.get(0);
    assertEquals("Science fiction", book.getName());
    assertEquals("108157509212483", book.getId());
    assertEquals("Book genre", book.getCategory());
    assertEquals(1330030350000L, book.getCreatedTime().getTime());
    final List<FacebookInfo> likes = profile.getLikes();
    assertEquals(9, likes.size());
    final FacebookInfo like = likes.get(0);
    assertEquals("Boxing", like.getName());
    assertEquals("105648929470083", like.getId());
    assertEquals("Sport", like.getCategory());
    assertEquals(1360152791000L, like.getCreatedTime().getTime());
    final List<FacebookPhoto> albums = profile.getAlbums();
    assertEquals(3, albums.size());
    final FacebookPhoto album = albums.get(1);
    assertEquals("168023009993416", album.getId());
    final FacebookObject from = album.getFrom();
    assertEquals("100003571536393", from.getId());
    assertEquals("Jerome Testscribeup", from.getName());
    assertEquals("Profile Pictures", album.getName());
    assertEquals("http://www.facebook.com/album.php?fbid=168023009993416&id=100003571536393&aid=34144",
            album.getLink());
    assertEquals("168023156660068", album.getCoverPhoto());
    assertEquals("everyone", album.getPrivacy());
    assertEquals(1, album.getCount().intValue());
    assertEquals("profile", album.getType());
    assertEquals(1336472634000L, album.getCreatedTime().getTime());
    assertEquals(1336472660000L, album.getUpdatedTime().getTime());
    assertFalse(album.getCanUpload());
    final List<FacebookEvent> events = profile.getEvents();
    assertEquals(1, events.size());
    final FacebookEvent event = events.get(0);
    assertEquals("Couronnement", event.getName());
    assertEquals("301212149963131", event.getId());
    assertTrue(event.getLocation().indexOf("Paris") >= 0);
    assertEquals("attending", event.getRsvpStatus());
    assertNotNull(event.getStartTime());
    assertNotNull(event.getEndTime());
    final List<FacebookGroup> groups = profile.getGroups();
    final FacebookGroup group = groups.get(0);
    assertEquals(1, group.getVersion().intValue());
    assertEquals("Dev ScribeUP", group.getName());
    assertEquals("167694120024728", group.getId());
    assertTrue(group.getAdministrator());
    assertEquals(1, group.getBookmarkOrder().intValue());
    final List<FacebookMusicListen> musicListens = profile.getMusicListens();
    assertEquals(4, musicListens.size());
    final FacebookPicture picture = profile.getPicture();
    assertFalse(picture.getIsSilhouette());
    assertEquals(37, profile.getAttributes().size());
}

From source file:org.pac4j.oauth.client.FacebookClientIT.java

@Override
protected void verifyProfile(final UserProfile userProfile) {
    final FacebookProfile profile = (FacebookProfile) userProfile;
    logger.debug("userProfile : {}", profile);
    assertEquals("100003571536393", profile.getId());
    assertEquals(FacebookProfile.class.getSimpleName() + UserProfile.SEPARATOR + "100003571536393",
            profile.getTypedId());//from   ww  w  .ja v a2s.c  o  m
    assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), FacebookProfile.class));
    assertTrue(StringUtils.isNotBlank(profile.getAccessToken()));
    assertCommonProfile(userProfile, null, "Jerome", "Testscribeup", "Jerome Testscribeup", null, Gender.MALE,
            Locale.FRANCE, "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-",
            "http://www.facebook.com/100003571536393", "New York, New York");
    assertNull(profile.getMiddleName());
    final List<FacebookObject> languages = profile.getLanguages();
    assertTrue(languages.get(0).getName().startsWith("Fr"));
    assertTrue(StringUtils.isNotBlank(profile.getThirdPartyId()));
    assertEquals(1, profile.getTimezone().intValue());
    assertTrue(profile.getVerified());
    assertEquals("A propos de moi", profile.getBio());
    assertEquals("03/10/1979", profile.getBirthday().toString());
    final List<FacebookEducation> educations = profile.getEducation();
    FacebookEducation education = educations.get(0);
    assertEquals("lyce mixte", education.getSchool().getName());
    assertEquals("2000", education.getYear().getName());
    assertEquals("High School", education.getType());
    education = educations.get(1);
    assertEquals("Ingnieur", education.getDegree().getName());
    assertNull(profile.getEmail());
    assertEquals("San Francisco, California", (profile.getHometown()).getName());
    assertEquals("female", (profile.getInterestedIn()).get(0));
    assertEquals("New York, New York", (profile.getLocationObject()).getName());
    assertEquals("Sans Opinion (desc)", profile.getPolitical());
    final List<FacebookObject> favoriteAthletes = profile.getFavoriteAthletes();
    assertEquals("Surfing", favoriteAthletes.get(0).getName());
    final List<FacebookObject> favoriteTeams = profile.getFavoriteTeams();
    assertEquals("Handball Fminin de France", favoriteTeams.get(0).getName());
    assertEquals("citation", profile.getQuotes());
    assertEquals(FacebookRelationshipStatus.MARRIED, profile.getRelationshipStatus());
    assertEquals("Athisme (desc)", profile.getReligion());
    assertNull(profile.getSignificantOther());
    assertEquals("web site", profile.getWebsite());
    final List<FacebookWork> works = profile.getWork();
    final FacebookWork work = works.get(0);
    assertEquals("Employeur", work.getEmployer().getName());
    assertEquals("Paris, France", work.getLocation().getName());
    assertEquals("Architecte Web", work.getPosition().getName());
    assertEquals("Description", work.getDescription());
    assertTrue(work.getStartDate() instanceof Date);
    assertNull(work.getEndDate());
    final List<FacebookObject> friends = profile.getFriends();
    assertEquals(1, friends.size());
    final FacebookObject friend = friends.get(0);
    assertEquals("Jrme Leleu", friend.getName());
    assertEquals("100002406067613", friend.getId());
    final List<FacebookInfo> movies = profile.getMovies();
    assertEquals(1, movies.size());
    final FacebookInfo movie = movies.get(0);
    assertEquals("Jean-Claude Van Damme", movie.getName());
    assertEquals("21497365045", movie.getId());
    assertEquals("Actor/director", movie.getCategory());
    assertEquals(1330030350000L, movie.getCreatedTime().getTime());
    final List<FacebookInfo> musics = profile.getMusic();
    assertEquals(1, musics.size());
    final FacebookInfo music = musics.get(0);
    assertEquals("Hard rock", music.getName());
    assertEquals("112175695466436", music.getId());
    assertEquals("Musical genre", music.getCategory());
    assertEquals(1330030350000L, music.getCreatedTime().getTime());
    final List<FacebookInfo> books = profile.getBooks();
    assertEquals(1, books.size());
    final FacebookInfo book = books.get(0);
    assertEquals("Science fiction", book.getName());
    assertEquals("108157509212483", book.getId());
    assertEquals("Interest", book.getCategory());
    assertEquals(1330030350000L, book.getCreatedTime().getTime());
    final List<FacebookInfo> likes = profile.getLikes();
    assertEquals(8, likes.size());
    final FacebookInfo like = likes.get(0);
    assertEquals("Boxing", like.getName());
    assertEquals("105648929470083", like.getId());
    assertEquals("Sport", like.getCategory());
    assertEquals(1360152791000L, like.getCreatedTime().getTime());
    final List<FacebookPhoto> albums = profile.getAlbums();
    assertEquals(3, albums.size());
    final FacebookPhoto album = albums.get(1);
    assertEquals("168023009993416", album.getId());
    final FacebookObject from = album.getFrom();
    assertEquals("100003571536393", from.getId());
    assertEquals("Jerome Testscribeup", from.getName());
    assertEquals("Profile Pictures", album.getName());
    assertEquals("https://www.facebook.com/album.php?fbid=168023009993416&id=100003571536393&aid=34144",
            album.getLink());
    assertEquals("168023156660068", album.getCoverPhoto());
    assertEquals("everyone", album.getPrivacy());
    assertEquals(1, album.getCount().intValue());
    assertEquals("profile", album.getType());
    assertEquals(1336472634000L, album.getCreatedTime().getTime());
    assertEquals(1336472660000L, album.getUpdatedTime().getTime());
    assertFalse(album.getCanUpload());
    final List<FacebookEvent> events = profile.getEvents();
    assertEquals(1, events.size());
    final FacebookEvent event = events.get(0);
    assertEquals("Couronnement", event.getName());
    assertEquals("301212149963131", event.getId());
    assertTrue(event.getLocation().indexOf("Paris") >= 0);
    assertEquals("attending", event.getRsvpStatus());
    assertNotNull(event.getStartTime());
    assertNotNull(event.getEndTime());
    final List<FacebookGroup> groups = profile.getGroups();
    final FacebookGroup group = groups.get(0);
    assertNull(group.getVersion());
    assertEquals("Dev ScribeUP", group.getName());
    assertEquals("167694120024728", group.getId());
    assertTrue(group.getAdministrator());
    assertEquals(1, group.getBookmarkOrder().intValue());
    final List<FacebookMusicListen> musicListens = profile.getMusicListens();
    assertNull(musicListens);
    final FacebookPicture picture = profile.getPicture();
    assertFalse(picture.getIsSilhouette());
    assertEquals(35, profile.getAttributes().size());
}

From source file:org.ocelotds.marshalling.ArgumentServicesTest.java

/**
 * Test of getJsonResultFromSpecificMarshaller method, of class ArgumentServices.
 *
 * @throws java.lang.Exception/*from w w w  . ja  v  a  2s . com*/
 */
@Test
public void testGetJsonResultFromSpecificMarshaller() throws Exception {
    System.out.println("getJsonResultFromSpecificMarshaller");
    IJsonMarshaller ijm = mock(IJsonMarshaller.class);
    JsonMarshaller jm = mock(JsonMarshaller.class);

    when(jm.value()).thenReturn((Class) LocaleMarshaller.class);
    when(jm.type()).thenReturn(JsonMarshallerType.SINGLE).thenReturn(JsonMarshallerType.LIST)
            .thenReturn(JsonMarshallerType.MAP);
    when(ijm.toJson(any(Object.class))).thenReturn("LG1");
    doReturn("[LG1,LG2]").when(instance).getJsonResultFromSpecificMarshallerIterable(any(Iterable.class),
            any(IJsonMarshaller.class));
    doReturn("{\"FR\":LG1,\"US\":LG2}").when(instance).getJsonResultFromSpecificMarshallerMap(any(Map.class),
            any(IJsonMarshaller.class));

    doReturn(ijm).when(instance).getIJsonMarshallerInstance(any(Class.class));
    String result = instance.getJsonResultFromSpecificMarshaller(jm, Locale.FRANCE);
    assertThat(result).isEqualTo("LG1");
    result = instance.getJsonResultFromSpecificMarshaller(jm, Arrays.asList(Locale.FRANCE, Locale.US));
    assertThat(result).isEqualTo("[LG1,LG2]");
    result = instance.getJsonResultFromSpecificMarshaller(jm, getMapOfLocale());
    assertThat(result).isEqualTo("{\"FR\":LG1,\"US\":LG2}");
}

From source file:org.alfresco.repo.template.XSLTProcessorTest.java

public void testLocalisedNodeTemplate() throws Exception {
    // This should have the same result as testSimplestNodeTemplate as the localization should be ignored for node templates. 
    try {//from ww w  . j  a va 2  s . co m
        FileInfo xmlFile = createXmlFile(companyHome);
        FileInfo xslFile = createXmlFile(companyHome, verySimpleXSLT);
        XSLTemplateModel model = new XSLTemplateModel();
        model.put(XSLTProcessor.ROOT_NAMESPACE, XMLUtil.parse(xmlFile.getNodeRef(), contentService));

        StringWriter writer = new StringWriter();
        xsltProcessor.process(xslFile.getNodeRef().toString(), model, writer, Locale.FRANCE);

        String output = writer.toString();

        log.debug("XSLT Processor output: " + output);
        assertEquals(
                "Avocado DipBagels, New York StyleBeef Frankfurter, Quarter PoundChicken Pot PieCole SlawEggsHazelnut SpreadPotato ChipsSoy Patties, GrilledTruffles, Dark Chocolate",
                output);
    } catch (Exception ex) {
        log.error("Error!", ex);
        fail();
    }
}

From source file:com.google.enterprise.connector.filesystem.FileConnectorTypeTest.java

public void testEscapedHtml() {
    String bundleValue = "Nom d'utilisateur";
    testEscaping(Locale.FRANCE, FR_BUNDLE, "user", bundleValue, bundleValue, bundleValue.replace("'", "&#39;"));
}

From source file:org.jfree.data.time.WeekTest.java

/**
 * The first week in 2005 should span the range:
 *
 * TimeZone         | Start Millis  | End Millis    | Start Date  | End Date
 * -----------------+---------------+---------------+-------------+------------
 * Europe/London    | 1104710400000 | 1105315199999 |  3-Jan-2005 | 9-Jan-2005
 * Europe/Paris     | 1104706800000 | 1105311599999 |  3-Jan-2005 | 2-Jan-2005
 * America/New_York | 1104037200000 | 1104641999999 | 26-Dec-2004 | 1-Jan-2005
 *
 * In London and Paris, Monday is the first day of the week, while in the
 * US it is Sunday./*from  www . j  a  v a 2 s  .c  o  m*/
 *
 * Previously, we were using these values, but see Java Bug ID 4960215:
 *
 * TimeZone         | Start Millis  | End Millis    | Start Date  | End Date
 * -----------------+---------------+---------------+-------------+------------
 * Europe/London    | 1104105600000 | 1104710399999 | 27-Dec-2004 | 2-Jan-2005
 * Europe/Paris     | 1104102000000 | 1104706799999 | 27-Dec-2004 | 2-Jan-2005
 * America/New_York | 1104037200000 | 1104641999999 | 26-Dec-2004 | 1-Jan-2005
 */
@Test
public void testWeek12005() {
    Week w1 = new Week(1, 2005);
    Calendar c1 = Calendar.getInstance(TimeZone.getTimeZone("Europe/London"), Locale.UK);
    c1.setMinimalDaysInFirstWeek(4); // see Java Bug ID 4960215
    assertEquals(1104710400000L, w1.getFirstMillisecond(c1));
    assertEquals(1105315199999L, w1.getLastMillisecond(c1));
    Calendar c2 = Calendar.getInstance(TimeZone.getTimeZone("Europe/Paris"), Locale.FRANCE);
    c2.setMinimalDaysInFirstWeek(4); // see Java Bug ID 4960215
    assertEquals(1104706800000L, w1.getFirstMillisecond(c2));
    assertEquals(1105311599999L, w1.getLastMillisecond(c2));
    Calendar c3 = Calendar.getInstance(TimeZone.getTimeZone("America/New_York"), Locale.US);
    assertEquals(1104037200000L, w1.getFirstMillisecond(c3));
    assertEquals(1104641999999L, w1.getLastMillisecond(c3));
}

From source file:com.google.enterprise.connector.filesystem.FileConnectorTypeTest.java

public void testEscapedJavaScript() {
    String bundleValue = "Impossible d'ajouter une ligne.";
    testEscaping(Locale.FRANCE, FR_BUNDLE, FileSystemConnectorErrorMessages.CANNOT_ADD_ANOTHER_ROW.name(),
            bundleValue, bundleValue, bundleValue.replace("'", "\\x27"));
}

From source file:org.talend.dataquality.statistics.datetime.CustomDateTimePatternManagerTest.java

@Test
public void testDateWithLocaleFR() {
    // simulate a JVM
    Locale.setDefault(Locale.FRANCE);

    final List<String> pattern = Collections.<String>singletonList("MMMM d ?? yyyy");
    final String[] dates = new String[] { "January 9 ?? 1970", // EN
            "janvier 9 ?? 1970", // FR
            "Januar 9 ?? 1970", // DE
            " 9 ?? 1970", // CN
    };/*from   w  w w .j  av  a 2 s .com*/
    final boolean[] EXPECTED_IS_DATE_DEFAULT = new boolean[] { true, false, false, false };
    final boolean[] EXPECTED_IS_DATE_US = new boolean[] { true, false, false, false };
    final boolean[] EXPECTED_IS_DATE_FR = new boolean[] { true, true, false, false };
    final boolean[] EXPECTED_IS_DATE_DE = new boolean[] { true, false, true, false };
    final boolean[] EXPECTED_IS_DATE_CN = new boolean[] { true, false, false, true };
    // final String[] EXPECTED_PATTERN_STRING = new String[] { "", };

    StringBuilder sb = new StringBuilder("\n");
    sb.append("-------------- JVM Locale: " + Locale.getDefault().toString() + " ------\n");
    sb.append("Input \\ UserLocale\tN/A\tEN\tFR\tDE\tCN\n");
    for (int i = 0; i < dates.length; i++) {
        sb.append(dates[i]).append("   \t");
        sb.append(CustomDateTimePatternManager.isDate(dates[i], pattern)).append("\t");
        sb.append(CustomDateTimePatternManager.isDate(dates[i], pattern, Locale.US)).append("\t");
        sb.append(CustomDateTimePatternManager.isDate(dates[i], pattern, Locale.FRANCE)).append("\t");
        sb.append(CustomDateTimePatternManager.isDate(dates[i], pattern, Locale.GERMANY)).append("\t");
        sb.append(CustomDateTimePatternManager.isDate(dates[i], pattern, Locale.CHINA)).append("\t");
        sb.append("\n");

        assertEquals(EXPECTED_IS_DATE_DEFAULT[i], CustomDateTimePatternManager.isDate(dates[i], pattern));
        assertEquals(EXPECTED_IS_DATE_US[i], CustomDateTimePatternManager.isDate(dates[i], pattern, Locale.US));
        assertEquals(EXPECTED_IS_DATE_FR[i],
                CustomDateTimePatternManager.isDate(dates[i], pattern, Locale.FRANCE));
        assertEquals(EXPECTED_IS_DATE_DE[i],
                CustomDateTimePatternManager.isDate(dates[i], pattern, Locale.GERMANY));
        assertEquals(EXPECTED_IS_DATE_CN[i],
                CustomDateTimePatternManager.isDate(dates[i], pattern, Locale.CHINA));
    }

    LOGGER.info(sb.toString());
}

From source file:fr.bde_eseo.eseomega.events.EventItem.java

public Intent toCalendarIntent() {
    Intent calIntent = new Intent(Intent.ACTION_INSERT);
    calIntent.setType("vnd.android.cursor.item/event");
    calIntent.putExtra(CalendarContract.Events.TITLE, name);
    calIntent.putExtra(CalendarContract.Events.EVENT_LOCATION, (lieu != null ? lieu : ""));
    calIntent.putExtra(CalendarContract.Events.DESCRIPTION, (details != null ? details : ""));

    SimpleDateFormat sdf = new SimpleDateFormat("HH'h'mm", Locale.FRANCE);
    String sDate = sdf.format(this.date);
    boolean allDay = sDate.equals(HOUR_PASS_ALLDAY);
    calIntent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, allDay);
    calIntent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, cal.getTimeInMillis());
    if (!allDay)//from   w w  w  .  jav a 2 s.c  o m
        calIntent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME, calFin.getTimeInMillis());

    return calIntent;
}