From 81878548b4c62cee7355e07d0cd0c3141c80de26 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Tue, 5 May 2020 13:25:05 +0300 Subject: [PATCH] java.time: running threeten tests --- .../bp/format/SimpleDateTimeTextProvider.java | 2 +- .../org/threeten/bp/temporal/WeekFields.java | 1 - .../teavm/classlib/java/time/TestClock.java | 5 ++ .../classlib/java/time/TestClockFixed.java | 5 ++ .../classlib/java/time/TestClockOffset.java | 5 ++ .../classlib/java/time/TestClockSystem.java | 5 ++ .../classlib/java/time/TestClockTick.java | 5 ++ .../time/TestDateTimesImplementation.java | 5 ++ .../classlib/java/time/TestDayOfWeek.java | 5 ++ .../classlib/java/time/TestDuration.java | 5 ++ .../teavm/classlib/java/time/TestInstant.java | 5 ++ .../classlib/java/time/TestLocalDate.java | 5 ++ .../classlib/java/time/TestLocalDateTime.java | 5 ++ .../classlib/java/time/TestLocalTime.java | 5 ++ .../teavm/classlib/java/time/TestMonth.java | 5 ++ .../java/time/TestOffsetDateTime.java | 5 ++ .../java/time/TestOffsetDateTimeInstants.java | 5 ++ .../classlib/java/time/TestOffsetTime.java | 5 ++ .../teavm/classlib/java/time/TestPeriod.java | 5 ++ .../teavm/classlib/java/time/TestZoneId.java | 5 ++ .../classlib/java/time/TestZoneOffset.java | 5 ++ .../classlib/java/time/TestZonedDateTime.java | 5 ++ .../java/time/chrono/TestChronoLocalDate.java | 5 ++ .../time/chrono/TestChronoLocalDateTime.java | 18 +++-- .../time/chrono/TestChronoZonedDateTime.java | 5 ++ .../java/time/chrono/TestChronology.java | 5 ++ .../time/chrono/TestHijrahChronology.java | 5 ++ .../java/time/chrono/TestIsoChronology.java | 5 ++ .../time/chrono/TestJapaneseChronology.java | 5 ++ .../time/chrono/TestMinguoChronology.java | 5 ++ .../chrono/TestThaiBuddhistChronology.java | 5 ++ .../time/format/TestDateTimeFormatter.java | 5 ++ .../format/TestDateTimeFormatterBuilder.java | 5 ++ .../time/format/TestDateTimeFormatters.java | 5 ++ .../java/time/format/TestDateTimeParsing.java | 5 ++ .../time/format/TestDateTimeTextPrinting.java | 5 ++ .../java/time/format/TestDecimalStyle.java | 5 ++ .../java/time/temporal/TestChronoField.java | 8 +- .../java/time/temporal/TestChronoUnit.java | 5 ++ .../java/time/temporal/TestIsoFields.java | 5 ++ .../java/time/temporal/TestJulianFields.java | 5 ++ .../java/time/temporal/TestMonthDay.java | 5 ++ .../time/temporal/TestTemporalAdjusters.java | 5 ++ .../java/time/temporal/TestValueRange.java | 5 ++ .../classlib/java/time/temporal/TestYear.java | 5 ++ .../java/time/temporal/TestYearMonth.java | 5 ++ .../java/time/zone/TestFixedZoneRules.java | 5 ++ .../java/time/zone/TestStandardZoneRules.java | 79 +++++++------------ .../time/zone/TestZoneOffsetTransition.java | 5 ++ .../zone/TestZoneOffsetTransitionRule.java | 5 ++ .../java/time/zone/TestZoneRulesBuilder.java | 5 ++ .../java/time/zone/TestZoneRulesProvider.java | 24 +++--- 52 files changed, 294 insertions(+), 68 deletions(-) diff --git a/classlib/src/main/java/org/threeten/bp/format/SimpleDateTimeTextProvider.java b/classlib/src/main/java/org/threeten/bp/format/SimpleDateTimeTextProvider.java index 4598176e8..d5a579415 100644 --- a/classlib/src/main/java/org/threeten/bp/format/SimpleDateTimeTextProvider.java +++ b/classlib/src/main/java/org/threeten/bp/format/SimpleDateTimeTextProvider.java @@ -70,7 +70,7 @@ final class SimpleDateTimeTextProvider extends DateTimeTextProvider { }; /** Cache. */ - private final Map, Object> cache = new HashMap<>(); + private final Map, Object> cache = new HashMap<>(); //----------------------------------------------------------------------- @Override diff --git a/classlib/src/main/java/org/threeten/bp/temporal/WeekFields.java b/classlib/src/main/java/org/threeten/bp/temporal/WeekFields.java index da55ccbe0..56261dc1d 100644 --- a/classlib/src/main/java/org/threeten/bp/temporal/WeekFields.java +++ b/classlib/src/main/java/org/threeten/bp/temporal/WeekFields.java @@ -40,7 +40,6 @@ import static org.threeten.bp.temporal.ChronoUnit.DAYS; import static org.threeten.bp.temporal.ChronoUnit.MONTHS; import static org.threeten.bp.temporal.ChronoUnit.WEEKS; import static org.threeten.bp.temporal.ChronoUnit.YEARS; - import java.io.InvalidObjectException; import java.io.Serializable; import java.util.GregorianCalendar; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClock.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClock.java index 03ae7ce36..111d7d068 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClock.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClock.java @@ -51,12 +51,17 @@ import static org.testng.Assert.assertEquals; import java.time.Clock; import java.time.Instant; import java.time.ZoneId; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test Clock. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestClock { static class MockInstantClock extends Clock { diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClockFixed.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClockFixed.java index 3cfdd0232..d13c8bc72 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClockFixed.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClockFixed.java @@ -54,12 +54,17 @@ import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test fixed clock. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestClockFixed extends AbstractTest { private static final ZoneId MOSCOW = ZoneId.of("Europe/Moscow"); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClockOffset.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClockOffset.java index 8d86c1fd3..76d49f692 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClockOffset.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClockOffset.java @@ -55,12 +55,17 @@ import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test offset clock. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestClockOffset extends AbstractTest { private static final ZoneId MOSCOW = ZoneId.of("Europe/Moscow"); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClockSystem.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClockSystem.java index ee3b6a0db..236647bb4 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClockSystem.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClockSystem.java @@ -54,12 +54,17 @@ import java.time.Clock; import java.time.Instant; import java.time.ZoneId; import java.time.ZoneOffset; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test system clock. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestClockSystem extends AbstractTest { private static final ZoneId MOSCOW = ZoneId.of("Europe/Moscow"); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java b/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java index 77f11bfd5..84eed386c 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestClockTick.java @@ -56,12 +56,17 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.ZoneOffset; import java.time.ZonedDateTime; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test tick clock. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestClockTick extends AbstractTest { private static final ZoneId MOSCOW = ZoneId.of("Europe/Moscow"); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java b/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java index 27fd08464..2a55535d4 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestDateTimesImplementation.java @@ -48,6 +48,9 @@ package org.teavm.classlib.java.time; import static org.testng.Assert.assertEquals; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import org.threeten.bp.jdk8.Jdk8Methods; @@ -56,6 +59,8 @@ import org.threeten.bp.jdk8.Jdk8Methods; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestDateTimesImplementation { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestDayOfWeek.java b/tests/src/test/java/org/teavm/classlib/java/time/TestDayOfWeek.java index 6aeb0ca10..49eaeb7e6 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestDayOfWeek.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestDayOfWeek.java @@ -70,6 +70,9 @@ import java.util.Arrays; import java.util.List; import java.util.Locale; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -78,6 +81,8 @@ import org.testng.annotations.Test; * Test DayOfWeek. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestDayOfWeek extends AbstractDateTimeTest { @BeforeMethod diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestDuration.java b/tests/src/test/java/org/teavm/classlib/java/time/TestDuration.java index 234375219..1d1b9c4b3 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestDuration.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestDuration.java @@ -65,6 +65,9 @@ import java.time.format.DateTimeParseException; import java.time.temporal.TemporalUnit; import java.util.Locale; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -72,6 +75,8 @@ import org.testng.annotations.Test; * Test Duration. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestDuration extends AbstractTest { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestInstant.java b/tests/src/test/java/org/teavm/classlib/java/time/TestInstant.java index b208d3d66..142207b38 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestInstant.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestInstant.java @@ -72,6 +72,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -79,6 +82,8 @@ import org.testng.annotations.Test; * Test Instant. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestInstant extends AbstractDateTimeTest { private static final long MIN_SECOND = Instant.MIN.getEpochSecond(); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java index f83a585e2..6c3800047 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDate.java @@ -97,7 +97,10 @@ import java.time.temporal.TemporalUnit; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.temporal.MockFieldNoValue; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -106,6 +109,8 @@ import org.testng.annotations.Test; * Test LocalDate. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestLocalDate extends AbstractDateTimeTest { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDateTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDateTime.java index 9ba62de0f..a39677c09 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDateTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalDateTime.java @@ -113,7 +113,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Iterator; import java.util.List; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.temporal.MockFieldNoValue; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -122,6 +125,8 @@ import org.testng.annotations.Test; * Test LocalDateTime. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestLocalDateTime extends AbstractDateTimeTest { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalTime.java index 932c39b88..93504ab91 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestLocalTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestLocalTime.java @@ -105,7 +105,10 @@ import java.util.Arrays; import java.util.EnumSet; import java.util.Iterator; import java.util.List; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.temporal.MockFieldNoValue; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -114,6 +117,8 @@ import org.testng.annotations.Test; * Test LocalTime. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestLocalTime extends AbstractDateTimeTest { private LocalTime test12x30x40x987654321; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestMonth.java b/tests/src/test/java/org/teavm/classlib/java/time/TestMonth.java index fda36eeac..9b0b63f7f 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestMonth.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestMonth.java @@ -67,6 +67,9 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Locale; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -74,6 +77,8 @@ import org.testng.annotations.Test; * Test Month. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestMonth extends AbstractDateTimeTest { private static final int MAX_LENGTH = 12; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTime.java index 7c743da64..00b51855b 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTime.java @@ -109,6 +109,9 @@ import java.time.temporal.TemporalQueries; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -117,6 +120,8 @@ import org.testng.annotations.Test; * Test OffsetDateTime. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestOffsetDateTime extends AbstractDateTimeTest { private static final ZoneId ZONE_PARIS = ZoneId.of("Europe/Paris"); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTimeInstants.java b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTimeInstants.java index 8e474c6dd..6f36c8215 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTimeInstants.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetDateTimeInstants.java @@ -56,12 +56,17 @@ import java.time.Month; import java.time.OffsetDateTime; import java.time.Year; import java.time.ZoneOffset; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test OffsetDateTime creation. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestOffsetDateTimeInstants { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java index 317f2e2ce..ce5d582b0 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestOffsetTime.java @@ -94,6 +94,9 @@ import java.time.temporal.TemporalQueries; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -102,6 +105,8 @@ import org.testng.annotations.Test; * Test OffsetTime. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestOffsetTime extends AbstractDateTimeTest { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestPeriod.java b/tests/src/test/java/org/teavm/classlib/java/time/TestPeriod.java index 8873fb450..b613424b4 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestPeriod.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestPeriod.java @@ -51,6 +51,9 @@ import static org.testng.Assert.assertSame; import java.time.LocalDate; import java.time.Period; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -58,6 +61,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestPeriod extends AbstractTest { //----------------------------------------------------------------------- // factories diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestZoneId.java b/tests/src/test/java/org/teavm/classlib/java/time/TestZoneId.java index 9eb6e952a..4d5d3f577 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestZoneId.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestZoneId.java @@ -65,6 +65,9 @@ import java.util.Map; import java.util.SimpleTimeZone; import java.util.TimeZone; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.time.format.TextStyle; @@ -77,6 +80,8 @@ import java.time.zone.ZoneRulesException; * Test ZoneId. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestZoneId extends AbstractTest { private static final ZoneId ZONE_PARIS = ZoneId.of("Europe/Paris"); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestZoneOffset.java b/tests/src/test/java/org/teavm/classlib/java/time/TestZoneOffset.java index 7d150cb5c..fd902e470 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestZoneOffset.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestZoneOffset.java @@ -68,12 +68,17 @@ import java.time.temporal.TemporalQueries; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test ZoneOffset. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestZoneOffset extends AbstractDateTimeTest { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/TestZonedDateTime.java b/tests/src/test/java/org/teavm/classlib/java/time/TestZonedDateTime.java index 868ba12b1..39e8dc38f 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/TestZonedDateTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/TestZonedDateTime.java @@ -110,7 +110,10 @@ import java.time.temporal.TemporalQuery; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.temporal.MockFieldNoValue; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -119,6 +122,8 @@ import org.testng.annotations.Test; * Test ZonedDateTime. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestZonedDateTime extends AbstractDateTimeTest { private static final ZoneOffset OFFSET_0100 = ZoneOffset.ofHours(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoLocalDate.java b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoLocalDate.java index 22c4d1ad3..443a6c4a1 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoLocalDate.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoLocalDate.java @@ -70,6 +70,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -78,6 +81,8 @@ import org.testng.annotations.Test; * Test assertions that must be true for all built-in chronologies. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestChronoLocalDate { //----------------------------------------------------------------------- // regular data factory for names and descriptions of available calendars diff --git a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoLocalDateTime.java b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoLocalDateTime.java index 427d74d0e..4d3d9e30a 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoLocalDateTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoLocalDateTime.java @@ -71,6 +71,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -78,8 +81,9 @@ import org.testng.annotations.Test; /** * Test assertions that must be true for all built-in chronologies. */ -@SuppressWarnings("rawtypes") @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestChronoLocalDateTime { //----------------------------------------------------------------------- // regular data factory for names and descriptions of available calendars @@ -98,7 +102,7 @@ public class TestChronoLocalDateTime { @Test(dataProvider = "calendars") public void test_badWithAdjusterChrono(Chronology chrono) { LocalDate refDate = LocalDate.of(1900, 1, 1); - ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); + ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); for (Object[] clist : data_of_calendars()) { Chronology chrono2 = (Chronology) clist[0]; ChronoLocalDateTime cdt2 = chrono2.date(refDate).atTime(LocalTime.NOON); @@ -122,7 +126,7 @@ public class TestChronoLocalDateTime { @Test(dataProvider = "calendars") public void test_badPlusAdjusterChrono(Chronology chrono) { LocalDate refDate = LocalDate.of(1900, 1, 1); - ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); + ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); for (Object[] clist : data_of_calendars()) { Chronology chrono2 = (Chronology) clist[0]; ChronoLocalDateTime cdt2 = chrono2.date(refDate).atTime(LocalTime.NOON); @@ -146,7 +150,7 @@ public class TestChronoLocalDateTime { @Test(dataProvider = "calendars") public void test_badMinusAdjusterChrono(Chronology chrono) { LocalDate refDate = LocalDate.of(1900, 1, 1); - ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); + ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); for (Object[] clist : data_of_calendars()) { Chronology chrono2 = (Chronology) clist[0]; ChronoLocalDateTime cdt2 = chrono2.date(refDate).atTime(LocalTime.NOON); @@ -170,7 +174,7 @@ public class TestChronoLocalDateTime { @Test(dataProvider = "calendars") public void test_badPlusPeriodUnitChrono(Chronology chrono) { LocalDate refDate = LocalDate.of(1900, 1, 1); - ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); + ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); for (Object[] clist : data_of_calendars()) { Chronology chrono2 = (Chronology) clist[0]; ChronoLocalDateTime cdt2 = chrono2.date(refDate).atTime(LocalTime.NOON); @@ -194,7 +198,7 @@ public class TestChronoLocalDateTime { @Test(dataProvider = "calendars") public void test_badMinusPeriodUnitChrono(Chronology chrono) { LocalDate refDate = LocalDate.of(1900, 1, 1); - ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); + ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); for (Object[] clist : data_of_calendars()) { Chronology chrono2 = (Chronology) clist[0]; ChronoLocalDateTime cdt2 = chrono2.date(refDate).atTime(LocalTime.NOON); @@ -218,7 +222,7 @@ public class TestChronoLocalDateTime { @Test(dataProvider = "calendars") public void test_badDateTimeFieldChrono(Chronology chrono) { LocalDate refDate = LocalDate.of(1900, 1, 1); - ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); + ChronoLocalDateTime cdt = chrono.date(refDate).atTime(LocalTime.NOON); for (Object[] clist : data_of_calendars()) { Chronology chrono2 = (Chronology) clist[0]; ChronoLocalDateTime cdt2 = chrono2.date(refDate).atTime(LocalTime.NOON); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoZonedDateTime.java b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoZonedDateTime.java index 3fd9a5665..7fd5ef54c 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoZonedDateTime.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronoZonedDateTime.java @@ -72,6 +72,9 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; import java.util.Map; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -80,6 +83,8 @@ import org.testng.annotations.Test; * Test assertions that must be true for all built-in chronologies. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestChronoZonedDateTime { //----------------------------------------------------------------------- // regular data factory for names and descriptions of available calendars diff --git a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronology.java b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronology.java index 81bcdc4bf..7d65574ba 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronology.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestChronology.java @@ -59,6 +59,9 @@ import java.time.chrono.ThaiBuddhistChronology; import java.time.temporal.ChronoField; import java.util.Locale; import java.util.Set; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.Assert; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; @@ -68,6 +71,8 @@ import org.testng.annotations.Test; * Test Chrono class. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestChronology { @BeforeMethod diff --git a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestHijrahChronology.java b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestHijrahChronology.java index 1e4da0029..79c2c2f33 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestHijrahChronology.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestHijrahChronology.java @@ -62,6 +62,9 @@ import java.time.chrono.HijrahChronology; import java.time.chrono.HijrahDate; import java.time.chrono.IsoChronology; import java.time.temporal.TemporalAdjusters; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -70,6 +73,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestHijrahChronology { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestIsoChronology.java b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestIsoChronology.java index 3ad41e5b9..daaccab1d 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestIsoChronology.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestIsoChronology.java @@ -66,6 +66,9 @@ import java.time.chrono.IsoChronology; import java.time.chrono.IsoEra; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAdjusters; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -74,6 +77,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestIsoChronology { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestJapaneseChronology.java b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestJapaneseChronology.java index a550dd264..0c1842ba0 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestJapaneseChronology.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestJapaneseChronology.java @@ -62,6 +62,9 @@ import java.time.chrono.JapaneseChronology; import java.time.chrono.JapaneseEra; import java.time.temporal.TemporalAdjusters; import java.util.List; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -70,6 +73,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestJapaneseChronology { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestMinguoChronology.java b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestMinguoChronology.java index ec5a2f386..c15e82c26 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestMinguoChronology.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestMinguoChronology.java @@ -64,6 +64,9 @@ import java.time.chrono.MinguoChronology; import java.time.chrono.MinguoEra; import java.time.temporal.ChronoUnit; import java.time.temporal.TemporalAdjusters; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -72,6 +75,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestMinguoChronology { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestThaiBuddhistChronology.java b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestThaiBuddhistChronology.java index cd026ae8e..1f34d4b5c 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestThaiBuddhistChronology.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/chrono/TestThaiBuddhistChronology.java @@ -66,6 +66,9 @@ import java.time.chrono.ThaiBuddhistEra; import java.time.temporal.ChronoField; import java.time.temporal.TemporalAdjusters; import java.time.temporal.ValueRange; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.Assert; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -74,6 +77,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestThaiBuddhistChronology { private static final int YDIFF = 543; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatter.java b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatter.java index fca66f925..be46f82b7 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatter.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatter.java @@ -68,6 +68,9 @@ import java.time.format.SignStyle; import java.time.temporal.TemporalAccessor; import java.time.temporal.TemporalQuery; import java.util.Locale; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; @@ -75,6 +78,8 @@ import org.testng.annotations.Test; * Test DateTimeFormatter. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestDateTimeFormatter { private static final DateTimeFormatter BASIC_FORMATTER = DateTimeFormatter.ofPattern("'ONE'd"); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatterBuilder.java b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatterBuilder.java index 3e5dc51ac..db35c1249 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatterBuilder.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatterBuilder.java @@ -60,6 +60,9 @@ import java.time.format.TextStyle; import java.time.temporal.TemporalAccessor; import java.util.HashMap; import java.util.Map; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -68,6 +71,8 @@ import org.testng.annotations.Test; * Test DateTimeFormatterBuilder. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestDateTimeFormatterBuilder { private DateTimeFormatterBuilder builder; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatters.java b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatters.java index c2041502e..e112c466d 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatters.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeFormatters.java @@ -80,6 +80,9 @@ import java.util.HashMap; import java.util.Iterator; import java.util.Locale; import java.util.Map; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -88,6 +91,8 @@ import org.testng.annotations.Test; * Test DateTimeFormatters. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestDateTimeFormatters { @BeforeMethod diff --git a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeParsing.java b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeParsing.java index 82561a955..f90da9bd6 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeParsing.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeParsing.java @@ -65,6 +65,9 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.temporal.TemporalAccessor; import java.util.Locale; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -72,6 +75,8 @@ import org.testng.annotations.Test; * Test parsing of edge cases. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestDateTimeParsing { private static final ZoneId PARIS = ZoneId.of("Europe/Paris"); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeTextPrinting.java b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeTextPrinting.java index efae2285d..54a6e4b6a 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeTextPrinting.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDateTimeTextPrinting.java @@ -59,6 +59,9 @@ import java.time.temporal.TemporalField; import java.util.HashMap; import java.util.Locale; import java.util.Map; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -67,6 +70,8 @@ import org.testng.annotations.Test; * Test text printing. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestDateTimeTextPrinting { private DateTimeFormatterBuilder builder; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDecimalStyle.java b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDecimalStyle.java index b9a95cb93..a1c441172 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/format/TestDecimalStyle.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/format/TestDecimalStyle.java @@ -52,12 +52,17 @@ import java.time.format.DecimalStyle; import java.util.Locale; import java.util.Set; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test DecimalStyle. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestDecimalStyle { @Test diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoField.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoField.java index 4b080d08b..fe41a5ee8 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoField.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoField.java @@ -44,16 +44,22 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.threeten.bp.temporal; +package org.teavm.classlib.java.time.temporal; import static org.testng.Assert.assertEquals; +import java.time.temporal.ChronoField; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestChronoField { //------------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoUnit.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoUnit.java index 0c3bd039d..078017867 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoUnit.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestChronoUnit.java @@ -63,6 +63,9 @@ import java.time.LocalDate; import java.time.Month; import java.time.ZoneOffset; import java.time.temporal.ChronoUnit; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -70,6 +73,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestChronoUnit { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestIsoFields.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestIsoFields.java index 8542d666e..400954d87 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestIsoFields.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestIsoFields.java @@ -62,6 +62,9 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; import java.time.temporal.IsoFields; import java.time.temporal.ValueRange; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -69,6 +72,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestIsoFields { public void test_enum() { diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestJulianFields.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestJulianFields.java index 111e82bd6..934d91a5e 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestJulianFields.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestJulianFields.java @@ -52,6 +52,9 @@ import java.time.LocalDate; import java.time.temporal.ChronoField; import java.time.temporal.JulianFields; import java.time.temporal.TemporalField; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -60,6 +63,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestJulianFields { private static final LocalDate JAN01_1970 = LocalDate.of(1970, 1, 1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestMonthDay.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestMonthDay.java index b1d44d4d8..3ac75c69a 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestMonthDay.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestMonthDay.java @@ -75,7 +75,10 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.AbstractDateTimeTest; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -84,6 +87,8 @@ import org.testng.annotations.Test; * Test MonthDay. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestMonthDay extends AbstractDateTimeTest { private MonthDay test07x15; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestTemporalAdjusters.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestTemporalAdjusters.java index ef0f66b88..ed9a26768 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestTemporalAdjusters.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestTemporalAdjusters.java @@ -59,6 +59,9 @@ import java.time.DayOfWeek; import java.time.LocalDate; import java.time.Month; import java.time.temporal.TemporalAdjusters; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -66,6 +69,8 @@ import org.testng.annotations.Test; * Test DateTimeAdjusters. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestTemporalAdjusters { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestValueRange.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestValueRange.java index 6ac3a2ec7..bb4513d14 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestValueRange.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestValueRange.java @@ -49,7 +49,10 @@ package org.teavm.classlib.java.time.temporal; import static org.testng.Assert.assertEquals; import java.time.temporal.ValueRange; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.AbstractTest; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -57,6 +60,8 @@ import org.testng.annotations.Test; * Test. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestValueRange extends AbstractTest { //----------------------------------------------------------------------- diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYear.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYear.java index 0f98c92f8..fbca7750b 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYear.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYear.java @@ -76,7 +76,10 @@ import java.time.temporal.TemporalQueries; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.AbstractDateTimeTest; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -85,6 +88,8 @@ import org.testng.annotations.Test; * Test Year. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestYear extends AbstractDateTimeTest { private static final Year TEST_2008 = Year.of(2008); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYearMonth.java b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYearMonth.java index 80aeaf937..4615473f1 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYearMonth.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/temporal/TestYearMonth.java @@ -79,7 +79,10 @@ import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.AbstractDateTimeTest; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -88,6 +91,8 @@ import org.testng.annotations.Test; * Test YearMonth. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestYearMonth extends AbstractDateTimeTest { private YearMonth test2008x06; diff --git a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestFixedZoneRules.java b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestFixedZoneRules.java index 8002b3f20..3a15f943c 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestFixedZoneRules.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestFixedZoneRules.java @@ -62,6 +62,9 @@ import java.time.ZoneOffset; import java.time.zone.ZoneOffsetTransition; import java.time.zone.ZoneOffsetTransitionRule; import java.time.zone.ZoneRules; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -69,6 +72,8 @@ import org.testng.annotations.Test; * Test ZoneRules for fixed offset time-zones. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestFixedZoneRules { private static final ZoneOffset OFFSET_PONE = ZoneOffset.ofHours(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestStandardZoneRules.java b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestStandardZoneRules.java index f2ba93793..f497ecf33 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestStandardZoneRules.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestStandardZoneRules.java @@ -44,42 +44,44 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.threeten.bp.zone; +package org.teavm.classlib.java.time.zone; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertFalse; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertNull; import static org.testng.Assert.assertTrue; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; +import java.time.DayOfWeek; +import java.time.Duration; +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.Month; +import java.time.Year; +import java.time.ZoneId; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeFormatterBuilder; +import java.time.format.TextStyle; +import java.time.zone.ZoneOffsetTransition; +import java.time.zone.ZoneOffsetTransitionRule; +import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition; +import java.time.zone.ZoneRules; import java.util.Iterator; import java.util.List; - +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; -import org.threeten.bp.DayOfWeek; -import org.threeten.bp.Duration; -import org.threeten.bp.Instant; -import org.threeten.bp.LocalDate; -import org.threeten.bp.LocalDateTime; -import org.threeten.bp.LocalTime; -import org.threeten.bp.Month; -import org.threeten.bp.Year; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZoneOffset; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.format.DateTimeFormatterBuilder; -import org.threeten.bp.format.TextStyle; -import org.threeten.bp.zone.ZoneOffsetTransitionRule.TimeDefinition; /** * Test ZoneRules. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestStandardZoneRules { private static final ZoneOffset OFFSET_ZERO = ZoneOffset.ofHours(0); @@ -88,29 +90,6 @@ public class TestStandardZoneRules { public static final String LATEST_TZDB = "2009b"; private static final int OVERLAP = 2; private static final int GAP = 0; - - //----------------------------------------------------------------------- - // Basics - //----------------------------------------------------------------------- - public void test_serialization_loaded() throws Exception { - assertSerialization(europeLondon()); - assertSerialization(europeParis()); - assertSerialization(americaNewYork()); - } - - private void assertSerialization(ZoneRules test) throws Exception { - ByteArrayOutputStream baos = new ByteArrayOutputStream(); - ObjectOutputStream out = new ObjectOutputStream(baos); - out.writeObject(test); - baos.close(); - byte[] bytes = baos.toByteArray(); - - ByteArrayInputStream bais = new ByteArrayInputStream(bytes); - ObjectInputStream in = new ObjectInputStream(bais); - ZoneRules result = (ZoneRules) in.readObject(); - - assertEquals(result, test); - } //----------------------------------------------------------------------- // Etc/GMT @@ -663,7 +642,8 @@ public class TestStandardZoneRules { assertEquals(test.getOffset(instant), OFFSET_PONE, zdt.toString()); } else { assertEquals(test.getStandardOffset(instant), OFFSET_ZERO, zdt.toString()); - assertEquals(test.getOffset(instant), zdt.getMonth() == Month.JANUARY ? OFFSET_ZERO : OFFSET_PONE, zdt.toString()); + assertEquals(test.getOffset(instant), zdt.getMonth() == Month.JANUARY ? OFFSET_ZERO : OFFSET_PONE, + zdt.toString()); } zdt = zdt.plusMonths(6); } @@ -1106,13 +1086,13 @@ public class TestStandardZoneRules { } //------------------------------------------------------------------------- - @Test(expectedExceptions=UnsupportedOperationException.class) + @Test(expectedExceptions = UnsupportedOperationException.class) public void test_getTransitions_immutable() { ZoneRules test = europeParis(); test.getTransitions().clear(); } - @Test(expectedExceptions=UnsupportedOperationException.class) + @Test(expectedExceptions = UnsupportedOperationException.class) public void test_getTransitionRules_immutable() { ZoneRules test = europeParis(); test.getTransitionRules().clear(); @@ -1160,7 +1140,8 @@ public class TestStandardZoneRules { return LocalDateTime.of(year, month, day, hour, min).toInstant(offset); } - private Instant createInstant(int year, int month, int day, int hour, int min, int sec, int nano, ZoneOffset offset) { + private Instant createInstant(int year, int month, int day, int hour, int min, int sec, int nano, + ZoneOffset offset) { return LocalDateTime.of(year, month, day, hour, min, sec, nano).toInstant(offset); } diff --git a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneOffsetTransition.java b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneOffsetTransition.java index 4ab84da3c..8f2f81a4c 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneOffsetTransition.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneOffsetTransition.java @@ -54,13 +54,18 @@ import java.time.LocalDateTime; import java.time.Year; import java.time.ZoneOffset; import java.time.zone.ZoneOffsetTransition; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.AbstractTest; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test ZoneOffsetTransition. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestZoneOffsetTransition extends AbstractTest { private static final ZoneOffset OFFSET_0100 = ZoneOffset.ofHours(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneOffsetTransitionRule.java b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneOffsetTransitionRule.java index 6cd256eb8..bebbf3fce 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneOffsetTransitionRule.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneOffsetTransitionRule.java @@ -56,13 +56,18 @@ import java.time.ZoneOffset; import java.time.zone.ZoneOffsetTransition; import java.time.zone.ZoneOffsetTransitionRule; import java.time.zone.ZoneOffsetTransitionRule.TimeDefinition; +import org.junit.runner.RunWith; import org.teavm.classlib.java.time.AbstractTest; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; /** * Test ZoneOffsetTransitionRule. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestZoneOffsetTransitionRule extends AbstractTest { private static final LocalTime TIME_0100 = LocalTime.of(1, 0); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneRulesBuilder.java b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneRulesBuilder.java index b2c27f8f0..344fca722 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneRulesBuilder.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneRulesBuilder.java @@ -68,6 +68,9 @@ import static org.threeten.bp.zone.ZoneOffsetTransitionRule.TimeDefinition.WALL; import java.util.List; +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; import org.threeten.bp.DateTimeException; import org.threeten.bp.LocalDateTime; @@ -81,6 +84,8 @@ import org.threeten.bp.zone.ZoneOffsetTransitionRule.TimeDefinition; * Test ZoneRulesBuilder. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestZoneRulesBuilder { private static final ZoneOffset OFFSET_1 = ZoneOffset.ofHours(1); diff --git a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneRulesProvider.java b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneRulesProvider.java index 544f18a86..43cb8e19f 100644 --- a/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneRulesProvider.java +++ b/tests/src/test/java/org/teavm/classlib/java/time/zone/TestZoneRulesProvider.java @@ -44,26 +44,32 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package org.threeten.bp.zone; +package org.teavm.classlib.java.time.zone; import static org.testng.Assert.assertEquals; import static org.testng.Assert.assertNotNull; import static org.testng.Assert.assertTrue; import static org.testng.Assert.fail; - +import java.time.ZoneOffset; +import java.time.zone.ZoneRules; +import java.time.zone.ZoneRulesException; +import java.time.zone.ZoneRulesProvider; import java.util.Collections; import java.util.HashSet; import java.util.NavigableMap; import java.util.Set; import java.util.TreeMap; - +import org.junit.runner.RunWith; +import org.teavm.junit.TeaVMTestRunner; +import org.teavm.junit.WholeClassCompilation; import org.testng.annotations.Test; -import org.threeten.bp.ZoneOffset; /** * Test ZoneRulesProvider. */ @Test +@RunWith(TeaVMTestRunner.class) +@WholeClassCompilation public class TestZoneRulesProvider { //----------------------------------------------------------------------- @@ -94,12 +100,12 @@ public class TestZoneRulesProvider { assertEquals(rules2, rules); } - @Test(expectedExceptions=ZoneRulesException.class) + @Test(expectedExceptions = ZoneRulesException.class) public void test_getRules_String_unknownId() { ZoneRulesProvider.getRules("Europe/Lon", false); } - @Test(expectedExceptions=NullPointerException.class) + @Test(expectedExceptions = NullPointerException.class) public void test_getRules_String_null() { ZoneRulesProvider.getRules(null, false); } @@ -114,19 +120,19 @@ public class TestZoneRulesProvider { ZoneRules rules = ZoneRulesProvider.getRules("Europe/London", false); assertEquals(versions.lastEntry().getValue(), rules); - NavigableMap copy = new TreeMap(versions); + NavigableMap copy = new TreeMap<>(versions); versions.clear(); assertEquals(versions.size(), 0); NavigableMap versions2 = ZoneRulesProvider.getVersions("Europe/London"); assertEquals(versions2, copy); } - @Test(expectedExceptions=ZoneRulesException.class) + @Test(expectedExceptions = ZoneRulesException.class) public void test_getVersions_String_unknownId() { ZoneRulesProvider.getVersions("Europe/Lon"); } - @Test(expectedExceptions=NullPointerException.class) + @Test(expectedExceptions = NullPointerException.class) public void test_getVersions_String_null() { ZoneRulesProvider.getVersions(null); }