本文整理汇总了Java中java.time.LocalDateTime.MAX属性的典型用法代码示例。如果您正苦于以下问题:Java LocalDateTime.MAX属性的具体用法?Java LocalDateTime.MAX怎么用?Java LocalDateTime.MAX使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.time.LocalDateTime
的用法示例。
在下文中一共展示了LocalDateTime.MAX属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: data_adjustInto
@DataProvider(name="adjustInto")
Object[][] data_adjustInto() {
return new Object[][]{
{LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.of(2012, 3, 4, 1, 1, 1, 100), LocalDateTime.of(2012, 3, 4, 23, 5, 0, 0), null},
{LocalDateTime.of(2012, Month.MARCH, 4, 0, 0), LocalDateTime.of(2012, 3, 4, 1, 1, 1, 100), LocalDateTime.of(2012, 3, 4, 0, 0), null},
{LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MAX, LocalDateTime.of(2012, 3, 4, 23, 5), null},
{LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MIN, LocalDateTime.of(2012, 3, 4, 23, 5), null},
{LocalDateTime.MAX, LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MAX, null},
{LocalDateTime.MIN, LocalDateTime.of(2012, 3, 4, 23, 5), LocalDateTime.MIN, null},
{LocalDateTime.of(2012, 3, 4, 23, 5), OffsetDateTime.of(2210, 2, 2, 0, 0, 0, 0, ZoneOffset.UTC), OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, ZoneOffset.UTC), null},
{LocalDateTime.of(2012, 3, 4, 23, 5), OffsetDateTime.of(2210, 2, 2, 0, 0, 0, 0, OFFSET_PONE), OffsetDateTime.of(2012, 3, 4, 23, 5, 0, 0, OFFSET_PONE), null},
{LocalDateTime.of(2012, 3, 4, 23, 5), ZonedDateTime.of(2210, 2, 2, 0, 0, 0, 0, ZONE_PARIS), ZonedDateTime.of(2012, 3, 4, 23, 5, 0, 0, ZONE_PARIS), null},
{LocalDateTime.of(2012, 3, 4, 23, 5), LocalDate.of(2210, 2, 2), null, DateTimeException.class},
{LocalDateTime.of(2012, 3, 4, 23, 5), LocalTime.of(22, 3, 0), null, DateTimeException.class},
{LocalDateTime.of(2012, 3, 4, 23, 5), OffsetTime.of(22, 3, 0, 0, ZoneOffset.UTC), null, DateTimeException.class},
{LocalDateTime.of(2012, 3, 4, 23, 5), null, null, NullPointerException.class},
};
}
示例2: setUp
@BeforeMethod
public void setUp() {
MAX_DATE_TIME = LocalDateTime.MAX;
MIN_DATE_TIME = LocalDateTime.MIN;
MAX_INSTANT = MAX_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
MIN_INSTANT = MIN_DATE_TIME.atZone(ZoneOffset.UTC).toInstant();
}
示例3: unit_test
private static void unit_test(LocalDate start, LocalDate end) {
DateTimeFormatter dtf = DateTimeFormatter.ofPattern("dd.MM.yyyy");
System.out.println("Starting test from " + start.format(dtf) + " to " + end.format(dtf) + "...");
boolean error = false;
for(String url : test_urls) {
System.out.print("Checking " + url + " ... ");
try {
Map<LocalDate, ArrayList<Appointment>> data = DataImporter.ImportWeekRange(start, end, url);
Map<TimelessDate, ArrayList<BackportAppointment>> backportData = DataImporter.Backport.ImportWeekRange(
DateUtilities.ConvertToCalendar(start), DateUtilities.ConvertToCalendar(end), url);
if (checkEquality(data, backportData)) {
System.out.println("SUCCESS!");
} else {
error = true;
System.out.println("INVALID!");
}
if (debugData) {
print(data);
print(backportData);
}
} catch (NoConnectionException | MalformedURLException | IllegalAccessException e) {
error = true;
System.out.println("FAIL!");
e.printStackTrace();
}
}
// Check for trivial equality
Appointment a = new Appointment(LocalDateTime.MIN, LocalDateTime.MAX, "Title", "Persons", "Resources");
BackportAppointment ba = new BackportAppointment((GregorianCalendar)Calendar.getInstance(), (GregorianCalendar)Calendar.getInstance(),
"title", "persons", "resources");
if(!error && (!a.equals(a) || !ba.equals(ba))) {
error = true;
System.err.println("Data structures equals not working");
}
if (error) {
System.out.println("Main finished with errors :(");
} else {
System.out.println("Main successfully finished! :)");
}
}
示例4: samples
@Override
protected List<TemporalAccessor> samples() {
TemporalAccessor[] array = {TEST_2007_07_15_12_30_40_987654321, LocalDateTime.MAX, LocalDateTime.MIN, };
return Arrays.asList(array);
}