Skip to content

Commit

Permalink
Enable UTC tests for Bolt 5.0 (#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
injectives authored Sep 8, 2022
1 parent bd0a8fc commit 9f34a7c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@
import org.neo4j.driver.Record;
import org.neo4j.driver.Result;
import org.neo4j.driver.Value;
import org.neo4j.driver.internal.util.DisabledOnNeo4jWith;
import org.neo4j.driver.internal.util.EnabledOnNeo4jWith;
import org.neo4j.driver.internal.util.Neo4jFeature;
import org.neo4j.driver.testutil.ParallelizableIT;
import org.neo4j.driver.testutil.SessionExtension;
import org.neo4j.driver.testutil.TemporalUtil;
Expand Down Expand Up @@ -175,14 +173,12 @@ void shouldSendAndReceiveListsWithRandomLocalDateTimes() {
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendDateTimeWithZoneOffset() {
ZoneOffset offset = ZoneOffset.ofHoursMinutes(-4, -15);
testSendValue(ZonedDateTime.of(1845, 3, 25, 19, 15, 45, 22, offset), Value::asZonedDateTime);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldReceiveDateTimeWithZoneOffset() {
ZoneOffset offset = ZoneOffset.ofHoursMinutes(3, 30);
testReceiveValue(
Expand All @@ -192,32 +188,27 @@ void shouldReceiveDateTimeWithZoneOffset() {
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendAndReceiveDateTimeWithZoneOffset() {
ZoneOffset offset = ZoneOffset.ofHoursMinutes(-7, -15);
testSendAndReceiveValue(ZonedDateTime.of(2017, 3, 9, 11, 12, 13, 14, offset), Value::asZonedDateTime);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendAndReceiveRandomDateTimeWithZoneOffset() {
testSendAndReceiveRandomValues(TemporalUtil::randomZonedDateTimeWithOffset, Value::asZonedDateTime);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendAndReceiveListsWithRandomDateTimeWithZoneOffsets() {
testSendAndReceiveRandomLists(TemporalUtil::randomZonedDateTimeWithOffset);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendDateTimeRepresentedWithOffsetDateTime() {
testSendValue(OffsetDateTime.of(1851, 9, 29, 1, 29, 42, 987, ZoneOffset.ofHours(-8)), Value::asOffsetDateTime);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldReceiveDateTimeRepresentedWithOffsetDateTime() {
testReceiveValue(
"RETURN datetime({year:2121, month:1, day:1, hour:2, minute:2, second:2, timezone:'-07:20'})",
Expand All @@ -226,34 +217,29 @@ void shouldReceiveDateTimeRepresentedWithOffsetDateTime() {
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendAndReceiveDateTimeRepresentedWithOffsetDateTime() {
testSendAndReceiveValue(
OffsetDateTime.of(1998, 12, 12, 23, 54, 14, 123, ZoneOffset.ofHoursMinutes(1, 15)),
Value::asOffsetDateTime);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendAndReceiveRandomDateTimeRepresentedWithOffsetDateTime() {
testSendAndReceiveRandomValues(TemporalUtil::randomOffsetDateTime, Value::asOffsetDateTime);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendAndReceiveListsWithRandomDateTimeRepresentedWithOffsetDateTimes() {
testSendAndReceiveRandomLists(TemporalUtil::randomOffsetDateTime, value -> value.asList(ofOffsetDateTime()));
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendDateTimeWithZoneId() {
ZoneId zoneId = ZoneId.of("Europe/Stockholm");
testSendValue(ZonedDateTime.of(2049, 9, 11, 19, 10, 40, 20, zoneId), Value::asZonedDateTime);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldReceiveDateTimeWithZoneId() {
ZoneId zoneId = ZoneId.of("Europe/London");
testReceiveValue(
Expand All @@ -263,20 +249,17 @@ void shouldReceiveDateTimeWithZoneId() {
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendAndReceiveDateTimeWithZoneId() {
ZoneId zoneId = ZoneId.of("Europe/Stockholm");
testSendAndReceiveValue(ZonedDateTime.of(2099, 12, 29, 12, 59, 59, 59, zoneId), Value::asZonedDateTime);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendAndReceiveRandomDateTimeWithZoneId() {
testSendAndReceiveRandomValues(TemporalUtil::randomZonedDateTimeWithZoneId, Value::asZonedDateTime);
}

@Test
@DisabledOnNeo4jWith(Neo4jFeature.BOLT_V5)
void shouldSendAndReceiveListsWithRandomDateTimeWithZoneIds() {
testSendAndReceiveRandomLists(TemporalUtil::randomZonedDateTimeWithZoneId);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively;
import static org.junit.jupiter.api.Assertions.fail;
import static org.neo4j.driver.internal.util.Neo4jFeature.BOLT_V3;
import static org.neo4j.driver.internal.util.Neo4jFeature.BOLT_V5;
import static org.neo4j.driver.testutil.TestUtil.TX_TIMEOUT_TEST_TIMEOUT;
import static org.neo4j.driver.testutil.TestUtil.await;

Expand All @@ -47,7 +46,6 @@
import org.neo4j.driver.async.ResultCursor;
import org.neo4j.driver.exceptions.ClientException;
import org.neo4j.driver.exceptions.TransientException;
import org.neo4j.driver.internal.util.DisabledOnNeo4jWith;
import org.neo4j.driver.internal.util.EnabledOnNeo4jWith;
import org.neo4j.driver.testutil.DriverExtension;
import org.neo4j.driver.testutil.ParallelizableIT;
Expand Down Expand Up @@ -85,7 +83,6 @@ void shouldSetTransactionMetadata() {
}

@Test
@DisabledOnNeo4jWith(BOLT_V5)
void shouldSetTransactionMetadataAsync() {
Map<String, Object> metadata = new HashMap<>();
metadata.put("hello", "world");
Expand Down

0 comments on commit 9f34a7c

Please sign in to comment.