< prev index next >
test/java/time/test/java/time/format/TestTextPrinter.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
@@ -211,14 +211,10 @@
return new Object[][] {
// Locale, pattern, expected text, input DayOfWeek
{Locale.US, "e", "1", DayOfWeek.SUNDAY},
{Locale.US, "ee", "01", DayOfWeek.SUNDAY},
{Locale.US, "c", "1", DayOfWeek.SUNDAY},
-
- {Locale.UK, "e", "1", DayOfWeek.MONDAY},
- {Locale.UK, "ee", "01", DayOfWeek.MONDAY},
- {Locale.UK, "c", "1", DayOfWeek.MONDAY},
};
}
@DataProvider(name="print_JapaneseChronology")
Object[][] provider_japaneseEra() {
@@ -227,23 +223,10 @@
{ERA, TextStyle.SHORT, 2, "Heisei"},
{ERA, TextStyle.NARROW, 2, "H"},
};
};
- // Test data is dependent on localized resources.
- @DataProvider(name="print_standalone")
- Object[][] provider_StandaloneNames() {
- return new Object[][] {
- // standalone names for 2013-01-01 (Tue)
- // Locale, TemporalField, TextStyle, expected text
- {RUSSIAN, MONTH_OF_YEAR, TextStyle.FULL_STANDALONE, "\u044f\u043d\u0432\u0430\u0440\u044c"},
- {RUSSIAN, MONTH_OF_YEAR, TextStyle.SHORT_STANDALONE, "\u044f\u043d\u0432."},
- {FINNISH, DAY_OF_WEEK, TextStyle.FULL_STANDALONE, "tiistai"},
- {FINNISH, DAY_OF_WEEK, TextStyle.SHORT_STANDALONE, "ti"},
- };
- }
-
@Test(dataProvider="print")
public void test_format(TemporalField field, TextStyle style, int value, String expected) throws Exception {
getFormatter(field, style).formatTo(new MockFieldValue(field, value), buf);
assertEquals(buf.toString(), expected);
}
@@ -260,27 +243,10 @@
LocalDate ld = LocalDate.of(2013, 1, 31);
getFormatter(field, style).withChronology(JapaneseChronology.INSTANCE).formatTo(ld, buf);
assertEquals(buf.toString(), expected);
}
- @Test(dataProvider="print_standalone")
- public void test_standaloneNames(Locale locale, TemporalField field, TextStyle style, String expected) {
- getFormatter(field, style).withLocale(locale).formatTo(LocalDate.of(2013, 1, 1), buf);
- assertEquals(buf.toString(), expected);
- }
-
- //-----------------------------------------------------------------------
- public void test_print_french_long() throws Exception {
- getFormatter(MONTH_OF_YEAR, TextStyle.FULL).withLocale(Locale.FRENCH).formatTo(LocalDate.of(2012, 1, 1), buf);
- assertEquals(buf.toString(), "janvier");
- }
-
- public void test_print_french_short() throws Exception {
- getFormatter(MONTH_OF_YEAR, TextStyle.SHORT).withLocale(Locale.FRENCH).formatTo(LocalDate.of(2012, 1, 1), buf);
- assertEquals(buf.toString(), "janv.");
- }
-
//-----------------------------------------------------------------------
public void test_toString1() throws Exception {
assertEquals(getFormatter(MONTH_OF_YEAR, TextStyle.FULL).toString(), "Text(MonthOfYear)");
}
< prev index next >