< prev index next >
test/java/time/tck/java/time/TCKLocalDate.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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.
@@ -102,10 +102,11 @@
import java.time.Year;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.ZonedDateTime;
import java.time.chrono.IsoChronology;
+import java.time.chrono.IsoEra;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.time.temporal.ChronoField;
import java.time.temporal.ChronoUnit;
import java.time.temporal.JulianFields;
@@ -2283,6 +2284,15 @@
private LocalDate date(int year, int month, int day) {
return LocalDate.of(year, month, day);
}
+ //-----------------------------------------------------------------
+ // getEra()
+ // ----------------------------------------------------------------
+ @Test
+ public void test_getEra() {
+ IsoEra isoEra = LocalDate.MAX.getEra();
+ assertSame(isoEra,IsoEra.CE);
+ assertSame(LocalDate.MIN.getEra(),IsoEra.BCE);
+ }
}
< prev index next >