Search in sources :

Example 1 with LocaleProvider

use of org.glassfish.jersey.message.internal.LocaleProvider in project jersey by jersey.

the class LocaleProviderTest method testFromString.

@Test
public void testFromString() throws Exception {
    final LocaleProvider instance = new LocaleProvider();
    assertEquals(new Locale("en"), instance.fromString("en"));
    assertEquals(new Locale("en", "us"), instance.fromString("en-us"));
}
Also used : Locale(java.util.Locale) LocaleProvider(org.glassfish.jersey.message.internal.LocaleProvider) Test(org.junit.Test)

Example 2 with LocaleProvider

use of org.glassfish.jersey.message.internal.LocaleProvider in project jersey by jersey.

the class LocaleProviderTest method testToString.

@Test
public void testToString() {
    final LocaleProvider instance = new LocaleProvider();
    assertEquals("en", instance.toString(new Locale("en")));
    assertEquals("en-US", instance.toString(new Locale("en", "us")));
}
Also used : Locale(java.util.Locale) LocaleProvider(org.glassfish.jersey.message.internal.LocaleProvider) Test(org.junit.Test)

Aggregations

Locale (java.util.Locale)2 LocaleProvider (org.glassfish.jersey.message.internal.LocaleProvider)2 Test (org.junit.Test)2