Home
last modified time | relevance | path

Searched refs:test (Results 1 – 25 of 324) sorted by relevance

12345678910>>...13

/libcore/ojluni/src/test/java/time/test/java/time/temporal/
DTestDateTimeValueRange.java60 package test.java.time.temporal;
74 import test.java.time.AbstractTest;
94 ValueRange test = ValueRange.of(1, 12); in test_of_longlong() local
95 assertEquals(test.getMinimum(), 1); in test_of_longlong()
96 assertEquals(test.getLargestMinimum(), 1); in test_of_longlong()
97 assertEquals(test.getSmallestMaximum(), 12); in test_of_longlong()
98 assertEquals(test.getMaximum(), 12); in test_of_longlong()
99 assertEquals(test.isFixed(), true); in test_of_longlong()
100 assertEquals(test.isIntValue(), true); in test_of_longlong()
104 ValueRange test = ValueRange.of(1, 123456789012345L); in test_of_longlong_big() local
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/
DTestZoneId.java60 package test.java.time;
116 ZoneId test = ZoneOffset.UTC; in test_constant_UTC() local
117 assertEquals(test.getId(), "Z"); in test_constant_UTC()
118 assertEquals(test.getDisplayName(TextStyle.FULL, Locale.UK), "Z"); in test_constant_UTC()
119 assertEquals(test.getRules().isFixedOffset(), true); in test_constant_UTC()
120 assertEquals(test.getRules().getOffset(Instant.ofEpochSecond(0L)), ZoneOffset.UTC); in test_constant_UTC()
121 checkOffset(test.getRules(), createLDT(2008, 6, 30), ZoneOffset.UTC, 1); in test_constant_UTC()
128 ZoneId test = ZoneId.systemDefault(); in test_systemDefault() local
129 assertEquals(test.getId(), TimeZone.getDefault().getID()); in test_systemDefault()
158 ZoneId test = ZoneId.of("Europe/London"); in test_London() local
[all …]
DTestOffsetDateTime_instants.java60 package test.java.time;
100 OffsetDateTime test = OffsetDateTime.ofInstant(instant, OFFSET_PONE); in factory_ofInstant_allSecsInDay() local
101 assertEquals(test.getYear(), 1970); in factory_ofInstant_allSecsInDay()
102 assertEquals(test.getMonth(), Month.JANUARY); in factory_ofInstant_allSecsInDay()
103 assertEquals(test.getDayOfMonth(), 1 + (i >= 23 * 60 * 60 ? 1 : 0)); in factory_ofInstant_allSecsInDay()
104 assertEquals(test.getHour(), ((i / (60 * 60)) + 1) % 24); in factory_ofInstant_allSecsInDay()
105 assertEquals(test.getMinute(), (i / 60) % 60); in factory_ofInstant_allSecsInDay()
106 assertEquals(test.getSecond(), i % 60); in factory_ofInstant_allSecsInDay()
115 OffsetDateTime test = OffsetDateTime.ofInstant(instant, ZoneOffset.UTC); in factory_ofInstant_allDaysInCycle() local
116 assertEquals(test, expected); in factory_ofInstant_allDaysInCycle()
[all …]
DTestOffsetDateTime.java60 package test.java.time;
126 OffsetDateTime test = base.withOffsetSameLocal(OFFSET_PTWO); in test_withOffsetSameLocal() local
127 assertSame(test.toLocalDateTime(), base.toLocalDateTime()); in test_withOffsetSameLocal()
128 assertSame(test.getOffset(), OFFSET_PTWO); in test_withOffsetSameLocal()
134 OffsetDateTime test = base.withOffsetSameLocal(OFFSET_PONE); in test_withOffsetSameLocal_noChange() local
135 assertSame(test, base); in test_withOffsetSameLocal_noChange()
141 OffsetDateTime test = base.withOffsetSameInstant(OFFSET_PONE); in test_withOffsetSameInstant_noChange() local
142 assertSame(test, base); in test_withOffsetSameInstant_noChange()
148 OffsetDateTime test = base.withYear(2008); in test_withYear_noChange() local
149 assertSame(test, base); in test_withYear_noChange()
[all …]
DTestMonthDay.java60 package test.java.time;
93 void check(MonthDay test, int m, int d) { in check() argument
94 assertEquals(test.getMonth().getValue(), m); in check()
95 assertEquals(test.getDayOfMonth(), d); in check()
100 MonthDay test = MonthDay.of(6, 30); in test_with_Month_noChangeSame() local
101 assertSame(test.with(Month.JUNE), test); in test_with_Month_noChangeSame() local
106 MonthDay test = MonthDay.of(6, 30); in test_withMonth_int_noChangeSame() local
107 assertSame(test.withMonth(6), test); in test_withMonth_int_noChangeSame()
111 MonthDay test = MonthDay.of(6, 30); in test_withDayOfMonth_noChangeSame() local
112 assertSame(test.withDayOfMonth(30), test); in test_withDayOfMonth_noChangeSame()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/zone/
DTCKZoneRules.java116 ZoneRules test = europeLondon(); in test_London() local
117 assertEquals(test.isFixedOffset(), false); in test_London()
121 ZoneRules test = europeLondon(); in test_London_preTimeZones() local
125 assertEquals(test.getOffset(instant), offset); in test_London_preTimeZones()
126 checkOffset(test, old.toLocalDateTime(), offset, 1); in test_London_preTimeZones()
127 assertEquals(test.getStandardOffset(instant), offset); in test_London_preTimeZones()
128 assertEquals(test.getDaylightSavings(instant), Duration.ZERO); in test_London_preTimeZones()
129 assertEquals(test.isDaylightSavings(instant), false); in test_London_preTimeZones()
133 ZoneRules test = europeLondon(); in test_London_getOffset() local
134 assertEquals(test.getOffset(createInstant(2008, 1, 1, ZoneOffset.UTC)), OFFSET_ZERO); in test_London_getOffset()
[all …]
DTCKFixedZoneRules.java112 public void test_getOffset_Instant(ZoneRules test, ZoneOffset expectedOffset) { in test_getOffset_Instant() argument
113 assertEquals(test.getOffset(INSTANT), expectedOffset); in test_getOffset_Instant()
114 assertEquals(test.getOffset((Instant) null), expectedOffset); in test_getOffset_Instant()
118 public void test_getOffset_LocalDateTime(ZoneRules test, ZoneOffset expectedOffset) { in test_getOffset_LocalDateTime() argument
119 assertEquals(test.getOffset(LDT), expectedOffset); in test_getOffset_LocalDateTime()
120 assertEquals(test.getOffset((LocalDateTime) null), expectedOffset); in test_getOffset_LocalDateTime()
124 public void test_getValidOffsets_LDT(ZoneRules test, ZoneOffset expectedOffset) { in test_getValidOffsets_LDT() argument
125 assertEquals(test.getValidOffsets(LDT).size(), 1); in test_getValidOffsets_LDT()
126 assertEquals(test.getValidOffsets(LDT).get(0), expectedOffset); in test_getValidOffsets_LDT()
127 assertEquals(test.getValidOffsets(null).size(), 1); in test_getValidOffsets_LDT()
[all …]
DTCKZoneOffsetTransition.java121 ZoneOffsetTransition test = ZoneOffsetTransition.of(before, OFFSET_0200, OFFSET_0300); in test_getters_gap() local
122 assertEquals(test.isGap(), true); in test_getters_gap()
123 assertEquals(test.isOverlap(), false); in test_getters_gap()
124 assertEquals(test.getDateTimeBefore(), before); in test_getters_gap()
125 assertEquals(test.getDateTimeAfter(), after); in test_getters_gap()
126 assertEquals(test.getInstant(), before.toInstant(OFFSET_0200)); in test_getters_gap()
127 assertEquals(test.getOffsetBefore(), OFFSET_0200); in test_getters_gap()
128 assertEquals(test.getOffsetAfter(), OFFSET_0300); in test_getters_gap()
129 assertEquals(test.getDuration(), Duration.of(1, HOURS)); in test_getters_gap()
136 ZoneOffsetTransition test = ZoneOffsetTransition.of(before, OFFSET_0300, OFFSET_0200); in test_getters_overlap() local
[all …]
DTCKZoneOffsetTransitionRule.java164 ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( in test_getters_floatingWeek() local
167 assertEquals(test.getMonth(), Month.MARCH); in test_getters_floatingWeek()
168 assertEquals(test.getDayOfMonthIndicator(), 20); in test_getters_floatingWeek()
169 assertEquals(test.getDayOfWeek(), DayOfWeek.SUNDAY); in test_getters_floatingWeek()
170 assertEquals(test.getLocalTime(), TIME_0100); in test_getters_floatingWeek()
171 assertEquals(test.isMidnightEndOfDay(), false); in test_getters_floatingWeek()
172 assertEquals(test.getTimeDefinition(), TimeDefinition.WALL); in test_getters_floatingWeek()
173 assertEquals(test.getStandardOffset(), OFFSET_0200); in test_getters_floatingWeek()
174 assertEquals(test.getOffsetBefore(), OFFSET_0200); in test_getters_floatingWeek()
175 assertEquals(test.getOffsetAfter(), OFFSET_0300); in test_getters_floatingWeek()
[all …]
/libcore/dom/src/test/java/org/w3c/domts/
DDOMTestInnerClass.java27 private final DOMTestCase test; field in DOMTestInnerClass
29 public DOMTestInnerClass(DOMTestCase test) { in DOMTestInnerClass() argument
30 this.test = test; in DOMTestInnerClass()
34 test.wait(millisecond); in wait()
38 test.assertTrue(assertID, actual); in assertTrue()
42 test.assertFalse(assertID, actual); in assertFalse()
46 test.assertNull(assertID, actual); in assertNull()
50 test.assertNotNull(assertID, actual); in assertNotNull()
54 test.assertSame(assertID, expected, actual); in assertSame()
58 test.assertInstanceOf(assertID, cls, obj); in assertInstanceOf()
[all …]
DDOMTestFramework.java34 void fail(DOMTestCase test, String assertID); in fail() argument
36 void assertTrue(DOMTestCase test, String assertID, boolean actual); in assertTrue() argument
38 void assertFalse(DOMTestCase test, String assertID, boolean actual); in assertFalse() argument
40 void assertNull(DOMTestCase test, String assertID, Object actual); in assertNull() argument
42 void assertNotNull(DOMTestCase test, String assertID, Object actual); in assertNotNull() argument
45 DOMTestCase test, in assertSame() argument
51 DOMTestCase test, in assertInstanceOf() argument
57 DOMTestCase test, in assertSize() argument
63 DOMTestCase test, in assertSize() argument
69 DOMTestCase test, in assertSize() argument
[all …]
DJUnitTestSuiteAdapter.java23 private DOMTestSuite test; field in JUnitTestSuiteAdapter
25 public JUnitTestSuiteAdapter(DOMTestSuite test) { in JUnitTestSuiteAdapter() argument
26 super(test.getTargetURI()); in JUnitTestSuiteAdapter()
27 this.test = test; in JUnitTestSuiteAdapter()
28 test.build(this); in JUnitTestSuiteAdapter()
32 DOMTestDocumentBuilderFactory factory = test.getFactory(); in addTest()
48 TestCase test = new JUnitTestCaseAdapter((DOMTestCase) domtest); in addTest() local
49 addTest(test); in addTest()
53 TestSuite test = new JUnitTestSuiteAdapter((DOMTestSuite) domtest); in addTest() local
54 addTest(test); in addTest()
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/
DTCKTemporalAdjusters.java92 TemporalAdjuster test = TemporalAdjusters.ofDateAdjuster(date -> date.plusDays(2)); in factory_ofDateAdjuster() local
93 assertEquals(LocalDate.of(2012, 6, 30).with(test), LocalDate.of(2012, 7, 2)); in factory_ofDateAdjuster()
115 LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfMonth().adjustInto(date); in test_firstDayOfMonth_nonLeap() local
116 assertEquals(test.getYear(), 2007); in test_firstDayOfMonth_nonLeap()
117 assertEquals(test.getMonth(), month); in test_firstDayOfMonth_nonLeap()
118 assertEquals(test.getDayOfMonth(), 1); in test_firstDayOfMonth_nonLeap()
128 LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfMonth().adjustInto(date); in test_firstDayOfMonth_leap() local
129 assertEquals(test.getYear(), 2008); in test_firstDayOfMonth_leap()
130 assertEquals(test.getMonth(), month); in test_firstDayOfMonth_leap()
131 assertEquals(test.getDayOfMonth(), 1); in test_firstDayOfMonth_leap()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/format/
DTCKDateTimeFormatter.java138 DateTimeFormatter test = base.withLocale(Locale.GERMAN); in test_withLocale() local
139 assertEquals(test.getLocale(), Locale.GERMAN); in test_withLocale()
151 DateTimeFormatter test = fmt; in test_withChronology() local
152 assertEquals(test.getChronology(), null); in test_withChronology()
153 test = test.withChronology(IsoChronology.INSTANCE); in test_withChronology()
154 assertEquals(test.getChronology(), IsoChronology.INSTANCE); in test_withChronology()
155 test = test.withChronology(null); in test_withChronology()
156 assertEquals(test.getChronology(), null); in test_withChronology()
162 DateTimeFormatter test = fmt; in test_withZone() local
163 assertEquals(test.getZone(), null); in test_withZone()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKZonedDateTime.java232 ZonedDateTime test = ZonedDateTime.now(); in now() local
233 … long diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); in now()
237 test = ZonedDateTime.now(); in now()
238 … diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); in now()
255 ZonedDateTime test = ZonedDateTime.now(zone);
257 if (expected.equals(test)) {
261 test = ZonedDateTime.now(zone);
263 assertEquals(test, expected);
279 ZonedDateTime test = ZonedDateTime.now(clock);
280 assertEquals(test.getYear(), 1970);
[all …]
DTCKYearMonth.java163 void check(YearMonth test, int y, int m) { in check() argument
164 assertEquals(test.getYear(), y); in check()
165 assertEquals(test.getMonth().getValue(), m); in check()
174 YearMonth test = YearMonth.now(); in now() local
176 if (expected.equals(test)) { in now()
180 test = YearMonth.now(); in now()
182 assertEquals(test, expected); in now()
197 YearMonth test = YearMonth.now(zone); in now_ZoneId() local
199 if (expected.equals(test)) { in now_ZoneId()
203 test = YearMonth.now(zone); in now_ZoneId()
[all …]
DTCKZoneId.java158 ZoneId test = ZoneId.of("LONDON", map); in test_of_string_Map() local
159 assertEquals(test.getId(), "Europe/London"); in test_of_string_Map()
167 ZoneId test = ZoneId.of("Europe/Madrid", map); in test_of_string_Map_lookThrough() local
168 assertEquals(test.getId(), "Europe/Madrid"); in test_of_string_Map_lookThrough()
174 ZoneId test = ZoneId.of("Europe/Madrid", map); in test_of_string_Map_emptyMap() local
175 assertEquals(test.getId(), "Europe/Madrid"); in test_of_string_Map_emptyMap()
231 ZoneId test = ZoneId.of(input); in factory_of_String_offsetBasedValid_noPrefix() local
232 assertEquals(test.getId(), id); in factory_of_String_offsetBasedValid_noPrefix()
233 assertEquals(test, ZoneOffset.of(id)); in factory_of_String_offsetBasedValid_noPrefix()
234 assertEquals(test.normalized(), ZoneOffset.of(id)); in factory_of_String_offsetBasedValid_noPrefix()
[all …]
DTCKOffsetTime.java128 import test.java.time.MockSimplePeriod;
212 OffsetTime test = OffsetTime.now(); in now() local
213 … long diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); in now()
215 assertEquals(test.getOffset(), nowDT.getOffset()); in now()
226 OffsetTime test = OffsetTime.now(clock);
227 assertEquals(test.getHour(), (i / (60 * 60)) % 24);
228 assertEquals(test.getMinute(), (i / 60) % 60);
229 assertEquals(test.getSecond(), i % 60);
230 assertEquals(test.getNano(), 8);
231 assertEquals(test.getOffset(), ZoneOffset.UTC);
[all …]
DTCKClock_Tick.java88 …Clock test = Clock.tick(Clock.fixed(ZDT.withNano(i * 1000_000).toInstant(), PARIS), Duration.ofMil… in test_tick_ClockDuration_250millis() local
89 assertEquals(test.instant(), ZDT.withNano((i / 250) * 250_000_000).toInstant()); in test_tick_ClockDuration_250millis()
90 assertEquals(test.getZone(), PARIS); in test_tick_ClockDuration_250millis()
96 …Clock test = Clock.tick(Clock.fixed(ZDT.withNano(i * 1000).toInstant(), PARIS), Duration.ofNanos(2… in test_tick_ClockDuration_250micros() local
97 assertEquals(test.instant(), ZDT.withNano((i / 250) * 250_000).toInstant()); in test_tick_ClockDuration_250micros()
98 assertEquals(test.getZone(), PARIS); in test_tick_ClockDuration_250micros()
104 … Clock test = Clock.tick(Clock.fixed(ZDT.withNano(i).toInstant(), PARIS), Duration.ofNanos(20)); in test_tick_ClockDuration_20nanos() local
105 assertEquals(test.instant(), ZDT.withNano((i / 20) * 20).toInstant()); in test_tick_ClockDuration_20nanos()
106 assertEquals(test.getZone(), PARIS); in test_tick_ClockDuration_20nanos()
112 Clock test = Clock.tick(underlying, Duration.ZERO); in test_tick_ClockDuration_zeroDuration() local
[all …]
DTestIsoChronology.java101 Chronology test = Chronology.of("ISO"); in test_chrono_byName() local
102 Assert.assertNotNull(test, "The ISO calendar could not be found byName"); in test_chrono_byName()
103 Assert.assertEquals(test.getId(), "ISO", "ID mismatch"); in test_chrono_byName()
104 Assert.assertEquals(test.getCalendarType(), "iso8601", "Type mismatch"); in test_chrono_byName()
105 Assert.assertEquals(test, c); in test_chrono_byName()
188 LocalDate test = IsoChronology.INSTANCE.date(IsoEra.BCE, year, month, dayOfMonth); in test_date_withEra() local
189 assertEquals(test.getEra(), IsoEra.BCE); in test_date_withEra()
190 assertEquals(test.get(ChronoField.YEAR_OF_ERA), year); in test_date_withEra()
191 assertEquals(test.get(ChronoField.MONTH_OF_YEAR), month); in test_date_withEra()
192 assertEquals(test.get(ChronoField.DAY_OF_MONTH), dayOfMonth); in test_date_withEra()
[all …]
DTCKOffsetDateTime.java145 import test.java.time.MockSimplePeriod;
243 OffsetDateTime test = OffsetDateTime.now(); in now() local
244 … long diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); in now()
248 test = OffsetDateTime.now(); in now()
249 … diff = Math.abs(test.toLocalTime().toNanoOfDay() - expected.toLocalTime().toNanoOfDay()); in now()
262 OffsetDateTime test = OffsetDateTime.now(clock);
263 assertEquals(test.getYear(), 1970);
264 assertEquals(test.getMonth(), Month.JANUARY);
265 assertEquals(test.getDayOfMonth(), (i < 24 * 60 * 60 ? 1 : 2));
266 assertEquals(test.getHour(), (i / (60 * 60)) % 24);
[all …]
/libcore/ojluni/src/test/java/time/test/java/time/zone/
DTestFixedZoneRules.java60 package test.java.time.zone;
88 ZoneRules test = make(OFFSET_PONE); in test_data_nullInput() local
89 assertEquals(test.getOffset((Instant) null), OFFSET_PONE); in test_data_nullInput()
90 assertEquals(test.getOffset((LocalDateTime) null), OFFSET_PONE); in test_data_nullInput()
91 assertEquals(test.getValidOffsets(null).size(), 1); in test_data_nullInput()
92 assertEquals(test.getValidOffsets(null).get(0), OFFSET_PONE); in test_data_nullInput()
93 assertEquals(test.getTransition(null), null); in test_data_nullInput()
94 assertEquals(test.getStandardOffset(null), OFFSET_PONE); in test_data_nullInput()
95 assertEquals(test.getDaylightSavings(null), Duration.ZERO); in test_data_nullInput()
96 assertEquals(test.isDaylightSavings(null), false); in test_data_nullInput()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DAttributedCharacterIteratorTest.java30 String test = "Test 23ring"; in test_current() local
31 AttributedString attrString = new AttributedString(test); in test_current()
50 String test = "Test 23ring"; in test_first() local
51 AttributedString attrString = new AttributedString(test); in test_first()
66 String test = "Test 23ring"; in test_getBeginIndex() local
67 AttributedString attrString = new AttributedString(test); in test_getBeginIndex()
76 String test = "Test 23ring"; in test_getEndIndex() local
77 AttributedString attrString = new AttributedString(test); in test_getEndIndex()
86 String test = "Test 23ring"; in test_getIndex() local
87 AttributedString attrString = new AttributedString(test); in test_getIndex()
[all …]
/libcore/ojluni/src/test/java/time/tck/java/time/zone/serial/
DTCKZoneOffsetTransitionRuleSerialization.java88 ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( in test_serialization_unusualOffsets() local
93 assertSerializable(test); in test_serialization_unusualOffsets()
98 ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( in test_serialization_endOfDay() local
101 assertSerializable(test); in test_serialization_endOfDay()
106 ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( in test_serialization_unusualTime() local
109 assertSerializable(test); in test_serialization_unusualTime()
114 ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( in test_serialization_floatingWeek() local
117 assertSerializable(test); in test_serialization_floatingWeek()
122 ZoneOffsetTransitionRule test = ZoneOffsetTransitionRule.of( in test_serialization_floatingWeekBackwards() local
125 assertSerializable(test); in test_serialization_floatingWeekBackwards()
[all …]
/libcore/ojluni/src/test/java/time/test/java/util/
DTestFormatter.java23 package test.java.util;
83 public void test (String calendarLocale) { in test() method in TestFormatter
157 private String test(String fmtStr, Locale locale, in test() method in TestFormatter
184 String expected = test(fmtStr, locale, null, cal); in testDate()
185 test(fmtStr, locale, expected, zdt); in testDate()
186 test(fmtStr, locale, expected, zdt.toLocalDateTime()); in testDate()
187 test(fmtStr, locale, expected, zdt.toLocalDate()); in testDate()
189 test(fmtStr, locale, expected, ((ZonedDateTime)zdt).toOffsetDateTime()); in testDate()
196 String expected = test(fmtStr, locale, null, cal); in testTime()
197 test(fmtStr, locale, expected, zdt); in testTime()
[all …]

12345678910>>...13