32
32
import static org .junit .jupiter .api .Assertions .assertTrue ;
33
33
import static org .junit .jupiter .api .Assumptions .assumeTrue ;
34
34
import static org .neo4j .driver .SessionConfig .builder ;
35
+ import static org .neo4j .driver .Values .point ;
35
36
36
37
import java .lang .management .ManagementFactory ;
37
38
import java .lang .management .OperatingSystemMXBean ;
38
39
import java .lang .reflect .Method ;
39
40
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 ;
40
46
import java .util .ArrayList ;
41
47
import java .util .Collections ;
42
48
import java .util .HashMap ;
75
81
import org .neo4j .driver .async .AsyncTransaction ;
76
82
import org .neo4j .driver .async .ResultCursor ;
77
83
import org .neo4j .driver .internal .InternalDriver ;
84
+ import org .neo4j .driver .internal .InternalIsoDuration ;
78
85
import org .neo4j .driver .internal .logging .DevNullLogger ;
79
86
import org .neo4j .driver .internal .util .Futures ;
80
87
import org .neo4j .driver .internal .util .Iterables ;
81
88
import org .neo4j .driver .reactive .RxSession ;
82
89
import org .neo4j .driver .reactive .RxTransaction ;
83
90
import org .neo4j .driver .types .Node ;
91
+ import org .neo4j .driver .types .Point ;
84
92
import org .neo4j .driver .util .DaemonThreadFactory ;
85
93
import org .reactivestreams .Publisher ;
86
94
import reactor .core .publisher .Flux ;
@@ -90,10 +98,18 @@ abstract class AbstractStressTestBase<C extends AbstractContext> {
90
98
private static final int ASYNC_BATCH_SIZE = Integer .getInteger ("asyncBatchSize" , 10 );
91
99
private static final int EXECUTION_TIME_SECONDS = Integer .getInteger ("executionTimeSeconds" , 20 );
92
100
private static final boolean DEBUG_LOGGING_ENABLED = Boolean .getBoolean ("loggingEnabled" );
101
+ private static final boolean EXTENDED_TYPES_ENABLED = Boolean .getBoolean ("extendedTypesEnabled" );
93
102
94
103
private static final int BIG_DATA_TEST_NODE_COUNT = Integer .getInteger ("bigDataTestNodeCount" , 30_000 );
95
104
private static final int BIG_DATA_TEST_BATCH_SIZE = Integer .getInteger ("bigDataTestBatchSize" , 10_000 );
96
105
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
+
97
113
private LoggerNameTrackingLogging logging ;
98
114
private ExecutorService executor ;
99
115
@@ -640,6 +656,16 @@ private static Map<String, Object> createNodeProperties(int nodeIndex) {
640
656
result .put ("long-indices" , nCopies (10 , (long ) nodeIndex ));
641
657
result .put ("double-indices" , nCopies (10 , (double ) nodeIndex ));
642
658
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
+
643
669
return result ;
644
670
}
645
671
@@ -650,6 +676,15 @@ private static void verifyNodeProperties(Node node) {
650
676
assertEquals (nCopies (10 , (long ) nodeIndex ), node .get ("long-indices" ).asList ());
651
677
assertEquals (nCopies (10 , (double ) nodeIndex ), node .get ("double-indices" ).asList ());
652
678
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
+ }
653
688
}
654
689
655
690
private static <T > CompletionStage <T > safeCloseSession (AsyncSession session , T result ) {
0 commit comments