本文整理匯總了Java中java.time.format.DateTimeFormatterBuilder.getLocalizedDateTimePattern方法的典型用法代碼示例。如果您正苦於以下問題:Java DateTimeFormatterBuilder.getLocalizedDateTimePattern方法的具體用法?Java DateTimeFormatterBuilder.getLocalizedDateTimePattern怎麽用?Java DateTimeFormatterBuilder.getLocalizedDateTimePattern使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.time.format.DateTimeFormatterBuilder
的用法示例。
在下文中一共展示了DateTimeFormatterBuilder.getLocalizedDateTimePattern方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: test_getLocalizedDateTimePattern
import java.time.format.DateTimeFormatterBuilder; //導入方法依賴的package包/類
@Test(dataProvider="localePatterns")
public void test_getLocalizedDateTimePattern(FormatStyle dateStyle, FormatStyle timeStyle,
Chronology chrono, Locale locale, String expected) {
String actual = DateTimeFormatterBuilder.getLocalizedDateTimePattern(dateStyle, timeStyle, chrono, locale);
assertEquals(actual, expected, "Pattern " + convertNonAscii(actual));
}
示例2: test_getLocalizedDateTimePatternIAE
import java.time.format.DateTimeFormatterBuilder; //導入方法依賴的package包/類
@Test(expectedExceptions=java.lang.IllegalArgumentException.class)
public void test_getLocalizedDateTimePatternIAE() {
DateTimeFormatterBuilder.getLocalizedDateTimePattern(null, null, IsoChronology.INSTANCE, Locale.US);
}
示例3: test_getLocalizedChronoNPE
import java.time.format.DateTimeFormatterBuilder; //導入方法依賴的package包/類
@Test(expectedExceptions=java.lang.NullPointerException.class)
public void test_getLocalizedChronoNPE() {
DateTimeFormatterBuilder.getLocalizedDateTimePattern(FormatStyle.SHORT, FormatStyle.SHORT, null, Locale.US);
}
示例4: test_getLocalizedLocaleNPE
import java.time.format.DateTimeFormatterBuilder; //導入方法依賴的package包/類
@Test(expectedExceptions=java.lang.NullPointerException.class)
public void test_getLocalizedLocaleNPE() {
DateTimeFormatterBuilder.getLocalizedDateTimePattern(FormatStyle.SHORT, FormatStyle.SHORT, IsoChronology.INSTANCE, null);
}