當前位置: 首頁>>代碼示例>>Java>>正文


Java LocalDateTime.MAX屬性代碼示例

本文整理匯總了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},

    };
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:21,代碼來源:TCKLocalDateTime.java

示例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();
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:7,代碼來源:TCKLocalDateTime.java

示例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! :)");
    }
}
 
開發者ID:dhbw-timetable,項目名稱:rapla-parser,代碼行數:42,代碼來源:Main.java

示例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);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:5,代碼來源:TCKLocalDateTime.java


注:本文中的java.time.LocalDateTime.MAX屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。