From 21dbe898f1659fba231773f98dfd22ec506410f3 Mon Sep 17 00:00:00 2001 From: Naman Jain <54635559+njain2208@users.noreply.github.com> Date: Wed, 29 Nov 2023 16:26:40 -0600 Subject: [PATCH] flaky fixes in the project --- .../morpheus/array/ArrayBuilderTests.java | 21 ++++++++++++----- .../morpheus/array/ArrayMappedTests.java | 5 ++-- .../morpheus/array/ArraysBasicTests.java | 23 +++++++++++-------- 3 files changed, 31 insertions(+), 18 deletions(-) diff --git a/src/test/java/com/zavtech/morpheus/array/ArrayBuilderTests.java b/src/test/java/com/zavtech/morpheus/array/ArrayBuilderTests.java index 09e577d..6308fab 100644 --- a/src/test/java/com/zavtech/morpheus/array/ArrayBuilderTests.java +++ b/src/test/java/com/zavtech/morpheus/array/ArrayBuilderTests.java @@ -21,6 +21,7 @@ import java.time.Month; import java.time.ZoneId; import java.time.ZonedDateTime; +import java.time.temporal.ChronoUnit; import java.util.Calendar; import java.util.Currency; import java.util.Date; @@ -349,11 +350,11 @@ public void testWithLocalDateTimes(int initialSize) { Assert.assertEquals(actual.length(), expected.length, "The lengths match"); Assert.assertEquals(actual.typeCode(), ArrayType.LOCAL_DATETIME, "The array type is as expected"); for (int i=0; i collected = Stream.of(expected).collect(ArrayUtils.toArray(expected.length)); for (int i=0; i collected = Stream.of(expected).collect(ArrayUtils.toArray(expected.length)); for (int i=0; i collected = Stream.of(expected).collect(ArrayUtils.toArray(expected.length)); for (int i=0; i void testFill(Class type, ArrayStyle style) { T value = (T)LocalDateTime.now(); array.fill(value); for (int i=0; i void testFirstAndLast(Class type, ArrayStyle style) { assertFirstAndLast(array, values, arrayType); } else if (arrayType == ArrayType.LOCAL_DATETIME) { final LocalDateTime[] values = new LocalDateTime[1000]; - for (int i=0; i array = Array.of((Class)type, values.length, null, style).applyValues(v -> values[v.index()]); assertFirstAndLast(array, values, arrayType); } else if (arrayType == ArrayType.ZONED_DATETIME) { final ZonedDateTime[] values = new ZonedDateTime[1000]; - for (int i=0; i array = Array.of((Class)type, values.length, null, style).applyValues(v -> values[v.index()]); assertFirstAndLast(array, values, arrayType); } else if (arrayType == ArrayType.OBJECT) {