Skip to content

Commit

Permalink
more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
robfrank committed Oct 23, 2024
1 parent d406295 commit 68ba3e7
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions engine/src/test/java/com/arcadedb/TypeConversionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import com.arcadedb.utility.DateUtils;
import com.arcadedb.utility.NanoClock;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledOnOs;
import org.junit.jupiter.api.condition.OS;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
Expand Down Expand Up @@ -360,8 +362,7 @@ public void testZonedDateTime() throws ClassNotFoundException {
});

doc.reload();
assertThat(
zonedDateTime.truncatedTo(ChronoUnit.SECONDS).isEqual((ChronoZonedDateTime<?>) doc.get("datetime_second"))).isTrue();
assertThat(doc.getZonedDateTime("datetime_second")).isEqualTo(zonedDateTime.truncatedTo(ChronoUnit.SECONDS));

database.transaction(() -> {
// TEST MILLISECONDS PRECISION
Expand All @@ -370,8 +371,8 @@ public void testZonedDateTime() throws ClassNotFoundException {
});

doc.reload();
assertThat(
zonedDateTime.truncatedTo(ChronoUnit.MILLIS).isEqual((ChronoZonedDateTime<?>) doc.get("datetime_millis"))).isTrue();

assertThat(doc.getZonedDateTime("datetime_millis")).isEqualTo(zonedDateTime.truncatedTo(ChronoUnit.MILLIS));

if (!System.getProperty("os.name").startsWith("Windows")) {
// NOTE: ON WINDOWS MICROSECONDS ARE NOT HANDLED CORRECTLY
Expand All @@ -383,8 +384,7 @@ public void testZonedDateTime() throws ClassNotFoundException {
});

doc.reload();
assertThat(
zonedDateTime.truncatedTo(ChronoUnit.MICROS).isEqual((ChronoZonedDateTime<?>) doc.get("datetime_micros"))).isTrue();
assertThat(doc.getZonedDateTime("datetime_micros")).isEqualTo(zonedDateTime.truncatedTo(ChronoUnit.MICROS));
}

// TEST NANOSECOND PRECISION
Expand Down Expand Up @@ -475,10 +475,8 @@ public void testConversion() {
}

@Test
@DisabledOnOs(OS.WINDOWS)
public void testSQLMath() {
if (System.getProperty("os.name").startsWith("Windows"))
// NOTE: ON WINDOWS MICROSECONDS ARE NOT HANDLED CORRECTLY
return;

database.command("sql", "alter database dateTimeImplementation `java.time.LocalDateTime`");
try {
Expand Down

0 comments on commit 68ba3e7

Please sign in to comment.