Skip to content

Commit 5795167

Browse files
committed
Add flag for CausalClusteringStressIT
1 parent eb31983 commit 5795167

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

driver/src/test/java/org/neo4j/driver/stress/AbstractStressTestBase.java

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,17 @@
3232
import static org.junit.jupiter.api.Assertions.assertTrue;
3333
import static org.junit.jupiter.api.Assumptions.assumeTrue;
3434
import static org.neo4j.driver.SessionConfig.builder;
35+
import static org.neo4j.driver.Values.point;
3536

3637
import java.lang.management.ManagementFactory;
3738
import java.lang.management.OperatingSystemMXBean;
3839
import java.lang.reflect.Method;
3940
import java.net.URI;
41+
import java.time.Duration;
42+
import java.time.LocalDate;
43+
import java.time.LocalDateTime;
44+
import java.time.LocalTime;
45+
import java.time.ZonedDateTime;
4046
import java.util.ArrayList;
4147
import java.util.Collections;
4248
import java.util.HashMap;
@@ -75,12 +81,14 @@
7581
import org.neo4j.driver.async.AsyncTransaction;
7682
import org.neo4j.driver.async.ResultCursor;
7783
import org.neo4j.driver.internal.InternalDriver;
84+
import org.neo4j.driver.internal.InternalIsoDuration;
7885
import org.neo4j.driver.internal.logging.DevNullLogger;
7986
import org.neo4j.driver.internal.util.Futures;
8087
import org.neo4j.driver.internal.util.Iterables;
8188
import org.neo4j.driver.reactive.RxSession;
8289
import org.neo4j.driver.reactive.RxTransaction;
8390
import org.neo4j.driver.types.Node;
91+
import org.neo4j.driver.types.Point;
8492
import org.neo4j.driver.util.DaemonThreadFactory;
8593
import org.reactivestreams.Publisher;
8694
import reactor.core.publisher.Flux;
@@ -90,10 +98,18 @@ abstract class AbstractStressTestBase<C extends AbstractContext> {
9098
private static final int ASYNC_BATCH_SIZE = Integer.getInteger("asyncBatchSize", 10);
9199
private static final int EXECUTION_TIME_SECONDS = Integer.getInteger("executionTimeSeconds", 20);
92100
private static final boolean DEBUG_LOGGING_ENABLED = Boolean.getBoolean("loggingEnabled");
101+
private static final boolean EXTENDED_TYPES_ENABLED = Boolean.getBoolean("extendedTypesEnabled");
93102

94103
private static final int BIG_DATA_TEST_NODE_COUNT = Integer.getInteger("bigDataTestNodeCount", 30_000);
95104
private static final int BIG_DATA_TEST_BATCH_SIZE = Integer.getInteger("bigDataTestBatchSize", 10_000);
96105

106+
private static final Point POINT = point(9157, 3, 7, 12).asPoint();
107+
private static final LocalTime LOCAL_TIME = LocalTime.now();
108+
private static final LocalDateTime LOCAL_DATE_TIME = LocalDateTime.now();
109+
private static final LocalDate DATE = LOCAL_DATE_TIME.toLocalDate();
110+
private static final ZonedDateTime ZONED_DATE_TIME = ZonedDateTime.now();
111+
private static final Duration DURATION = Duration.ofHours(300);
112+
97113
private LoggerNameTrackingLogging logging;
98114
private ExecutorService executor;
99115

@@ -640,6 +656,16 @@ private static Map<String, Object> createNodeProperties(int nodeIndex) {
640656
result.put("long-indices", nCopies(10, (long) nodeIndex));
641657
result.put("double-indices", nCopies(10, (double) nodeIndex));
642658
result.put("booleans", nCopies(10, nodeIndex % 2 == 0));
659+
660+
if (EXTENDED_TYPES_ENABLED) {
661+
result.put("cartPoint", POINT);
662+
result.put("localDateTime", LOCAL_DATE_TIME);
663+
result.put("zonedDateTime", ZONED_DATE_TIME);
664+
result.put("localTime", LOCAL_TIME);
665+
result.put("date", DATE);
666+
result.put("duration", DURATION);
667+
}
668+
643669
return result;
644670
}
645671

@@ -650,6 +676,15 @@ private static void verifyNodeProperties(Node node) {
650676
assertEquals(nCopies(10, (long) nodeIndex), node.get("long-indices").asList());
651677
assertEquals(nCopies(10, (double) nodeIndex), node.get("double-indices").asList());
652678
assertEquals(nCopies(10, nodeIndex % 2 == 0), node.get("booleans").asList());
679+
680+
if (EXTENDED_TYPES_ENABLED) {
681+
assertEquals(POINT, node.get("cartPoint").asPoint());
682+
assertEquals(LOCAL_DATE_TIME, node.get("localDateTime").asLocalDateTime());
683+
assertEquals(ZONED_DATE_TIME, node.get("zonedDateTime").asZonedDateTime());
684+
assertEquals(LOCAL_TIME, node.get("localTime").asLocalTime());
685+
assertEquals(DATE, node.get("date").asLocalDate());
686+
assertEquals(new InternalIsoDuration(DURATION), node.get("duration").asIsoDuration());
687+
}
653688
}
654689

655690
private static <T> CompletionStage<T> safeCloseSession(AsyncSession session, T result) {

0 commit comments

Comments
 (0)