List of usage examples for java.util Locale FRANCE
Locale FRANCE
To view the source code for java.util Locale FRANCE.
Click Source Link
From source file:org.pac4j.oauth.client.TestWindowsLiveClient.java
@Override protected void verifyProfile(final UserProfile userProfile) { final WindowsLiveProfile profile = (WindowsLiveProfile) userProfile; logger.debug("userProfile : {}", profile); assertEquals("416c383b220392d8", profile.getId()); assertEquals(WindowsLiveProfile.class.getSimpleName() + UserProfile.SEPARATOR + "416c383b220392d8", profile.getTypedId());//w w w. j a v a 2 s . c o m assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), WindowsLiveProfile.class)); assertTrue(StringUtils.isNotBlank(profile.getAccessToken())); assertCommonProfile(userProfile, null, "Test", "ScribeUP", "Test ScribeUP", null, Gender.UNSPECIFIED, Locale.FRANCE, null, "https://profile.live.com/", null); assertEquals(TestsHelper.getFormattedDate(1335878042000L, "yyyy-MM-dd'T'HH:mm:ssz", null), profile.getUpdatedTime().toString()); assertEquals(7, profile.getAttributes().size()); }
From source file:org.pac4j.oauth.client.WindowsLiveClientIT.java
@Override protected void verifyProfile(final UserProfile userProfile) { final WindowsLiveProfile profile = (WindowsLiveProfile) userProfile; logger.debug("userProfile : {}", profile); assertEquals("416c383b220392d8", profile.getId()); assertEquals(WindowsLiveProfile.class.getSimpleName() + UserProfile.SEPARATOR + "416c383b220392d8", profile.getTypedId());/*from ww w. j a v a 2 s . c o m*/ assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), WindowsLiveProfile.class)); assertTrue(StringUtils.isNotBlank(profile.getAccessToken())); assertCommonProfile(userProfile, null, "Test", "ScribeUP", "Test ScribeUP", null, Gender.UNSPECIFIED, Locale.FRANCE, null, "https://profile.live.com/", null); assertNotNull(profile.getUpdatedTime()); assertEquals(7, profile.getAttributes().size()); }
From source file:org.silverpeas.core.test.extention.LocalizationBundleStub.java
@SuppressWarnings("unchecked") private void init() throws IllegalAccessException { currentLocale = Locale.getDefault(); Locale.setDefault(Locale.FRANCE); final String newDefaultLocale = Locale.getDefault().getLanguage(); reflectionRule.setField(DisplayI18NHelper.class, newDefaultLocale, "defaultLanguage"); bundleCache = (Map) FieldUtils.readStaticField(ResourceLocator.class, "bundles", true); bundleCache.put(bundleName, new LocalizationBundleTest(newDefaultLocale, bundleMap)); bundleNames.add(bundleName);// w w w . j a v a2 s . c o m DisplayI18NHelper.getLanguages().forEach(l -> { final String bundleLocaleName = bundleName + "_" + l; bundleCache.put(bundleLocaleName, new LocalizationBundleTest(l, bundleMap)); bundleNames.add(bundleLocaleName); }); }
From source file:fr.bde_eseo.eseomega.events.tickets.model.EventTicketItem.java
public String getFrenchDate(boolean simpleDate) { Date d = getParsedDate();//from www .j a v a 2 s. co m SimpleDateFormat sdf; if (simpleDate) sdf = new SimpleDateFormat("EEEE dd MMMM yyyy", Locale.FRANCE); else sdf = new SimpleDateFormat("E dd MMMM yyyy, '' HH:mm", Locale.FRANCE); return sdf.format(d); }
From source file:org.glenans.extractor.model.Stage.java
public static Date convertStringToDate(String stringDate) { /*/*from w ww .j a v a 2s. com*/ Date can have two formats: - "04/10/15" for october, 4th 2015 - "04/10/15 14h00" for october, 4th 2015, 2pm */ DateFormat df = new SimpleDateFormat("dd/MM/yy", Locale.FRANCE); DateFormat dfWithTime = new SimpleDateFormat("d/MM/yy '' HH'h'mm", Locale.FRANCE); try { LOGGER.info("Date : " + stringDate); return DateUtils.parseDate(stringDate, ALL_DATE_PARSERS); } catch (ParseException ex) { LOGGER.info("ParseException : " + ex); } return null; }
From source file:org.pac4j.oauth.client.TestYahooClient.java
@Override protected void verifyProfile(final UserProfile userProfile) { final YahooProfile profile = (YahooProfile) userProfile; logger.debug("userProfile : {}", profile); assertEquals("PCSXZCYSWC6XUJNMZKRGWVPHNU", profile.getId()); assertEquals(YahooProfile.class.getSimpleName() + UserProfile.SEPARATOR + "PCSXZCYSWC6XUJNMZKRGWVPHNU", profile.getTypedId());//from www . j av a 2s . c o m assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), YahooProfile.class)); assertTrue(StringUtils.isNotBlank(profile.getAccessToken())); assertCommonProfile(userProfile, "testscribeup@yahoo.fr", "Test", "ScribeUP", "Test ScribeUP", "Test", Gender.MALE, Locale.FRANCE, "http://avatars.zenfs.com/users/1DJGkdA6uAAECQWEo8AceAQ==.large.png", "http://profile.yahoo.com/PCSXZCYSWC6XUJNMZKRGWVPHNU", "Chatou, Ile-de-France"); assertEquals("my profile", profile.getAboutMe()); final List<YahooAddress> addresses = profile.getAddresses(); assertEquals(2, addresses.size()); final YahooAddress address = addresses.get(0); assertEquals(3, address.getId().intValue()); assertTrue(address.getCurrent()); assertEquals(Locale.FRENCH, address.getCountry()); assertEquals("", address.getState()); assertEquals("", address.getCity()); assertEquals("78400", address.getPostalCode()); assertEquals("", address.getStreet()); assertEquals("HOME", address.getType()); assertEquals(1976, profile.getBirthYear().intValue()); assertEquals("03/10", profile.getBirthdate().toString()); assertEquals("2012-02-06T12:46:43Z", profile.getCreated().toString()); assertEquals(37, profile.getDisplayAge().intValue()); final List<YahooDisclosure> disclosures = profile.getDisclosures(); assertEquals(2, disclosures.size()); final YahooDisclosure disclosure = disclosures.get(0); assertEquals("1", disclosure.getAcceptance()); assertEquals("bd", disclosure.getName()); assertTrue(disclosure.getSeen() instanceof Date); assertEquals("1", disclosure.getVersion()); final List<YahooEmail> emails = profile.getEmails(); assertEquals(2, emails.size()); final YahooEmail email = emails.get(1); assertEquals(2, email.getId().intValue()); assertTrue(email.getPrimary()); assertEquals("testscribeup@yahoo.fr", email.getHandle()); assertEquals("HOME", email.getType()); assertEquals(Gender.MALE, profile.getGender()); final YahooImage image = profile.getImage(); assertEquals("http://avatars.zenfs.com/users/1DJGkdA6uAAECQWEo8AceAQ==.large.png", image.getImageUrl()); assertEquals(150, image.getWidth().intValue()); assertEquals(225, image.getHeight().intValue()); assertEquals("150x225", image.getSize()); final List<YahooInterest> interests = profile.getInterests(); assertEquals(11, interests.size()); final YahooInterest interest = interests.get(0); assertEquals("basic interest", interest.getDeclaredInterests().get(0)); assertEquals("prfFavHobbies", interest.getInterestCategory()); assertTrue(profile.getIsConnected()); assertEquals("2012-02-06T12:46:36Z", profile.getMemberSince().toString()); assertEquals("Europe/Paris", profile.getTimeZone()); assertEquals("2012-03-05T14:26:25Z", profile.getUpdated().toString()); assertEquals("http://social.yahooapis.com/v1/user/PCSXZCYSWC6XUJNMZKRGWVPHNU/profile", profile.getUri()); assertNotNull(profile.getAccessSecret()); assertEquals(24, profile.getAttributes().size()); }
From source file:org.pac4j.oauth.client.YahooClientIT.java
@Override protected void verifyProfile(final UserProfile userProfile) { final YahooProfile profile = (YahooProfile) userProfile; logger.debug("userProfile : {}", profile); assertEquals("PCSXZCYSWC6XUJNMZKRGWVPHNU", profile.getId()); assertEquals(YahooProfile.class.getSimpleName() + UserProfile.SEPARATOR + "PCSXZCYSWC6XUJNMZKRGWVPHNU", profile.getTypedId());// w w w . ja va 2s.com assertTrue(ProfileHelper.isTypedIdOf(profile.getTypedId(), YahooProfile.class)); assertTrue(StringUtils.isNotBlank(profile.getAccessToken())); assertCommonProfile(userProfile, "testscribeup@yahoo.fr", "Test", "ScribeUP", "Test ScribeUP", "Test", Gender.MALE, Locale.FRANCE, "/users/1DJGkdA6uAAECQWEo8AceAQ==.large.png", "http://profile.yahoo.com/PCSXZCYSWC6XUJNMZKRGWVPHNU", "Chatou, Ile-de-France"); assertEquals("my profile", profile.getAboutMe()); final List<YahooAddress> addresses = profile.getAddresses(); assertEquals(2, addresses.size()); final YahooAddress address = addresses.get(0); assertEquals(3, address.getId().intValue()); assertTrue(address.getCurrent()); assertEquals(Locale.FRENCH, address.getCountry()); assertEquals("", address.getState()); assertEquals("", address.getCity()); assertEquals("78400", address.getPostalCode()); assertEquals("", address.getStreet()); assertEquals("HOME", address.getType()); assertEquals(1976, profile.getBirthYear().intValue()); assertEquals("03/10", profile.getBirthdate().toString()); assertEquals("2012-02-06T12:46:43Z", profile.getCreated().toString()); assertEquals(38, profile.getDisplayAge().intValue()); final List<YahooDisclosure> disclosures = profile.getDisclosures(); assertEquals(2, disclosures.size()); final YahooDisclosure disclosure = disclosures.get(0); assertEquals("1", disclosure.getAcceptance()); assertEquals("bd", disclosure.getName()); assertTrue(disclosure.getSeen() instanceof Date); assertEquals("1", disclosure.getVersion()); final List<YahooEmail> emails = profile.getEmails(); assertEquals(2, emails.size()); final YahooEmail email = emails.get(1); assertEquals(2, email.getId().intValue()); assertTrue(email.getPrimary()); assertEquals("testscribeup@yahoo.fr", email.getHandle()); assertEquals("HOME", email.getType()); assertEquals(Gender.MALE, profile.getGender()); final YahooImage image = profile.getImage(); assertTrue(image.getImageUrl().contains("/users/1DJGkdA6uAAECQWEo8AceAQ==.large.png")); assertEquals(150, image.getWidth().intValue()); assertEquals(225, image.getHeight().intValue()); assertEquals("150x225", image.getSize()); final List<YahooInterest> interests = profile.getInterests(); assertEquals(11, interests.size()); final YahooInterest interest = interests.get(0); assertEquals("basic interest", interest.getDeclaredInterests().get(0)); assertEquals("prfFavHobbies", interest.getInterestCategory()); assertTrue(profile.getIsConnected()); assertEquals("2012-02-06T12:46:36Z", profile.getMemberSince().toString()); assertEquals("Europe/Paris", profile.getTimeZone()); assertEquals("2014-04-21T14:04:30Z", profile.getUpdated().toString()); assertEquals("https://social.yahooapis.com/v1/user/PCSXZCYSWC6XUJNMZKRGWVPHNU/profile", profile.getUri()); assertNotNull(profile.getAccessSecret()); assertEquals(24, profile.getAttributes().size()); }
From source file:org.glenans.extractor.model.Stage.java
public static String convertDateToString(Date stringDate) { if (stringDate == null) { return ""; } else {// w w w.j a v a2 s.c o m return new SimpleDateFormat(DATE_PATTERN_OUTPUT, Locale.FRANCE).format(stringDate); } }
From source file:eu.codeplumbers.cosi.activities.NoteDetailsActivity.java
private void saveNoteAndSync() { SimpleDateFormat isoFormat = new SimpleDateFormat(DateUtils.DATE_FORMAT, Locale.FRANCE); isoFormat.setTimeZone(TimeZone.getTimeZone("UTC")); Date date = new Date(); if (note == null) { note = new Note(); note.setCreationDate(isoFormat.format(date)); note.setVersion(0);//from ww w.ja va2s . c om note.setParentId("tree-node-all"); note.setRemoteId(""); } else { note.setVersion(note.getVersion() + 1); } getNoteTitle(isoFormat, date); }
From source file:org.ocelotds.core.services.ArgumentConvertorTest.java
/** * Test of convertJsonToJava method, of class ArgumentConvertor. * * @throws org.ocelotds.marshalling.exceptions.JsonUnmarshallingException * @throws org.ocelotds.marshalling.exceptions.JsonMarshallerException *//* w w w. j a va 2s. c o m*/ @Test public void testConvertJsonToJavaWithUnmarshaller() throws JsonUnmarshallingException, JsonMarshallerException { System.out.println("convertJsonToJavaWithUnmarshaller"); JsonUnmarshaller juma = mock(JsonUnmarshaller.class); Locale expectResult = Locale.FRANCE; when(juma.value()).thenReturn((Class) LocaleMarshaller.class); when(juma.type()).thenReturn(JsonMarshallerType.SINGLE); doReturn(juma).when(instance).getJsonUnmarshallerAnnotation(any(Annotation[].class)); doReturn(expectResult).when(instance).getResult(anyString(), any(IJsonMarshaller.class), any(JsonMarshallerType.class)); doNothing().when(argumentServices).checkType(any(JsonUnmarshaller.class), any(Type.class)); Object result = instance.convertJsonToJava("{\"language\":\"fr\",\"country\":\"FR\"}", Locale.class, new Annotation[] {}); assertThat(result).isInstanceOf(Locale.class); }