From 1237aa97fc30cc06ced5de80604bb4bda11eb5fa Mon Sep 17 00:00:00 2001 From: kot Date: Mon, 7 Dec 2020 19:23:31 +0100 Subject: [PATCH] Move test to Browser --- .../threetenbp/gwt/client/TestLocalTime.java | 18 +++++++++++++++--- .../client/browser/BrowserTestLocalTime.java | 4 ++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/test/java/org/jresearch/threetenbp/gwt/client/TestLocalTime.java b/src/test/java/org/jresearch/threetenbp/gwt/client/TestLocalTime.java index 4db90bab7..5e89492c7 100644 --- a/src/test/java/org/jresearch/threetenbp/gwt/client/TestLocalTime.java +++ b/src/test/java/org/jresearch/threetenbp/gwt/client/TestLocalTime.java @@ -228,18 +228,18 @@ public void test_now_ZoneId_nullZoneId() { } @Test - public void test_now_ZoneId() { + public void disabled_test_now_ZoneId() { ZoneId zone = ZoneId.of("UTC+01:02:03"); LocalTime expected = LocalTime.now(Clock.system(zone)); LocalTime test = LocalTime.now(zone); - for (int i = 0; i < 100; i++) { + for (int i = 0; i < 1000; i++) { if (expected.equals(test)) { return; } expected = LocalTime.now(Clock.system(zone)); test = LocalTime.now(zone); } - assertEquals(test, expected); + assertEquals(expected, test); } // ----------------------------------------------------------------------- @@ -1607,10 +1607,12 @@ Iterator plusSeconds_fromZero() { int min = 59; int sec = 0; + @Override public boolean hasNext() { return i <= 3660; } + @Override public Object[] next() { final Object[] ret = new Object[] { i, hour, min, sec }; i += delta; @@ -1633,6 +1635,7 @@ public Object[] next() { return ret; } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -1724,10 +1727,12 @@ Iterator plusNanos_fromZero() { int sec = 0; long nanos = 0; + @Override public boolean hasNext() { return i <= 3660 * 1000000000L; } + @Override public Object[] next() { final Object[] ret = new Object[] { i, hour, min, sec, (int) nanos }; i += delta; @@ -1755,6 +1760,7 @@ public Object[] next() { return ret; } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -2100,10 +2106,12 @@ Iterator minusSeconds_fromZero() { int min = 59; int sec = 0; + @Override public boolean hasNext() { return i >= -3660; } + @Override public Object[] next() { final Object[] ret = new Object[] { i, hour, min, sec }; i -= delta; @@ -2126,6 +2134,7 @@ public Object[] next() { return ret; } + @Override public void remove() { throw new UnsupportedOperationException(); } @@ -2232,10 +2241,12 @@ Iterator minusNanos_fromZero() { int sec = 0; long nanos = 0; + @Override public boolean hasNext() { return i >= -3660 * 1000000000L; } + @Override public Object[] next() { final Object[] ret = new Object[] { i, hour, min, sec, (int) nanos }; i -= delta; @@ -2263,6 +2274,7 @@ public Object[] next() { return ret; } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/src/test/java/org/jresearch/threetenbp/gwt/client/browser/BrowserTestLocalTime.java b/src/test/java/org/jresearch/threetenbp/gwt/client/browser/BrowserTestLocalTime.java index 6eec64ddf..b81668524 100644 --- a/src/test/java/org/jresearch/threetenbp/gwt/client/browser/BrowserTestLocalTime.java +++ b/src/test/java/org/jresearch/threetenbp/gwt/client/browser/BrowserTestLocalTime.java @@ -20,4 +20,8 @@ public void test_toNanoOfDay_fromNanoOfDay_symmetry() { super.long_test_toNanoOfDay_fromNanoOfDay_symmetry(); } + public void test_now_ZoneId() { + super.disabled_test_now_ZoneId(); + } + }