├── .gitattributes ├── .gitignore ├── .snyk ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE.md ├── LICENSE.txt ├── LICENSES.txt ├── NOTICE.txt ├── README.md ├── benchkit-backend ├── LICENSES.txt ├── NOTICE.txt ├── pom.xml └── src │ └── main │ └── java │ └── neo4j │ └── org │ └── testkit │ └── backend │ ├── Config.java │ ├── Runner.java │ ├── channel │ └── handler │ │ └── HttpRequestHandler.java │ ├── handler │ ├── ReadyHandler.java │ └── WorkloadHandler.java │ └── request │ └── WorkloadRequest.java ├── benchkit └── Dockerfile ├── build └── javadoc │ └── overview.html ├── bundle ├── LICENSES.txt ├── NOTICE.txt ├── README.md ├── osgi.bnd ├── pom.xml └── src │ └── main │ ├── jpms │ └── module-info.java │ └── resources │ └── META-INF │ └── native-image │ └── org.neo4j.driver │ └── neo4j-java-driver │ ├── native-image.properties │ └── reflect-config.json ├── driver-it ├── LICENSES.txt ├── NOTICE.txt ├── jul-to-slf4j-log4j-it │ ├── LICENSES.txt │ ├── NOTICE.txt │ ├── pom.xml │ └── src │ │ └── test │ │ └── java │ │ └── org │ │ └── neo4j │ │ └── driver │ │ └── it │ │ └── jul │ │ └── to │ │ └── slf4j │ │ ├── InMemoryAppender.java │ │ └── LoggingIT.java ├── jul-to-slf4j-logback-it │ ├── LICENSES.txt │ ├── NOTICE.txt │ ├── pom.xml │ └── src │ │ └── test │ │ └── java │ │ └── org │ │ └── neo4j │ │ └── driver │ │ └── it │ │ └── jul │ │ └── to │ │ └── slf4j │ │ ├── InMemoryAppender.java │ │ └── LoggingIT.java ├── log4j-it │ ├── LICENSES.txt │ ├── NOTICE.txt │ ├── pom.xml │ └── src │ │ └── test │ │ └── java │ │ └── org │ │ └── neo4j │ │ └── driver │ │ └── it │ │ └── slf4j │ │ ├── InMemoryAppender.java │ │ └── LoggingIT.java ├── pom.xml ├── slf4j-log4j-it │ ├── LICENSES.txt │ ├── NOTICE.txt │ ├── pom.xml │ └── src │ │ └── test │ │ └── java │ │ └── org │ │ └── neo4j │ │ └── driver │ │ └── it │ │ └── slf4j │ │ ├── InMemoryAppender.java │ │ └── LoggingIT.java └── slf4j-logback-it │ ├── LICENSES.txt │ ├── NOTICE.txt │ ├── pom.xml │ └── src │ └── test │ └── java │ └── org │ └── neo4j │ └── driver │ └── it │ └── slf4j │ ├── InMemoryAppender.java │ └── LoggingIT.java ├── driver ├── LICENSES.txt ├── NOTICE.txt ├── README.md ├── clirr-ignored-differences.xml ├── osgi.bnd ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── module-info.java │ │ └── org │ │ │ └── neo4j │ │ │ └── driver │ │ │ ├── AccessMode.java │ │ │ ├── AuthToken.java │ │ │ ├── AuthTokenAndExpiration.java │ │ │ ├── AuthTokenManager.java │ │ │ ├── AuthTokenManagers.java │ │ │ ├── AuthTokens.java │ │ │ ├── BaseSession.java │ │ │ ├── Bookmark.java │ │ │ ├── BookmarkManager.java │ │ │ ├── BookmarkManagerConfig.java │ │ │ ├── BookmarkManagers.java │ │ │ ├── ClientCertificate.java │ │ │ ├── ClientCertificateManager.java │ │ │ ├── ClientCertificateManagers.java │ │ │ ├── ClientCertificates.java │ │ │ ├── Config.java │ │ │ ├── ConnectionPoolMetrics.java │ │ │ ├── Driver.java │ │ │ ├── EagerResult.java │ │ │ ├── ExecutableQuery.java │ │ │ ├── GraphDatabase.java │ │ │ ├── Logger.java │ │ │ ├── Logging.java │ │ │ ├── Metrics.java │ │ │ ├── MetricsAdapter.java │ │ │ ├── NotificationCategory.java │ │ │ ├── NotificationClassification.java │ │ │ ├── NotificationConfig.java │ │ │ ├── NotificationSeverity.java │ │ │ ├── Query.java │ │ │ ├── QueryConfig.java │ │ │ ├── QueryRunner.java │ │ │ ├── Record.java │ │ │ ├── Records.java │ │ │ ├── Result.java │ │ │ ├── RevocationCheckingStrategy.java │ │ │ ├── RotatingClientCertificateManager.java │ │ │ ├── RoutingControl.java │ │ │ ├── Session.java │ │ │ ├── SessionConfig.java │ │ │ ├── SimpleQueryRunner.java │ │ │ ├── Transaction.java │ │ │ ├── TransactionCallback.java │ │ │ ├── TransactionConfig.java │ │ │ ├── TransactionContext.java │ │ │ ├── Value.java │ │ │ ├── Values.java │ │ │ ├── async │ │ │ ├── AsyncQueryRunner.java │ │ │ ├── AsyncSession.java │ │ │ ├── AsyncTransaction.java │ │ │ ├── AsyncTransactionCallback.java │ │ │ ├── AsyncTransactionContext.java │ │ │ └── ResultCursor.java │ │ │ ├── exceptions │ │ │ ├── AuthTokenManagerExecutionException.java │ │ │ ├── AuthenticationException.java │ │ │ ├── AuthorizationExpiredException.java │ │ │ ├── ClientException.java │ │ │ ├── ConnectionReadTimeoutException.java │ │ │ ├── DatabaseException.java │ │ │ ├── DiscoveryException.java │ │ │ ├── FatalDiscoveryException.java │ │ │ ├── GqlStatusErrorClassification.java │ │ │ ├── Neo4jException.java │ │ │ ├── NoSuchRecordException.java │ │ │ ├── ProtocolException.java │ │ │ ├── ResultConsumedException.java │ │ │ ├── RetryableException.java │ │ │ ├── SecurityException.java │ │ │ ├── SecurityRetryableException.java │ │ │ ├── ServiceUnavailableException.java │ │ │ ├── SessionExpiredException.java │ │ │ ├── TokenExpiredException.java │ │ │ ├── TransactionNestingException.java │ │ │ ├── TransactionTerminatedException.java │ │ │ ├── TransientException.java │ │ │ ├── UnsupportedFeatureException.java │ │ │ ├── UntrustedServerException.java │ │ │ └── value │ │ │ │ ├── LossyCoercion.java │ │ │ │ ├── NotMultiValued.java │ │ │ │ ├── Uncoercible.java │ │ │ │ ├── Unsizable.java │ │ │ │ └── ValueException.java │ │ │ ├── internal │ │ │ ├── AbstractQueryRunner.java │ │ │ ├── AsValue.java │ │ │ ├── BoltLogger.java │ │ │ ├── BoltLoggingProvider.java │ │ │ ├── ConnectionSettings.java │ │ │ ├── DatabaseBookmark.java │ │ │ ├── DelegatingTransactionContext.java │ │ │ ├── DriverFactory.java │ │ │ ├── EagerResultValue.java │ │ │ ├── FailableCursor.java │ │ │ ├── GqlNotificationConfig.java │ │ │ ├── GqlStatusError.java │ │ │ ├── IdentityResolver.java │ │ │ ├── InternalBookmark.java │ │ │ ├── InternalClientCertificate.java │ │ │ ├── InternalDriver.java │ │ │ ├── InternalEntity.java │ │ │ ├── InternalExecutableQuery.java │ │ │ ├── InternalIsoDuration.java │ │ │ ├── InternalNode.java │ │ │ ├── InternalNotificationConfig.java │ │ │ ├── InternalNotificationSeverity.java │ │ │ ├── InternalPair.java │ │ │ ├── InternalPath.java │ │ │ ├── InternalPoint2D.java │ │ │ ├── InternalPoint3D.java │ │ │ ├── InternalRecord.java │ │ │ ├── InternalRelationship.java │ │ │ ├── InternalResult.java │ │ │ ├── InternalRotatingClientCertificateManager.java │ │ │ ├── InternalRoutingControl.java │ │ │ ├── InternalServerAddress.java │ │ │ ├── InternalSession.java │ │ │ ├── InternalTransaction.java │ │ │ ├── Neo4jBookmarkManager.java │ │ │ ├── NoOpBookmarkManager.java │ │ │ ├── NotificationConfigMapper.java │ │ │ ├── RoutingSettings.java │ │ │ ├── Scheme.java │ │ │ ├── SecuritySettings.java │ │ │ ├── SessionFactory.java │ │ │ ├── SessionFactoryImpl.java │ │ │ ├── ValidatingClientCertificateManager.java │ │ │ ├── adaptedbolt │ │ │ │ ├── AdaptingDriverBoltConnection.java │ │ │ │ ├── AdaptingDriverBoltConnectionProvider.java │ │ │ │ ├── AdaptingDriverResponseHandler.java │ │ │ │ ├── BasicResponseHandler.java │ │ │ │ ├── DriverBoltConnection.java │ │ │ │ ├── DriverBoltConnectionProvider.java │ │ │ │ ├── DriverResponseHandler.java │ │ │ │ ├── ErrorMapper.java │ │ │ │ ├── RoutedErrorMapper.java │ │ │ │ └── summary │ │ │ │ │ ├── DiscardSummary.java │ │ │ │ │ └── PullSummary.java │ │ │ ├── async │ │ │ │ ├── AsyncAbstractQueryRunner.java │ │ │ │ ├── BoltConnectionWithAuthTokenManager.java │ │ │ │ ├── BoltConnectionWithCloseTracking.java │ │ │ │ ├── ConnectionContext.java │ │ │ │ ├── DelegatingAsyncTransactionContext.java │ │ │ │ ├── DelegatingBoltConnection.java │ │ │ │ ├── DelegatingResponseHandler.java │ │ │ │ ├── ErrorMappingResponseHandler.java │ │ │ │ ├── InternalAsyncSession.java │ │ │ │ ├── InternalAsyncTransaction.java │ │ │ │ ├── LeakLoggingNetworkSession.java │ │ │ │ ├── NetworkSession.java │ │ │ │ ├── ResultCursorsHolder.java │ │ │ │ ├── TerminationAwareBoltConnection.java │ │ │ │ ├── TerminationAwareResponseHandler.java │ │ │ │ ├── TerminationAwareStateLockingExecutor.java │ │ │ │ └── UnmanagedTransaction.java │ │ │ ├── blockhound │ │ │ │ └── Neo4jDriverBlockHoundIntegration.java │ │ │ ├── boltlistener │ │ │ │ ├── BoltConnectionListener.java │ │ │ │ ├── ListeningBoltConnection.java │ │ │ │ └── ListeningBoltConnectionProvider.java │ │ │ ├── cursor │ │ │ │ ├── AbstractRecordStateResponseHandler.java │ │ │ │ ├── DisposableResultCursorImpl.java │ │ │ │ ├── ResultCursorImpl.java │ │ │ │ ├── RxResultCursor.java │ │ │ │ └── RxResultCursorImpl.java │ │ │ ├── homedb │ │ │ │ ├── DriverHomeDatabaseCacheKey.java │ │ │ │ ├── HomeDatabaseCache.java │ │ │ │ ├── HomeDatabaseCacheImpl.java │ │ │ │ ├── HomeDatabaseCacheKey.java │ │ │ │ ├── MapHomeDatabaseCacheKey.java │ │ │ │ └── NoopHomeDatabaseCache.java │ │ │ ├── logging │ │ │ │ ├── ConsoleLogging.java │ │ │ │ ├── DevNullLogger.java │ │ │ │ ├── DevNullLogging.java │ │ │ │ ├── JULogger.java │ │ │ │ ├── JULogging.java │ │ │ │ ├── PrefixedLogger.java │ │ │ │ ├── ReformattedLogger.java │ │ │ │ ├── Slf4jLogger.java │ │ │ │ ├── Slf4jLogging.java │ │ │ │ ├── SystemLogger.java │ │ │ │ └── SystemLogging.java │ │ │ ├── metrics │ │ │ │ ├── ConnectionPoolMetricsListener.java │ │ │ │ ├── DevNullListenerEvent.java │ │ │ │ ├── DevNullMetricsListener.java │ │ │ │ ├── DevNullMetricsProvider.java │ │ │ │ ├── DevNullPoolMetricsListener.java │ │ │ │ ├── InternalConnectionPoolMetrics.java │ │ │ │ ├── InternalMetrics.java │ │ │ │ ├── InternalMetricsProvider.java │ │ │ │ ├── MetricsProvider.java │ │ │ │ ├── MicrometerConnectionPoolMetrics.java │ │ │ │ ├── MicrometerMetrics.java │ │ │ │ ├── MicrometerMetricsProvider.java │ │ │ │ ├── MicrometerTimerListenerEvent.java │ │ │ │ └── TimeRecorderListenerEvent.java │ │ │ ├── pki │ │ │ │ ├── DerUtils.java │ │ │ │ ├── PemFormats.java │ │ │ │ └── PemParser.java │ │ │ ├── reactive │ │ │ │ ├── AbstractReactiveSession.java │ │ │ │ ├── AbstractReactiveTransaction.java │ │ │ │ ├── BaseReactiveQueryRunner.java │ │ │ │ ├── DelegatingReactiveTransactionContext.java │ │ │ │ ├── InternalReactiveResult.java │ │ │ │ ├── InternalReactiveSession.java │ │ │ │ ├── InternalReactiveTransaction.java │ │ │ │ └── RxUtils.java │ │ │ ├── reactivestreams │ │ │ │ ├── BaseReactiveQueryRunner.java │ │ │ │ ├── DelegatingReactiveTransactionContext.java │ │ │ │ ├── InternalReactiveResult.java │ │ │ │ ├── InternalReactiveSession.java │ │ │ │ └── InternalReactiveTransaction.java │ │ │ ├── retry │ │ │ │ ├── ExponentialBackoffRetryLogic.java │ │ │ │ ├── RetryLogic.java │ │ │ │ └── RetrySettings.java │ │ │ ├── security │ │ │ │ ├── BoltSecurityPlanManager.java │ │ │ │ ├── ExpirationBasedAuthTokenManager.java │ │ │ │ ├── InternalAuthToken.java │ │ │ │ ├── InternalAuthTokenAndExpiration.java │ │ │ │ ├── InternalBoltSecurityPlanManager.java │ │ │ │ ├── SSLContextManager.java │ │ │ │ ├── SecurityPlan.java │ │ │ │ ├── SecurityPlanImpl.java │ │ │ │ ├── SecurityPlans.java │ │ │ │ ├── StaticAuthTokenManager.java │ │ │ │ └── ValidatingAuthTokenManager.java │ │ │ ├── summary │ │ │ │ ├── InternalDatabaseInfo.java │ │ │ │ ├── InternalGqlStatusObject.java │ │ │ │ ├── InternalInputPosition.java │ │ │ │ ├── InternalNotification.java │ │ │ │ ├── InternalPlan.java │ │ │ │ ├── InternalProfiledPlan.java │ │ │ │ ├── InternalResultSummary.java │ │ │ │ ├── InternalServerInfo.java │ │ │ │ └── InternalSummaryCounters.java │ │ │ ├── svm │ │ │ │ └── MicrometerSubstitutions.java │ │ │ ├── telemetry │ │ │ │ └── ApiTelemetryWork.java │ │ │ ├── types │ │ │ │ ├── InternalMapAccessorWithDefaultValue.java │ │ │ │ ├── InternalTypeSystem.java │ │ │ │ ├── TypeConstructor.java │ │ │ │ └── TypeRepresentation.java │ │ │ ├── util │ │ │ │ ├── DriverInfoUtil.java │ │ │ │ ├── ErrorUtil.java │ │ │ │ ├── Extract.java │ │ │ │ ├── Format.java │ │ │ │ ├── Futures.java │ │ │ │ ├── Iterables.java │ │ │ │ ├── LockUtil.java │ │ │ │ ├── MetadataExtractor.java │ │ │ │ ├── Preconditions.java │ │ │ │ └── QueryKeys.java │ │ │ └── value │ │ │ │ ├── BoltValue.java │ │ │ │ ├── BoltValueFactory.java │ │ │ │ ├── BooleanValue.java │ │ │ │ ├── BytesValue.java │ │ │ │ ├── DateTimeValue.java │ │ │ │ ├── DateValue.java │ │ │ │ ├── DurationValue.java │ │ │ │ ├── EntityValueAdapter.java │ │ │ │ ├── FloatValue.java │ │ │ │ ├── IntegerValue.java │ │ │ │ ├── InternalValue.java │ │ │ │ ├── ListValue.java │ │ │ │ ├── LocalDateTimeValue.java │ │ │ │ ├── LocalTimeValue.java │ │ │ │ ├── MapValue.java │ │ │ │ ├── NodeValue.java │ │ │ │ ├── NullValue.java │ │ │ │ ├── NumberValueAdapter.java │ │ │ │ ├── ObjectValueAdapter.java │ │ │ │ ├── PathValue.java │ │ │ │ ├── PointValue.java │ │ │ │ ├── RelationshipValue.java │ │ │ │ ├── StringValue.java │ │ │ │ ├── TimeValue.java │ │ │ │ ├── UnsupportedDateTimeValue.java │ │ │ │ ├── ValueAdapter.java │ │ │ │ └── mapping │ │ │ │ ├── Argument.java │ │ │ │ ├── ConstructorFinder.java │ │ │ │ ├── DurationMapper.java │ │ │ │ ├── MapAccessorMapper.java │ │ │ │ ├── MapAccessorMapperProvider.java │ │ │ │ ├── ObjectInstantiator.java │ │ │ │ ├── ObjectMapper.java │ │ │ │ └── ObjectMetadata.java │ │ │ ├── mapping │ │ │ └── Property.java │ │ │ ├── net │ │ │ ├── ServerAddress.java │ │ │ └── ServerAddressResolver.java │ │ │ ├── reactive │ │ │ ├── ReactiveQueryRunner.java │ │ │ ├── ReactiveResult.java │ │ │ ├── ReactiveSession.java │ │ │ ├── ReactiveTransaction.java │ │ │ ├── ReactiveTransactionCallback.java │ │ │ └── ReactiveTransactionContext.java │ │ │ ├── reactivestreams │ │ │ ├── ReactiveQueryRunner.java │ │ │ ├── ReactiveResult.java │ │ │ ├── ReactiveSession.java │ │ │ ├── ReactiveTransaction.java │ │ │ ├── ReactiveTransactionCallback.java │ │ │ └── ReactiveTransactionContext.java │ │ │ ├── summary │ │ │ ├── DatabaseInfo.java │ │ │ ├── GqlStatusObject.java │ │ │ ├── InputPosition.java │ │ │ ├── Notification.java │ │ │ ├── Plan.java │ │ │ ├── ProfiledPlan.java │ │ │ ├── QueryType.java │ │ │ ├── ResultSummary.java │ │ │ ├── ServerInfo.java │ │ │ └── SummaryCounters.java │ │ │ ├── types │ │ │ ├── Entity.java │ │ │ ├── IsoDuration.java │ │ │ ├── MapAccessor.java │ │ │ ├── MapAccessorWithDefaultValue.java │ │ │ ├── Node.java │ │ │ ├── Path.java │ │ │ ├── Point.java │ │ │ ├── Relationship.java │ │ │ ├── Type.java │ │ │ └── TypeSystem.java │ │ │ └── util │ │ │ ├── Experimental.java │ │ │ ├── Immutable.java │ │ │ ├── Pair.java │ │ │ ├── Preview.java │ │ │ └── Resource.java │ └── resources │ │ └── META-INF │ │ ├── native-image │ │ └── org.neo4j.driver │ │ │ └── neo4j-java-driver │ │ │ ├── native-image.properties │ │ │ └── reflect-config.json │ │ └── services │ │ └── reactor.blockhound.integration.BlockHoundIntegration │ └── test │ ├── java │ └── org │ │ └── neo4j │ │ └── driver │ │ ├── AuthTokensTest.java │ │ ├── BookmarkManagerConfigTest.java │ │ ├── BookmarkManagersTest.java │ │ ├── ClientCertificateManagersTest.java │ │ ├── ConfigTest.java │ │ ├── GraphDatabaseTest.java │ │ ├── ObjectMappingTests.java │ │ ├── ParametersTest.java │ │ ├── QueryConfigTest.java │ │ ├── QueryTest.java │ │ ├── SessionConfigTest.java │ │ ├── TransactionConfigTest.java │ │ ├── exceptions │ │ └── Neo4jExceptionTest.java │ │ ├── integration │ │ ├── BookmarkIT.java │ │ ├── CredentialsIT.java │ │ ├── DriverCloseIT.java │ │ ├── EncryptionIT.java │ │ ├── EntityTypeIT.java │ │ ├── ErrorIT.java │ │ ├── GraphDatabaseAuthClusterIT.java │ │ ├── GraphDatabaseAuthDirectIT.java │ │ ├── LoadCSVIT.java │ │ ├── LoggingIT.java │ │ ├── MetricsIT.java │ │ ├── ParametersIT.java │ │ ├── QueryIT.java │ │ ├── QueryRunnerCloseIT.java │ │ ├── ResolverIT.java │ │ ├── ResultStreamIT.java │ │ ├── ScalarTypeIT.java │ │ ├── ServerKilledIT.java │ │ ├── SessionBoltV3IT.java │ │ ├── SessionIT.java │ │ ├── SessionMixIT.java │ │ ├── SessionResetIT.java │ │ ├── SpatialTypesIT.java │ │ ├── SummaryIT.java │ │ ├── TemporalTypesIT.java │ │ ├── TransactionBoltV3IT.java │ │ ├── TransactionIT.java │ │ ├── TrustCustomCertificateIT.java │ │ ├── UnmanagedTransactionIT.java │ │ ├── UnsupportedBoltV3IT.java │ │ ├── async │ │ │ ├── AsyncQueryIT.java │ │ │ ├── AsyncSessionIT.java │ │ │ ├── AsyncSessionServerRestartIT.java │ │ │ └── AsyncTransactionIT.java │ │ └── reactive │ │ │ ├── InternalReactiveSessionIT.java │ │ │ ├── ReactiveSessionIT.java │ │ │ ├── ReactiveStreamsSessionIT.java │ │ │ └── ReactiveTransactionIT.java │ │ ├── internal │ │ ├── CustomSecurityPlanTest.java │ │ ├── DelegatingTransactionContextTest.java │ │ ├── DriverFactoryTest.java │ │ ├── ExtractTest.java │ │ ├── InternalBookmarkTest.java │ │ ├── InternalDriverTest.java │ │ ├── InternalExecutableQueryTest.java │ │ ├── InternalIsoDurationTest.java │ │ ├── InternalMapAccessorWithDefaultValueTest.java │ │ ├── InternalNodeTest.java │ │ ├── InternalNotificationSeverityTest.java │ │ ├── InternalPathTest.java │ │ ├── InternalRecordTest.java │ │ ├── InternalRelationshipTest.java │ │ ├── InternalResultTest.java │ │ ├── InternalRotatingClientCertificateManagerTests.java │ │ ├── InternalSessionTest.java │ │ ├── InternalTransactionTest.java │ │ ├── Neo4jBookmarkManagerTest.java │ │ ├── SchemeTest.java │ │ ├── SecuritySettingsTest.java │ │ ├── SelfContainedNodeTest.java │ │ ├── SessionFactoryImplTest.java │ │ ├── ValuesTest.java │ │ ├── adaptedbolt │ │ │ └── ErrorMapperTest.java │ │ ├── async │ │ │ ├── DelegatingAsyncTransactionContextTest.java │ │ │ ├── InternalAsyncSessionTest.java │ │ │ ├── InternalAsyncTransactionTest.java │ │ │ ├── LeakLoggingNetworkSessionTest.java │ │ │ ├── NetworkSessionTest.java │ │ │ ├── ResultCursorsHolderTest.java │ │ │ └── UnmanagedTransactionTest.java │ │ ├── blockhound │ │ │ ├── LockUtilBlockHoundTest.java │ │ │ └── Neo4jDriverBlockHoundIntegrationTest.java │ │ ├── cluster │ │ │ └── IdentityResolverTest.java │ │ ├── cursor │ │ │ ├── ResultCursorImplTest.java │ │ │ └── RxResultCursorImplTest.java │ │ ├── homedb │ │ │ └── HomeDatabaseCacheImplTest.java │ │ ├── logging │ │ │ ├── ConsoleLoggingTest.java │ │ │ ├── PrefixedLoggerTest.java │ │ │ └── Slf4jLoggerTest.java │ │ ├── metrics │ │ │ ├── MicrometerConnectionPoolMetricsTest.java │ │ │ ├── MicrometerMetricsProviderTest.java │ │ │ ├── MicrometerMetricsTest.java │ │ │ └── MicrometerTimerListenerEventTest.java │ │ ├── reactive │ │ │ ├── DelegatingReactiveTransactionContextTest.java │ │ │ ├── InternalReactiveSessionTest.java │ │ │ └── RxUtilsTest.java │ │ ├── retry │ │ │ └── ExponentialBackoffRetryLogicTest.java │ │ ├── security │ │ │ ├── SSLContextManagerTest.java │ │ │ ├── SSLContextManagerTests.java │ │ │ ├── SecurityPlansTest.java │ │ │ └── ValidatingAuthTokenManagerTest.java │ │ ├── summary │ │ │ ├── InternalInputPositionTest.java │ │ │ ├── InternalNotificationTest.java │ │ │ ├── InternalPlanTest.java │ │ │ └── InternalProfiledPlanTest.java │ │ ├── telemetry │ │ │ └── ApiTelemetryWorkTest.java │ │ ├── util │ │ │ ├── BookmarkUtil.java │ │ │ ├── DisabledOnNeo4jWith.java │ │ │ ├── DriverFactoryWithClock.java │ │ │ ├── DriverFactoryWithFixedRetryLogic.java │ │ │ ├── EnabledOnNeo4jWith.java │ │ │ ├── ErrorUtilTest.java │ │ │ ├── FakeClock.java │ │ │ ├── FixedRetryLogic.java │ │ │ ├── FuturesTest.java │ │ │ ├── ImmediateSchedulingEventExecutor.java │ │ │ ├── IterablesTest.java │ │ │ ├── Matchers.java │ │ │ ├── MetadataExtractorTest.java │ │ │ ├── Neo4jEdition.java │ │ │ ├── Neo4jFeature.java │ │ │ ├── Neo4jWithFeatureCondition.java │ │ │ ├── PreconditionsTest.java │ │ │ └── ValueFactory.java │ │ └── value │ │ │ ├── BooleanValueTest.java │ │ │ ├── BytesValueTest.java │ │ │ ├── DateTimeValueTest.java │ │ │ ├── DateValueTest.java │ │ │ ├── DurationValueTest.java │ │ │ ├── FloatValueTest.java │ │ │ ├── IntegerValueTest.java │ │ │ ├── ListValueTest.java │ │ │ ├── LocalDateTimeValueTest.java │ │ │ ├── LocalTimeValueTest.java │ │ │ ├── MapValueTest.java │ │ │ ├── NodeValueTest.java │ │ │ ├── NullValueTest.java │ │ │ ├── PathValueTest.java │ │ │ ├── PointValueTest.java │ │ │ ├── RelationshipValueTest.java │ │ │ ├── StringValueTest.java │ │ │ ├── TimeValueTest.java │ │ │ └── UnsupportedDateTimeValueTest.java │ │ ├── net │ │ └── ServerAddressTest.java │ │ ├── org │ │ └── neo4j │ │ │ └── driver │ │ │ └── ClientCertificatesTests.java │ │ ├── stress │ │ ├── AbstractAsyncQuery.java │ │ ├── AbstractBlockingQuery.java │ │ ├── AbstractContext.java │ │ ├── AbstractRxQuery.java │ │ ├── AbstractStressTestBase.java │ │ ├── AsyncCommand.java │ │ ├── AsyncFailingQuery.java │ │ ├── AsyncFailingQueryInTx.java │ │ ├── AsyncFailingQueryWithRetries.java │ │ ├── AsyncReadQuery.java │ │ ├── AsyncReadQueryInTx.java │ │ ├── AsyncReadQueryWithRetries.java │ │ ├── AsyncWriteQuery.java │ │ ├── AsyncWriteQueryInTx.java │ │ ├── AsyncWriteQueryWithRetries.java │ │ ├── AsyncWrongQuery.java │ │ ├── AsyncWrongQueryInTx.java │ │ ├── AsyncWrongQueryWithRetries.java │ │ ├── BlockingCommand.java │ │ ├── BlockingFailingQuery.java │ │ ├── BlockingFailingQueryInTx.java │ │ ├── BlockingFailingQueryWithRetries.java │ │ ├── BlockingReadQuery.java │ │ ├── BlockingReadQueryInTx.java │ │ ├── BlockingReadQueryWithRetries.java │ │ ├── BlockingWriteQuery.java │ │ ├── BlockingWriteQueryInTx.java │ │ ├── BlockingWriteQueryUsingReadSessionWithRetries.java │ │ ├── BlockingWriteQueryWithRetries.java │ │ ├── BlockingWrongQuery.java │ │ ├── BlockingWrongQueryInTx.java │ │ ├── BlockingWrongQueryWithRetries.java │ │ ├── CausalClusteringStressIT.java │ │ ├── FailedAuth.java │ │ ├── RxCommand.java │ │ ├── RxFailingQuery.java │ │ ├── RxFailingQueryInTx.java │ │ ├── RxFailingQueryWithRetries.java │ │ ├── RxReadQuery.java │ │ ├── RxReadQueryInTx.java │ │ ├── RxReadQueryWithRetries.java │ │ ├── RxWriteQuery.java │ │ ├── RxWriteQueryInTx.java │ │ ├── RxWriteQueryWithRetries.java │ │ ├── SessionPoolingStressIT.java │ │ └── SingleInstanceStressIT.java │ │ ├── tck │ │ └── reactive │ │ │ ├── Neo4jManager.java │ │ │ ├── ReactiveResultPublisherVerificationIT.java │ │ │ ├── ReactiveResultRecordPublisherVerificationIT.java │ │ │ └── RxResultRecordPublisherVerificationIT.java │ │ ├── testutil │ │ ├── BlockHoundTest.java │ │ ├── CertificateTool.java │ │ ├── CertificateUtil.java │ │ ├── CertificateUtilTest.java │ │ ├── DaemonThreadFactory.java │ │ ├── DatabaseExtension.java │ │ ├── DriverExtension.java │ │ ├── FileTools.java │ │ ├── LoggingUtil.java │ │ ├── Neo4jSettings.java │ │ ├── ParallelizableIT.java │ │ ├── SessionExtension.java │ │ ├── StdIOCapture.java │ │ ├── TemporalUtil.java │ │ ├── TestUtil.java │ │ └── cc │ │ │ └── LocalOrRemoteClusterExtension.java │ │ └── types │ │ └── TypeSystemTest.java │ └── resources │ ├── keystore.jks │ ├── logback-test.xml │ ├── longRunningStatement.jar │ └── nginx.conf ├── examples ├── LICENSES.txt ├── NOTICE.txt ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── neo4j │ │ └── docs │ │ └── driver │ │ ├── AsyncAutocommitTransactionExample.java │ │ ├── AsyncResultConsumeExample.java │ │ ├── AsyncRunMultipleTransactionExample.java │ │ ├── AsyncTransactionFunctionExample.java │ │ ├── AutocommitTransactionExample.java │ │ ├── BaseApplication.java │ │ ├── BasicAuthExample.java │ │ ├── ConfigConnectionPoolExample.java │ │ ├── ConfigConnectionTimeoutExample.java │ │ ├── ConfigCustomResolverExample.java │ │ ├── ConfigMaxRetryTimeExample.java │ │ ├── ConfigTrustExample.java │ │ ├── ConfigUnencryptedExample.java │ │ ├── CustomAuthExample.java │ │ ├── DatabaseSelectionExample.java │ │ ├── DriverLifecycleExample.java │ │ ├── HelloWorldExample.java │ │ ├── KerberosAuthExample.java │ │ ├── PassBookmarkExample.java │ │ ├── ReadWriteTransactionExample.java │ │ ├── ResultConsumeExample.java │ │ ├── ResultRetainExample.java │ │ ├── RxAutocommitTransactionExample.java │ │ ├── RxResultConsumeExample.java │ │ ├── RxTransactionFunctionExample.java │ │ ├── TransactionFunctionExample.java │ │ ├── TransactionMetadataConfigExample.java │ │ └── TransactionTimeoutConfigExample.java │ └── test │ ├── java │ └── org │ │ └── neo4j │ │ └── docs │ │ └── driver │ │ ├── ExamplesIT.java │ │ └── RoutingExamplesIT.java │ └── resources │ └── logback-test.xml ├── intellij-code-inspection-driver-profile.xml ├── pom.xml ├── testkit-backend ├── LICENSES.txt ├── NOTICE.txt ├── pom.xml └── src │ ├── main │ └── java │ │ └── neo4j │ │ └── org │ │ └── testkit │ │ └── backend │ │ ├── AsyncTransactionContextAdapter.java │ │ ├── AuthTokenUtil.java │ │ ├── CustomDriverError.java │ │ ├── FrontendError.java │ │ ├── ReactiveTransactionContextAdapter.java │ │ ├── ReactiveTransactionContextStreamsAdapter.java │ │ ├── ResponseQueueHanlder.java │ │ ├── Runner.java │ │ ├── RxBufferedSubscriber.java │ │ ├── TestkitClock.java │ │ ├── TestkitState.java │ │ ├── TransactionContextAdapter.java │ │ ├── channel │ │ └── handler │ │ │ ├── TestkitMessageInboundHandler.java │ │ │ ├── TestkitMessageOutboundHandler.java │ │ │ ├── TestkitRequestProcessorHandler.java │ │ │ └── TestkitRequestResponseMapperHandler.java │ │ ├── holder │ │ ├── AbstractResultHolder.java │ │ ├── AbstractSessionHolder.java │ │ ├── AbstractTransactionHolder.java │ │ ├── AsyncSessionHolder.java │ │ ├── AsyncTransactionHolder.java │ │ ├── DriverHolder.java │ │ ├── ReactiveResultHolder.java │ │ ├── ReactiveResultStreamsHolder.java │ │ ├── ReactiveSessionHolder.java │ │ ├── ReactiveSessionStreamsHolder.java │ │ ├── ReactiveTransactionHolder.java │ │ ├── ReactiveTransactionStreamsHolder.java │ │ ├── ResultCursorHolder.java │ │ ├── ResultHolder.java │ │ ├── SessionHolder.java │ │ └── TransactionHolder.java │ │ └── messages │ │ ├── AbstractResultNext.java │ │ ├── TestkitModule.java │ │ ├── requests │ │ ├── AbstractBasicTestkitRequest.java │ │ ├── AbstractTestkitRequestWithTransactionConfig.java │ │ ├── AuthTokenAndExpiration.java │ │ ├── AuthTokenManagerClose.java │ │ ├── AuthTokenManagerGetAuthCompleted.java │ │ ├── AuthTokenManagerHandleSecurityExceptionCompleted.java │ │ ├── AuthorizationToken.java │ │ ├── BasicAuthTokenProviderCompleted.java │ │ ├── BearerAuthTokenProviderCompleted.java │ │ ├── BookmarkManagerClose.java │ │ ├── BookmarksConsumerCompleted.java │ │ ├── BookmarksSupplierCompleted.java │ │ ├── CheckDriverIsEncrypted.java │ │ ├── CheckMultiDBSupport.java │ │ ├── CheckSessionAuthSupport.java │ │ ├── ClientCertificate.java │ │ ├── ClientCertificateProviderClose.java │ │ ├── ClientCertificateProviderCompleted.java │ │ ├── CypherTypeField.java │ │ ├── DomainNameResolutionCompleted.java │ │ ├── DriverClose.java │ │ ├── ExecuteQuery.java │ │ ├── FakeTimeInstall.java │ │ ├── FakeTimeTick.java │ │ ├── FakeTimeUninstall.java │ │ ├── GetConnectionPoolMetrics.java │ │ ├── GetFeatures.java │ │ ├── GetRoutingTable.java │ │ ├── NewAuthTokenManager.java │ │ ├── NewBasicAuthTokenManager.java │ │ ├── NewBearerAuthTokenManager.java │ │ ├── NewBookmarkManager.java │ │ ├── NewClientCertificateProvider.java │ │ ├── NewDriver.java │ │ ├── NewSession.java │ │ ├── ResolverResolutionCompleted.java │ │ ├── ResultConsume.java │ │ ├── ResultList.java │ │ ├── ResultNext.java │ │ ├── ResultPeek.java │ │ ├── ResultSingle.java │ │ ├── RetryableNegative.java │ │ ├── RetryablePositive.java │ │ ├── SessionBeginTransaction.java │ │ ├── SessionClose.java │ │ ├── SessionLastBookmarks.java │ │ ├── SessionReadTransaction.java │ │ ├── SessionRun.java │ │ ├── SessionWriteTransaction.java │ │ ├── StartSubTest.java │ │ ├── StartTest.java │ │ ├── SummaryUtil.java │ │ ├── TestkitBookmarksConsumer.java │ │ ├── TestkitBookmarksSupplier.java │ │ ├── TestkitCallbackResult.java │ │ ├── TestkitRequest.java │ │ ├── TransactionClose.java │ │ ├── TransactionCommit.java │ │ ├── TransactionRollback.java │ │ ├── TransactionRun.java │ │ ├── VerifyAuthentication.java │ │ ├── VerifyConnectivity.java │ │ └── deserializer │ │ │ ├── TestkitCypherDateDeserializer.java │ │ │ ├── TestkitCypherDateTimeDeserializer.java │ │ │ ├── TestkitCypherDurationDeserializer.java │ │ │ ├── TestkitCypherParamDeserializer.java │ │ │ ├── TestkitCypherTimeDeserializer.java │ │ │ ├── TestkitCypherTypeMapper.java │ │ │ ├── TestkitListDeserializer.java │ │ │ └── types │ │ │ ├── CypherDateTime.java │ │ │ ├── CypherTime.java │ │ │ └── CypherType.java │ │ └── responses │ │ ├── AuthTokenManager.java │ │ ├── AuthTokenManagerGetAuthRequest.java │ │ ├── AuthTokenManagerHandleSecurityExceptionRequest.java │ │ ├── AuthTokenProviderRequest.java │ │ ├── BackendError.java │ │ ├── BasicAuthTokenManager.java │ │ ├── BasicAuthTokenProviderRequest.java │ │ ├── BearerAuthTokenManager.java │ │ ├── BearerAuthTokenProviderRequest.java │ │ ├── BookmarkManager.java │ │ ├── Bookmarks.java │ │ ├── BookmarksConsumerRequest.java │ │ ├── BookmarksSupplierRequest.java │ │ ├── ClientCertificateProvider.java │ │ ├── ClientCertificateProviderRequest.java │ │ ├── ConnectionPoolMetrics.java │ │ ├── DomainNameResolutionRequired.java │ │ ├── Driver.java │ │ ├── DriverError.java │ │ ├── DriverIsAuthenticated.java │ │ ├── DriverIsEncrypted.java │ │ ├── EagerResult.java │ │ ├── FakeTimeAck.java │ │ ├── FeatureList.java │ │ ├── Field.java │ │ ├── FrontendError.java │ │ ├── GqlError.java │ │ ├── MultiDBSupport.java │ │ ├── NullRecord.java │ │ ├── Record.java │ │ ├── RecordList.java │ │ ├── ResolverResolutionRequired.java │ │ ├── Result.java │ │ ├── RetryableDone.java │ │ ├── RetryableTry.java │ │ ├── RoutingTable.java │ │ ├── RunSubTests.java │ │ ├── RunTest.java │ │ ├── Session.java │ │ ├── SessionAuthSupport.java │ │ ├── SkipTest.java │ │ ├── Summary.java │ │ ├── TestkitCallback.java │ │ ├── TestkitResponse.java │ │ ├── Transaction.java │ │ └── serializer │ │ ├── GenUtils.java │ │ ├── TestkitDateTimeValueSerializer.java │ │ ├── TestkitDateValueSerializer.java │ │ ├── TestkitDurationValueSerializer.java │ │ ├── TestkitListValueSerializer.java │ │ ├── TestkitLocalDateTimeValueSerializer.java │ │ ├── TestkitLocalTimeValueSerializer.java │ │ ├── TestkitMapValueSerializer.java │ │ ├── TestkitNodeValueSerializer.java │ │ ├── TestkitPathValueSerializer.java │ │ ├── TestkitRecordSerializer.java │ │ ├── TestkitRelationshipValueSerializer.java │ │ ├── TestkitTimeValueSerializer.java │ │ └── TestkitValueSerializer.java │ └── test │ └── java │ └── neo4j │ └── org │ └── testkit │ └── backend │ ├── MessageDeserializerTest.java │ └── MessageSerializerTest.java ├── testkit-tests ├── LICENSES.txt ├── NOTICE.txt ├── pom.xml └── src │ └── main │ └── docker │ ├── Dockerfile │ └── entrypoint.sh └── testkit ├── .dockerignore ├── Dockerfile ├── backend.py ├── build.py ├── integration.py ├── stress.py ├── testkit.json └── unittests.py /.gitattributes: -------------------------------------------------------------------------------- 1 | *.java eol=lf 2 | *.xml eol=lf 3 | 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | \#* 3 | target 4 | out 5 | .project 6 | .classpath 7 | .settings 8 | .externalToolBuilders/ 9 | .scala_dependencies 10 | .factorypath 11 | .cache 12 | *.iws 13 | *.ipr 14 | *.iml 15 | .idea 16 | .DS_Store 17 | .shell_history 18 | .mailmap 19 | .java-version 20 | community/server/data 21 | enterprise/server-enterprise/data 22 | advanced/server-advanced/data 23 | advanced/server-advanced/neo4j-home 24 | community/neo4j-harness/data 25 | community/server-plugin-test/neo4j-home 26 | enterprise/server-enterprise/neo4j-home 27 | integrationtests/data 28 | dependency-reduced-pom.xml 29 | venv 30 | testkit-backend/bin/ 31 | testkit/CAs/ 32 | testkit/CustomCAs/ 33 | bolt-connection 34 | -------------------------------------------------------------------------------- /.snyk: -------------------------------------------------------------------------------- 1 | # Snyk (https://snyk.io) policy file 2 | exclude: 3 | code: 4 | - testkit/** 5 | - testkit-backend/** 6 | - testkit-tests/** 7 | - driver/src/test/** 8 | -------------------------------------------------------------------------------- /LICENSES.txt: -------------------------------------------------------------------------------- 1 | This file contains the full license text of the included third party 2 | libraries. For an overview of the licenses see the NOTICE.txt file. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | -------------------------------------------------------------------------------- /benchkit-backend/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | Apache Software License, Version 2.0 22 | Jackson-annotations 23 | Jackson-core 24 | jackson-databind 25 | Neo4j Bolt Connection (Netty reference impl) 26 | Neo4j Bolt Connection (Pooled provider impl) 27 | Neo4j Bolt Connection (Provider SPI) 28 | Neo4j Bolt Connection (Routed provider impl) 29 | Netty/Buffer 30 | Netty/Codec 31 | Netty/Codec/HTTP 32 | Netty/Common 33 | Netty/Handler 34 | Netty/Resolver 35 | Netty/TomcatNative [OpenSSL - Classes] 36 | Netty/Transport 37 | Netty/Transport/Native/Unix/Common 38 | Non-Blocking Reactive Foundation for the JVM 39 | 40 | MIT No Attribution License 41 | reactive-streams 42 | 43 | -------------------------------------------------------------------------------- /benchkit-backend/src/main/java/neo4j/org/testkit/backend/request/WorkloadRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.request; 18 | 19 | import java.util.List; 20 | import java.util.Map; 21 | import lombok.Data; 22 | 23 | @Data 24 | public class WorkloadRequest { 25 | String method; 26 | List queries; 27 | String database; 28 | String routing; 29 | String mode; 30 | 31 | @Data 32 | public static class Query { 33 | String text; 34 | Map parameters; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /benchkit/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM maven:3.9.2-eclipse-temurin-17 as build 2 | COPY . /driver 3 | RUN cd /driver && mvn --show-version --batch-mode clean install -P !determine-revision -DskipTests 4 | 5 | FROM eclipse-temurin:17-jre 6 | COPY --from=build /driver/benchkit-backend/target/benchkit-backend.jar /benchkit-backend.jar 7 | CMD java -jar benchkit-backend.jar 8 | -------------------------------------------------------------------------------- /bundle/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | Apache Software License, Version 2.0 22 | Neo4j Bolt Connection (Netty reference impl) 23 | Neo4j Bolt Connection (Pooled provider impl) 24 | Neo4j Bolt Connection (Provider SPI) 25 | Neo4j Bolt Connection (Routed provider impl) 26 | Netty/Buffer 27 | Netty/Codec 28 | Netty/Common 29 | Netty/Handler 30 | Netty/Resolver 31 | Netty/TomcatNative [OpenSSL - Classes] 32 | Netty/Transport 33 | Netty/Transport/Native/Unix/Common 34 | Non-Blocking Reactive Foundation for the JVM 35 | 36 | MIT License 37 | SLF4J API Module 38 | 39 | MIT No Attribution License 40 | reactive-streams 41 | 42 | -------------------------------------------------------------------------------- /bundle/README.md: -------------------------------------------------------------------------------- 1 | Aggregator project for building the single JAR with shaded dependencies. 2 | 3 | This module aggregates neo4j-java-driver, unpacks it and repackages it. The sources are unpacked so that an individual JavaDoc artifact is produced, too. -------------------------------------------------------------------------------- /bundle/osgi.bnd: -------------------------------------------------------------------------------- 1 | package-version=${version;===;${Bundle-Version}} 2 | 3 | Export-Package: \ 4 | !org.neo4j.driver.internal.*, \ 5 | org.neo4j.driver.*;version="${package-version}" 6 | 7 | Import-Package: \ 8 | !org.neo4j.driver.internal.*, \ 9 | !io.netty.*, \ 10 | !reactor.*, \ 11 | !com.oracle.svm.*, \ 12 | javax.security.cert, \ 13 | * 14 | -------------------------------------------------------------------------------- /bundle/src/main/resources/META-INF/native-image/org.neo4j.driver/neo4j-java-driver/native-image.properties: -------------------------------------------------------------------------------- 1 | Args = -Dio.netty.noUnsafe=true \ 2 | -Dio.netty.leakDetection.level=DISABLED 3 | -------------------------------------------------------------------------------- /driver-it/LICENSES.txt: -------------------------------------------------------------------------------- 1 | This file contains the full license text of the included third party 2 | libraries. For an overview of the licenses see the NOTICE.txt file. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /driver-it/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | -------------------------------------------------------------------------------- /driver-it/jul-to-slf4j-log4j-it/LICENSES.txt: -------------------------------------------------------------------------------- 1 | This file contains the full license text of the included third party 2 | libraries. For an overview of the licenses see the NOTICE.txt file. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /driver-it/jul-to-slf4j-log4j-it/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | -------------------------------------------------------------------------------- /driver-it/jul-to-slf4j-logback-it/LICENSES.txt: -------------------------------------------------------------------------------- 1 | This file contains the full license text of the included third party 2 | libraries. For an overview of the licenses see the NOTICE.txt file. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /driver-it/jul-to-slf4j-logback-it/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | -------------------------------------------------------------------------------- /driver-it/jul-to-slf4j-logback-it/src/test/java/org/neo4j/driver/it/jul/to/slf4j/InMemoryAppender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.it.jul.to.slf4j; 18 | 19 | import ch.qos.logback.classic.spi.ILoggingEvent; 20 | import ch.qos.logback.core.AppenderBase; 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | 24 | final class InMemoryAppender extends AppenderBase { 25 | private final List logs = new ArrayList<>(); 26 | 27 | @Override 28 | protected void append(ILoggingEvent iLoggingEvent) { 29 | logs.add(iLoggingEvent); 30 | } 31 | 32 | List getLogs() { 33 | return logs; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /driver-it/log4j-it/LICENSES.txt: -------------------------------------------------------------------------------- 1 | This file contains the full license text of the included third party 2 | libraries. For an overview of the licenses see the NOTICE.txt file. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /driver-it/log4j-it/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | -------------------------------------------------------------------------------- /driver-it/slf4j-log4j-it/LICENSES.txt: -------------------------------------------------------------------------------- 1 | This file contains the full license text of the included third party 2 | libraries. For an overview of the licenses see the NOTICE.txt file. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /driver-it/slf4j-log4j-it/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | -------------------------------------------------------------------------------- /driver-it/slf4j-logback-it/LICENSES.txt: -------------------------------------------------------------------------------- 1 | This file contains the full license text of the included third party 2 | libraries. For an overview of the licenses see the NOTICE.txt file. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /driver-it/slf4j-logback-it/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | -------------------------------------------------------------------------------- /driver-it/slf4j-logback-it/src/test/java/org/neo4j/driver/it/slf4j/InMemoryAppender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.it.slf4j; 18 | 19 | import ch.qos.logback.classic.spi.ILoggingEvent; 20 | import ch.qos.logback.core.AppenderBase; 21 | import java.util.ArrayList; 22 | import java.util.List; 23 | 24 | final class InMemoryAppender extends AppenderBase { 25 | private final List logs = new ArrayList<>(); 26 | 27 | @Override 28 | protected void append(ILoggingEvent iLoggingEvent) { 29 | logs.add(iLoggingEvent); 30 | } 31 | 32 | List getLogs() { 33 | return logs; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /driver/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | Apache Software License, Version 2.0 22 | Neo4j Bolt Connection (Netty reference impl) 23 | Neo4j Bolt Connection (Pooled provider impl) 24 | Neo4j Bolt Connection (Provider SPI) 25 | Neo4j Bolt Connection (Routed provider impl) 26 | Netty/Buffer 27 | Netty/Codec 28 | Netty/Common 29 | Netty/Handler 30 | Netty/Resolver 31 | Netty/TomcatNative [OpenSSL - Classes] 32 | Netty/Transport 33 | Netty/Transport/Native/Unix/Common 34 | Non-Blocking Reactive Foundation for the JVM 35 | 36 | MIT License 37 | SLF4J API Module 38 | 39 | MIT No Attribution License 40 | reactive-streams 41 | 42 | -------------------------------------------------------------------------------- /driver/README.md: -------------------------------------------------------------------------------- 1 | Java driver core framework -------------------------------------------------------------------------------- /driver/osgi.bnd: -------------------------------------------------------------------------------- 1 | package-version=${version;===;${Bundle-Version}} 2 | 3 | Export-Package: \ 4 | !org.neo4j.driver.internal.*, \ 5 | org.neo4j.driver.*;version="${package-version}" 6 | 7 | Import-Package: \ 8 | !org.neo4j.driver.internal.*, \ 9 | !com.oracle.svm.*, \ 10 | javax.security.cert, \ 11 | * 12 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/BaseSession.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | /** 20 | * A base interface for sessions, used by {@link Driver#session(Class)} and {@link Driver#session(Class, SessionConfig)}. 21 | */ 22 | public interface BaseSession {} 23 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/ClientCertificate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | import org.neo4j.driver.internal.InternalClientCertificate; 20 | 21 | /** 22 | * An opaque container for client certificate used for mTLS. 23 | *

24 | * Use {@link ClientCertificates} to create new instances. 25 | * @since 5.19 26 | */ 27 | public sealed interface ClientCertificate permits InternalClientCertificate {} 28 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/Metrics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | import java.util.Collection; 20 | import org.neo4j.driver.util.Experimental; 21 | 22 | /** 23 | * Provides driver internal metrics. 24 | */ 25 | @Experimental 26 | public interface Metrics { 27 | /** 28 | * Connection pool metrics records metrics of connection pools that are currently in use. 29 | * As the connection pools are dynamically added and removed while the server topology changes, the metrics collection changes over time. 30 | * @return Connection pool metrics for all current active pools. 31 | */ 32 | Collection connectionPoolMetrics(); 33 | } 34 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/MetricsAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | /** 20 | * Defines which metrics consumer to use: Should metrics be consumed and exposed via driver's default consumer or provided with one of the external facades. 21 | */ 22 | public enum MetricsAdapter { 23 | /** 24 | * Disables metrics. 25 | */ 26 | DEV_NULL, 27 | 28 | /** 29 | * Consumes and publishes metrics via the driver itself. 30 | */ 31 | DEFAULT, 32 | 33 | /** 34 | * Consumes and publishes metrics via Micrometer. Ensure that Micrometer is on classpath when using this option. 35 | */ 36 | MICROMETER 37 | } 38 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/QueryRunner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | /** 20 | * An {@link AutoCloseable} extension of the {@link SimpleQueryRunner}. 21 | * 22 | * @since 1.0 23 | */ 24 | public interface QueryRunner extends SimpleQueryRunner, AutoCloseable {} 25 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/RotatingClientCertificateManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | /** 20 | * A {@link ClientCertificateManager} that supports rotating its {@link ClientCertificate}. 21 | * @since 5.19 22 | */ 23 | public sealed interface RotatingClientCertificateManager extends ClientCertificateManager 24 | permits org.neo4j.driver.internal.InternalRotatingClientCertificateManager { 25 | /** 26 | * Rotates the current {@link ClientCertificate}. 27 | * @param clientCertificate the new certificate, must not be {@literal null} 28 | */ 29 | void rotate(ClientCertificate clientCertificate); 30 | } 31 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/RoutingControl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | import java.io.Serializable; 20 | import org.neo4j.driver.internal.InternalRoutingControl; 21 | 22 | /** 23 | * Defines routing mode for query. 24 | * @since 5.5 25 | */ 26 | public sealed interface RoutingControl extends Serializable permits InternalRoutingControl { 27 | /** 28 | * Routes to the leader of the cluster. 29 | * @since 5.8 30 | */ 31 | RoutingControl WRITE = InternalRoutingControl.WRITE; 32 | /** 33 | * Routes to the followers in the cluster. 34 | * @since 5.8 35 | */ 36 | RoutingControl READ = InternalRoutingControl.READ; 37 | } 38 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/TransactionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | /** 20 | * Callback that executes operations in a given {@link TransactionContext}. 21 | * 22 | * @param the return type of this work. 23 | */ 24 | public interface TransactionCallback { 25 | /** 26 | * Executes all given operations in the same transaction context. 27 | * 28 | * @param context the transaction context to use. 29 | * @return result object or {@code null} if none. 30 | */ 31 | T execute(TransactionContext context); 32 | } 33 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/TransactionContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | /** 20 | * A context for running queries within transaction. 21 | */ 22 | public interface TransactionContext extends SimpleQueryRunner {} 23 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/async/AsyncTransactionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.async; 18 | 19 | /** 20 | * Callback that executes operations against a given {@link AsyncTransactionContext}. 21 | * 22 | * @param the return type of this work. 23 | */ 24 | public interface AsyncTransactionCallback { 25 | /** 26 | * Executes all given operations against the same transaction context. 27 | * 28 | * @param context the transaction context to use. 29 | * @return result object or {@code null} if none. 30 | */ 31 | T execute(AsyncTransactionContext context); 32 | } 33 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/async/AsyncTransactionContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.async; 18 | 19 | /** 20 | * A context for running queries within transaction. 21 | */ 22 | public interface AsyncTransactionContext extends AsyncQueryRunner {} 23 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/exceptions/GqlStatusErrorClassification.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.exceptions; 18 | 19 | /** 20 | * The GQLSTATUS error classification. 21 | *

22 | * The GQLSTATUS error classification is supplied by the server upon a failure, see 23 | * {@link Neo4jException#classification()} for more details. 24 | * @since 5.26.0 25 | * @see Neo4jException#classification() 26 | */ 27 | public enum GqlStatusErrorClassification { 28 | /** 29 | * Client error. 30 | */ 31 | CLIENT_ERROR, 32 | /** 33 | * Database error. 34 | */ 35 | DATABASE_ERROR, 36 | /** 37 | * Transient error. 38 | */ 39 | TRANSIENT_ERROR 40 | } 41 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/exceptions/RetryableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.exceptions; 18 | 19 | /** 20 | * A marker interface for retryable exceptions. 21 | *

22 | * This indicates whether an operation that resulted in retryable exception is worth retrying. 23 | * @since 5.0 24 | */ 25 | public interface RetryableException {} 26 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/exceptions/UntrustedServerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.exceptions; 18 | 19 | import java.io.Serial; 20 | 21 | /** 22 | * Thrown if the remote server cannot be verified as Neo4j. 23 | */ 24 | public class UntrustedServerException extends RuntimeException { 25 | @Serial 26 | private static final long serialVersionUID = 3196604305660766197L; 27 | 28 | /** 29 | * Creates a new instance. 30 | * @param message the message 31 | */ 32 | public UntrustedServerException(String message) { 33 | super(message); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/exceptions/value/NotMultiValued.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.exceptions.value; 18 | 19 | import java.io.Serial; 20 | 21 | /** 22 | * A NotMultiValued exception indicates that the value does not consist of multiple values, a.k.a. not a map 23 | * or array. 24 | * @since 1.0 25 | */ 26 | public class NotMultiValued extends ValueException { 27 | @Serial 28 | private static final long serialVersionUID = -7380569883011364090L; 29 | 30 | /** 31 | * Creates a new instance. 32 | * @param message the message 33 | */ 34 | public NotMultiValued(String message) { 35 | super(message); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/exceptions/value/Unsizable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.exceptions.value; 18 | 19 | import java.io.Serial; 20 | 21 | /** 22 | * An Unsizable exception indicates that the value does not have a size. 23 | * @since 1.0 24 | */ 25 | public class Unsizable extends ValueException { 26 | @Serial 27 | private static final long serialVersionUID = 741487155344252339L; 28 | 29 | /** 30 | * Creates a new instance. 31 | * @param message the message 32 | */ 33 | public Unsizable(String message) { 34 | super(message); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/AsValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal; 18 | 19 | import org.neo4j.driver.Value; 20 | 21 | public interface AsValue { 22 | /** 23 | * Retrieve a value representation of this 24 | * 25 | * @see Value 26 | * @return {@link Value} that represents this 27 | */ 28 | Value asValue(); 29 | } 30 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/BoltLoggingProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal; 18 | 19 | import org.neo4j.bolt.connection.LoggingProvider; 20 | import org.neo4j.driver.Logging; 21 | 22 | public class BoltLoggingProvider implements LoggingProvider { 23 | @SuppressWarnings("deprecation") 24 | private final Logging logging; 25 | 26 | public BoltLoggingProvider(@SuppressWarnings("deprecation") Logging logging) { 27 | this.logging = logging; 28 | } 29 | 30 | @Override 31 | public System.Logger getLog(Class cls) { 32 | return new BoltLogger(logging.getLog(cls)); 33 | } 34 | 35 | @Override 36 | public System.Logger getLog(String name) { 37 | return new BoltLogger(logging.getLog(name)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/DatabaseBookmark.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal; 18 | 19 | import org.neo4j.driver.Bookmark; 20 | 21 | public record DatabaseBookmark(String databaseName, Bookmark bookmark) {} 22 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/EagerResultValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal; 18 | 19 | import java.util.List; 20 | import org.neo4j.driver.EagerResult; 21 | import org.neo4j.driver.Record; 22 | import org.neo4j.driver.summary.ResultSummary; 23 | 24 | public record EagerResultValue(List keys, List records, ResultSummary summary) implements EagerResult {} 25 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/FailableCursor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal; 18 | 19 | import java.util.concurrent.CompletionStage; 20 | 21 | public interface FailableCursor { 22 | /** 23 | * Discarding all unconsumed records and returning failure if there is any pull errors. 24 | */ 25 | CompletionStage discardAllFailureAsync(); 26 | 27 | /** 28 | * Pulling all unconsumed records into memory and returning failure if there is any pull errors. 29 | */ 30 | CompletionStage pullAllFailureAsync(); 31 | 32 | CompletionStage consumed(); 33 | } 34 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/IdentityResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal; 18 | 19 | import static java.util.Collections.singleton; 20 | 21 | import java.io.Serial; 22 | import java.util.Set; 23 | import org.neo4j.driver.net.ServerAddress; 24 | import org.neo4j.driver.net.ServerAddressResolver; 25 | 26 | public class IdentityResolver implements ServerAddressResolver { 27 | public static final IdentityResolver IDENTITY_RESOLVER = new IdentityResolver(); 28 | 29 | @Serial 30 | private static final long serialVersionUID = -881546487990290715L; 31 | 32 | private IdentityResolver() {} 33 | 34 | @Override 35 | public Set resolve(ServerAddress initialRouter) { 36 | return singleton(initialRouter); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/InternalBookmark.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal; 18 | 19 | import static java.util.Objects.requireNonNull; 20 | 21 | import java.io.Serializable; 22 | import org.neo4j.driver.Bookmark; 23 | 24 | public record InternalBookmark(String value) implements Bookmark, Serializable { 25 | public InternalBookmark { 26 | requireNonNull(value); 27 | if (value.isEmpty()) { 28 | throw new IllegalArgumentException("The value must not be empty"); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/InternalClientCertificate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal; 18 | 19 | import java.io.File; 20 | import org.neo4j.driver.ClientCertificate; 21 | 22 | public record InternalClientCertificate(File certificate, File privateKey, String password) 23 | implements ClientCertificate {} 24 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/RoutingSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal; 18 | 19 | import static java.util.concurrent.TimeUnit.SECONDS; 20 | 21 | import org.neo4j.bolt.connection.RoutingContext; 22 | 23 | public record RoutingSettings(long routingTablePurgeDelayMs, RoutingContext routingContext) { 24 | public static final long STALE_ROUTING_TABLE_PURGE_DELAY_MS = SECONDS.toMillis(30); 25 | } 26 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/adaptedbolt/summary/DiscardSummary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.adaptedbolt.summary; 18 | 19 | import java.util.Map; 20 | import org.neo4j.driver.Value; 21 | 22 | public interface DiscardSummary { 23 | Map metadata(); 24 | } 25 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/adaptedbolt/summary/PullSummary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.adaptedbolt.summary; 18 | 19 | import java.util.Map; 20 | import org.neo4j.driver.Value; 21 | 22 | public interface PullSummary { 23 | boolean hasMore(); 24 | 25 | Map metadata(); 26 | } 27 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/async/ConnectionContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.async; 18 | 19 | import java.util.Set; 20 | import java.util.concurrent.CompletableFuture; 21 | import org.neo4j.bolt.connection.DatabaseName; 22 | import org.neo4j.driver.AuthToken; 23 | import org.neo4j.driver.Bookmark; 24 | 25 | public interface ConnectionContext { 26 | 27 | CompletableFuture databaseNameFuture(); 28 | 29 | Set rediscoveryBookmarks(); 30 | 31 | String impersonatedUser(); 32 | 33 | AuthToken overrideAuthToken(); 34 | } 35 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/async/ErrorMappingResponseHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.async; 18 | 19 | import java.util.Objects; 20 | import java.util.function.Function; 21 | import org.neo4j.driver.internal.adaptedbolt.DriverResponseHandler; 22 | 23 | final class ErrorMappingResponseHandler extends DelegatingResponseHandler { 24 | private final Function errorMapper; 25 | 26 | ErrorMappingResponseHandler(DriverResponseHandler delegate, Function errorMapper) { 27 | super(delegate); 28 | this.errorMapper = Objects.requireNonNull(errorMapper); 29 | } 30 | 31 | @Override 32 | public void onError(Throwable throwable) { 33 | delegate.onError(errorMapper.apply(throwable)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/async/TerminationAwareStateLockingExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.async; 18 | 19 | import java.util.function.Consumer; 20 | import java.util.function.Function; 21 | 22 | @FunctionalInterface 23 | public interface TerminationAwareStateLockingExecutor { 24 | /** 25 | * Locks the state and executes the supplied {@link Consumer} with a cause of termination if the state is terminated. 26 | * 27 | * @param causeOfTerminationConsumer the consumer accepting 28 | */ 29 | T execute(Function causeOfTerminationConsumer); 30 | } 31 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/blockhound/Neo4jDriverBlockHoundIntegration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.blockhound; 18 | 19 | import org.neo4j.driver.internal.util.LockUtil; 20 | import org.neo4j.driver.util.Experimental; 21 | import reactor.blockhound.BlockHound; 22 | import reactor.blockhound.integration.BlockHoundIntegration; 23 | 24 | @Experimental 25 | public class Neo4jDriverBlockHoundIntegration implements BlockHoundIntegration { 26 | @Override 27 | public void applyTo(BlockHound.Builder builder) { 28 | var lockUtilName = LockUtil.class.getName(); 29 | builder.allowBlockingCallsInside(lockUtilName, "lock"); 30 | builder.allowBlockingCallsInside(lockUtilName, "unlock"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/boltlistener/BoltConnectionListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.boltlistener; 18 | 19 | import org.neo4j.bolt.connection.BoltConnection; 20 | import org.neo4j.bolt.connection.BoltConnectionProvider; 21 | 22 | public interface BoltConnectionListener { 23 | void onOpen(BoltConnection boltConnection); 24 | 25 | void onClose(BoltConnection boltConnection); 26 | 27 | static BoltConnectionProvider listeningBoltConnectionProvider( 28 | BoltConnectionProvider provider, BoltConnectionListener boltConnectionListener) { 29 | return new ListeningBoltConnectionProvider(provider, boltConnectionListener); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/homedb/DriverHomeDatabaseCacheKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.homedb; 18 | 19 | final class DriverHomeDatabaseCacheKey implements HomeDatabaseCacheKey { 20 | static final DriverHomeDatabaseCacheKey INSTANCE = new DriverHomeDatabaseCacheKey(); 21 | } 22 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/homedb/HomeDatabaseCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.homedb; 18 | 19 | import java.time.Clock; 20 | import java.util.Optional; 21 | import org.neo4j.driver.internal.boltlistener.BoltConnectionListener; 22 | 23 | public interface HomeDatabaseCache extends BoltConnectionListener { 24 | Optional get(HomeDatabaseCacheKey key); 25 | 26 | void put(HomeDatabaseCacheKey key, String value); 27 | 28 | static HomeDatabaseCache newInstance(boolean routed) { 29 | return routed ? new HomeDatabaseCacheImpl(1000, Clock.systemUTC()) : new NoopHomeDatabaseCache(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/homedb/MapHomeDatabaseCacheKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.homedb; 18 | 19 | import java.util.Map; 20 | 21 | record MapHomeDatabaseCacheKey(Map map) implements HomeDatabaseCacheKey {} 22 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/homedb/NoopHomeDatabaseCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.homedb; 18 | 19 | import java.util.Optional; 20 | import org.neo4j.bolt.connection.BoltConnection; 21 | 22 | final class NoopHomeDatabaseCache implements HomeDatabaseCache { 23 | @Override 24 | public Optional get(HomeDatabaseCacheKey key) { 25 | return Optional.empty(); 26 | } 27 | 28 | @Override 29 | public void put(HomeDatabaseCacheKey key, String value) {} 30 | 31 | @Override 32 | public void onOpen(BoltConnection boltConnection) {} 33 | 34 | @Override 35 | public void onClose(BoltConnection boltConnection) {} 36 | } 37 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/logging/SystemLogging.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.logging; 18 | 19 | import java.io.Serial; 20 | import org.neo4j.driver.Logger; 21 | import org.neo4j.driver.Logging; 22 | 23 | @SuppressWarnings("deprecation") 24 | public final class SystemLogging implements Logging { 25 | public static final SystemLogging INSTANCE = new SystemLogging(); 26 | 27 | @Serial 28 | private static final long serialVersionUID = -2244895422671419713L; 29 | 30 | @Override 31 | public Logger getLog(Class clazz) { 32 | return new SystemLogger(System.getLogger(clazz.getName())); 33 | } 34 | 35 | @Override 36 | public Logger getLog(String name) { 37 | return new SystemLogger(System.getLogger(name)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/metrics/DevNullListenerEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.metrics; 18 | 19 | import org.neo4j.bolt.connection.ListenerEvent; 20 | 21 | enum DevNullListenerEvent implements ListenerEvent { 22 | INSTANCE; 23 | 24 | @Override 25 | public void start() {} 26 | 27 | @Override 28 | public Long getSample() { 29 | return 0L; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/metrics/MetricsProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.metrics; 18 | 19 | import org.neo4j.bolt.connection.MetricsListener; 20 | import org.neo4j.driver.Metrics; 21 | 22 | /** 23 | * An adapter that collects driver metrics via {@link MetricsListener} and publishes them via {@link Metrics} instance. 24 | */ 25 | public interface MetricsProvider { 26 | /** 27 | * @return The actual metrics type to use 28 | */ 29 | Metrics metrics(); 30 | 31 | /** 32 | * @return A listener that will be notified on certain events so that it can collect metrics about them. 33 | */ 34 | MetricsListener metricsListener(); 35 | } 36 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/metrics/TimeRecorderListenerEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.metrics; 18 | 19 | import java.time.Clock; 20 | import org.neo4j.bolt.connection.ListenerEvent; 21 | 22 | final class TimeRecorderListenerEvent implements ListenerEvent { 23 | private final Clock clock; 24 | private long startTime; 25 | 26 | TimeRecorderListenerEvent(Clock clock) { 27 | this.clock = clock; 28 | } 29 | 30 | @Override 31 | public void start() { 32 | startTime = clock.millis(); 33 | } 34 | 35 | @Override 36 | public Long getSample() { 37 | return clock.millis() - startTime; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/retry/RetryLogic.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.retry; 18 | 19 | import java.util.concurrent.CompletionStage; 20 | import java.util.function.Supplier; 21 | import org.reactivestreams.Publisher; 22 | 23 | public interface RetryLogic { 24 | T retry(Supplier work); 25 | 26 | CompletionStage retryAsync(Supplier> work); 27 | 28 | Publisher retryRx(Publisher work); 29 | } 30 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/retry/RetrySettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.retry; 18 | 19 | import java.io.Serial; 20 | import java.io.Serializable; 21 | 22 | public record RetrySettings(long maxRetryTimeMs) implements Serializable { 23 | @Serial 24 | private static final long serialVersionUID = -2895062473220745239L; 25 | 26 | public static final RetrySettings DEFAULT = 27 | new RetrySettings(ExponentialBackoffRetryLogic.DEFAULT_MAX_RETRY_TIME_MS); 28 | } 29 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/security/BoltSecurityPlanManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.security; 18 | 19 | import java.util.concurrent.CompletionStage; 20 | import org.neo4j.bolt.connection.SecurityPlan; 21 | 22 | public interface BoltSecurityPlanManager { 23 | CompletionStage plan(); 24 | 25 | boolean requiresEncryption(); 26 | 27 | static BoltSecurityPlanManager from(org.neo4j.driver.internal.security.SecurityPlan securityPlan) { 28 | return new InternalBoltSecurityPlanManager(securityPlan); 29 | } 30 | 31 | static BoltSecurityPlanManager insecure() { 32 | return new InternalBoltSecurityPlanManager(SecurityPlanImpl.insecure()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/security/InternalAuthTokenAndExpiration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.security; 18 | 19 | import org.neo4j.driver.AuthToken; 20 | import org.neo4j.driver.AuthTokenAndExpiration; 21 | 22 | public record InternalAuthTokenAndExpiration(AuthToken authToken, long expirationTimestamp) 23 | implements AuthTokenAndExpiration {} 24 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/value/NumberValueAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.value; 18 | 19 | public abstract class NumberValueAdapter extends ValueAdapter { 20 | @Override 21 | public final V asObject() { 22 | return asNumber(); 23 | } 24 | 25 | @Override 26 | public abstract V asNumber(); 27 | } 28 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/value/mapping/Argument.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.value.mapping; 18 | 19 | import java.lang.reflect.Type; 20 | import org.neo4j.driver.internal.value.InternalValue; 21 | 22 | record Argument(String propertyName, Type type, InternalValue value) {} 23 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/value/mapping/MapAccessorMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.value.mapping; 18 | 19 | import org.neo4j.driver.types.MapAccessor; 20 | 21 | public interface MapAccessorMapper { 22 | 23 | boolean supports(MapAccessor mapAccessor, Class targetClass); 24 | 25 | T map(MapAccessor mapAccessor, Class targetClass); 26 | } 27 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/internal/value/mapping/ObjectMetadata.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.value.mapping; 18 | 19 | import java.lang.reflect.Constructor; 20 | import java.util.List; 21 | 22 | record ObjectMetadata(Constructor constructor, List arguments) {} 23 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/mapping/Property.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.mapping; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | import org.neo4j.driver.util.Preview; 24 | 25 | /** 26 | * Defines property name that should be mapped to the annotated parameter. 27 | * 28 | * @since 5.28.5 29 | */ 30 | @Target({ElementType.PARAMETER, ElementType.RECORD_COMPONENT}) 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Preview(name = "Object mapping") 33 | public @interface Property { 34 | /** 35 | * The property name that should be mapped to the annotated parameter. 36 | * 37 | * @return the property name 38 | */ 39 | String value(); 40 | } 41 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/reactive/ReactiveTransactionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.reactive; 18 | 19 | /** 20 | * Callback that executes operations against a given {@link ReactiveTransactionContext}. 21 | * 22 | * @param the return type of this work. 23 | * @since 5.0 24 | */ 25 | public interface ReactiveTransactionCallback { 26 | /** 27 | * Executes all given operations against the same transaction context. 28 | * 29 | * @param context the transaction context to use. 30 | * @return result object or {@code null} if none. 31 | */ 32 | T execute(ReactiveTransactionContext context); 33 | } 34 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/reactive/ReactiveTransactionContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.reactive; 18 | 19 | /** 20 | * A context for running queries within transaction. 21 | * 22 | * @since 5.0 23 | */ 24 | public interface ReactiveTransactionContext extends ReactiveQueryRunner {} 25 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/reactivestreams/ReactiveTransactionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.reactivestreams; 18 | 19 | /** 20 | * Callback that executes operations against a given {@link ReactiveTransactionContext}. 21 | * 22 | * @param the return type of this work. 23 | * @since 5.2 24 | */ 25 | public interface ReactiveTransactionCallback { 26 | /** 27 | * Executes all given operations against the same transaction context. 28 | * 29 | * @param context the transaction context to use. 30 | * @return result object or {@code null} if none. 31 | */ 32 | T execute(ReactiveTransactionContext context); 33 | } 34 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/reactivestreams/ReactiveTransactionContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.reactivestreams; 18 | 19 | /** 20 | * A context for running queries within transaction. 21 | * 22 | * @since 5.2 23 | */ 24 | public interface ReactiveTransactionContext extends ReactiveQueryRunner {} 25 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/summary/DatabaseInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.summary; 18 | 19 | /** 20 | * Provides basic information about where a {@link ResultSummary} is obtained from. 21 | */ 22 | public interface DatabaseInfo { 23 | /** 24 | * The name of the database where a {@link ResultSummary} is obtained from. 25 | * Default to {@code null} if servers does not support multi-databases. 26 | * @return the name of the database where a {@link ResultSummary} is obtained from 27 | */ 28 | String name(); 29 | } 30 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/types/Node.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.types; 18 | 19 | /** 20 | * The Node interface describes the characteristics of a node from a Neo4j graph. 21 | * @since 1.0 22 | */ 23 | public interface Node extends Entity { 24 | /** 25 | * Return all labels. 26 | * 27 | * @return a label Collection 28 | */ 29 | Iterable labels(); 30 | 31 | /** 32 | * Test if this node has a given label 33 | * 34 | * @param label the label 35 | * @return {@code true} if this node has the label otherwise {@code false} 36 | */ 37 | boolean hasLabel(String label); 38 | } 39 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/types/Type.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.types; 18 | 19 | import org.neo4j.driver.Value; 20 | import org.neo4j.driver.util.Immutable; 21 | 22 | /** 23 | * The type of {@link Value} as defined by the Cypher language 24 | * @since 1.0 25 | */ 26 | @Immutable 27 | public interface Type { 28 | /** 29 | * Returns the name of the Cypher type (as defined by Cypher). 30 | * 31 | * @return the name of the Cypher type (as defined by Cypher) 32 | */ 33 | String name(); 34 | 35 | /** 36 | * Test if the given value has this type. 37 | * 38 | * @param value the value 39 | * @return {@code true} if the value is a value of this type otherwise {@code false} 40 | */ 41 | boolean isTypeOf(Value value); 42 | } 43 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/util/Experimental.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.util; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * Annotated elements are experimental and may change without deprecation across driver releases. 28 | * @since 1.0 29 | */ 30 | @Inherited 31 | @Retention(RetentionPolicy.RUNTIME) 32 | @Documented 33 | @Target({ElementType.TYPE, ElementType.METHOD}) 34 | public @interface Experimental {} 35 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/util/Immutable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.util; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Inherited; 22 | import java.lang.annotation.Retention; 23 | import java.lang.annotation.RetentionPolicy; 24 | import java.lang.annotation.Target; 25 | 26 | /** 27 | * Indicates that instances of the annotated class or of its subclasses are immutable, i.e. 28 | * do not provide any means of mutating their state 29 | * @since 1.0 30 | */ 31 | @Inherited 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Documented 34 | @Target({ElementType.TYPE}) 35 | public @interface Immutable {} 36 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/util/Pair.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.util; 18 | 19 | /** 20 | * Immutable pair of a key and a value 21 | * 22 | * @param the Java type of the key 23 | * @param the Java type of the contained value 24 | * @since 1.0 25 | */ 26 | @Immutable 27 | public interface Pair { 28 | /** 29 | * Returns the property key. 30 | * 31 | * @return the property key 32 | */ 33 | K key(); 34 | 35 | /** 36 | * Returns the property value. 37 | * 38 | * @return the property value 39 | */ 40 | V value(); 41 | } 42 | -------------------------------------------------------------------------------- /driver/src/main/java/org/neo4j/driver/util/Resource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.util; 18 | 19 | /** 20 | * A Resource is an {@link AutoCloseable} that allows introspecting if it 21 | * already has been closed through its {@link #isOpen()} method. 22 | * 23 | * @since 1.0 24 | */ 25 | public interface Resource extends AutoCloseable { 26 | /** 27 | * Detect whether this resource is still open 28 | * 29 | * @return true if the resource is open 30 | */ 31 | boolean isOpen(); 32 | 33 | @Override 34 | void close() throws RuntimeException; 35 | } 36 | -------------------------------------------------------------------------------- /driver/src/main/resources/META-INF/native-image/org.neo4j.driver/neo4j-java-driver/native-image.properties: -------------------------------------------------------------------------------- 1 | Args = -Dio.netty.noUnsafe=true \ 2 | -Dio.netty.leakDetection.level=DISABLED 3 | -------------------------------------------------------------------------------- /driver/src/main/resources/META-INF/services/reactor.blockhound.integration.BlockHoundIntegration: -------------------------------------------------------------------------------- 1 | # Copyright (c) "Neo4j" 2 | # Neo4j Sweden AB [http://neo4j.com] 3 | # 4 | # This file is part of Neo4j. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | 18 | org.neo4j.driver.internal.blockhound.Neo4jDriverBlockHoundIntegration 19 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/BookmarkManagersTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | import static org.junit.jupiter.api.Assertions.assertTrue; 20 | 21 | import org.junit.jupiter.api.Test; 22 | import org.neo4j.driver.internal.Neo4jBookmarkManager; 23 | 24 | class BookmarkManagersTest { 25 | @Test 26 | void shouldCreateDefaultBookmarkManager() { 27 | // GIVEN 28 | var config = BookmarkManagerConfig.builder().build(); 29 | 30 | // WHEN 31 | var bookmarkManager = BookmarkManagers.defaultManager(config); 32 | 33 | // THEN 34 | assertTrue(bookmarkManager instanceof Neo4jBookmarkManager); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/ClientCertificateManagersTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver; 18 | 19 | import static org.junit.jupiter.api.Assertions.assertNotNull; 20 | import static org.mockito.Mockito.mock; 21 | 22 | import java.io.File; 23 | import org.junit.jupiter.api.Test; 24 | 25 | class ClientCertificateManagersTest { 26 | @Test 27 | void shoudReturnRotatingManager() { 28 | var file = mock(File.class); 29 | var certificate = ClientCertificates.of(file, file); 30 | var manager = ClientCertificateManagers.rotating(certificate); 31 | 32 | assertNotNull(manager); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/internal/summary/InternalInputPositionTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.summary; 18 | 19 | import static org.hamcrest.CoreMatchers.equalTo; 20 | import static org.hamcrest.MatcherAssert.assertThat; 21 | 22 | import org.junit.jupiter.api.Test; 23 | 24 | class InternalInputPositionTest { 25 | @Test 26 | void shouldBehaveAsExpected() { 27 | // GIVEN, WHEN 28 | var position = new InternalInputPosition(0, 2, 1); 29 | 30 | // THEN 31 | assertThat(position.offset(), equalTo(0)); 32 | assertThat(position.column(), equalTo(1)); 33 | assertThat(position.line(), equalTo(2)); 34 | assertThat(position.toString(), equalTo("offset=0, line=2, column=1")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/internal/util/DisabledOnNeo4jWith.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.util; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | import org.junit.jupiter.api.extension.ExtendWith; 25 | 26 | @Target({ElementType.TYPE, ElementType.METHOD}) 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Documented 29 | @ExtendWith(Neo4jWithFeatureCondition.class) 30 | public @interface DisabledOnNeo4jWith { 31 | Neo4jFeature value(); 32 | } 33 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/internal/util/DriverFactoryWithClock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.util; 18 | 19 | import java.time.Clock; 20 | import org.neo4j.driver.internal.DriverFactory; 21 | 22 | public class DriverFactoryWithClock extends DriverFactory { 23 | private final Clock clock; 24 | 25 | public DriverFactoryWithClock(Clock clock) { 26 | this.clock = clock; 27 | } 28 | 29 | @Override 30 | protected Clock createClock() { 31 | return clock; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/internal/util/EnabledOnNeo4jWith.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.util; 18 | 19 | import java.lang.annotation.Documented; 20 | import java.lang.annotation.ElementType; 21 | import java.lang.annotation.Retention; 22 | import java.lang.annotation.RetentionPolicy; 23 | import java.lang.annotation.Target; 24 | import org.junit.jupiter.api.extension.ExtendWith; 25 | 26 | @Target({ElementType.TYPE, ElementType.METHOD}) 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Documented 29 | @ExtendWith(Neo4jWithFeatureCondition.class) 30 | public @interface EnabledOnNeo4jWith { 31 | Neo4jFeature value(); 32 | 33 | Neo4jEdition edition() default Neo4jEdition.UNDEFINED; 34 | } 35 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/internal/util/Neo4jEdition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.util; 18 | 19 | public enum Neo4jEdition { 20 | UNDEFINED("n/a"), 21 | ENTERPRISE("enterprise"); 22 | 23 | private final String value; 24 | 25 | Neo4jEdition(String value) { 26 | this.value = value; 27 | } 28 | 29 | public boolean matches(String otherValue) { 30 | if (this == UNDEFINED) { 31 | return true; 32 | } else { 33 | return this.value.equals(otherValue); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/internal/value/PointValueTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.internal.value; 18 | 19 | import static org.junit.jupiter.api.Assertions.assertEquals; 20 | import static org.mockito.Mockito.mock; 21 | 22 | import org.junit.jupiter.api.Test; 23 | import org.neo4j.driver.Values; 24 | import org.neo4j.driver.types.Point; 25 | 26 | class PointValueTest { 27 | 28 | @Test 29 | void shouldMapToType() { 30 | var point = mock(Point.class); 31 | var values = Values.value(point); 32 | assertEquals(point, values.as(Point.class)); 33 | assertEquals(point, values.as(Object.class)); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/stress/AsyncCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.stress; 18 | 19 | import java.util.concurrent.CompletionStage; 20 | 21 | public interface AsyncCommand { 22 | CompletionStage execute(C context); 23 | } 24 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/stress/BlockingCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.stress; 18 | 19 | public interface BlockingCommand { 20 | void execute(C context); 21 | } 22 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/stress/RxCommand.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.stress; 18 | 19 | import java.util.concurrent.CompletionStage; 20 | 21 | public interface RxCommand { 22 | CompletionStage execute(C context); 23 | } 24 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/testutil/BlockHoundTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.testutil; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | import org.junit.jupiter.api.Tag; 24 | 25 | @Target(ElementType.TYPE) 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Tag("blockHoundTest") 28 | public @interface BlockHoundTest {} 29 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/testutil/FileTools.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.testutil; 18 | 19 | import static java.io.File.createTempFile; 20 | 21 | import java.io.File; 22 | 23 | public class FileTools { 24 | public static File tempFile(String prefix, String suffix) throws Throwable { 25 | var file = createTempFile(prefix, suffix); 26 | file.deleteOnExit(); 27 | return file; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /driver/src/test/java/org/neo4j/driver/testutil/ParallelizableIT.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.driver.testutil; 18 | 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | import org.junit.jupiter.api.Tag; 24 | 25 | /** 26 | * Marker annotation for the Maven Failsafe plugin saying that the annotated test class can be executed in parallel with other tests. 27 | * It will get executed in a separately forked JVM. All tests will be split between a fixed number of JVMs. 28 | */ 29 | @Target(ElementType.TYPE) 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Tag("parallelizableIT") 32 | public @interface ParallelizableIT {} 33 | -------------------------------------------------------------------------------- /driver/src/test/resources/keystore.jks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j/neo4j-java-driver/88fc56e084e91d068cfb7eb980dcab8b4925ad6d/driver/src/test/resources/keystore.jks -------------------------------------------------------------------------------- /driver/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /driver/src/test/resources/longRunningStatement.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/neo4j/neo4j-java-driver/88fc56e084e91d068cfb7eb980dcab8b4925ad6d/driver/src/test/resources/longRunningStatement.jar -------------------------------------------------------------------------------- /driver/src/test/resources/nginx.conf: -------------------------------------------------------------------------------- 1 | user nginx; 2 | worker_processes auto; 3 | 4 | error_log /var/log/nginx/error.log notice; 5 | pid /var/run/nginx.pid; 6 | 7 | 8 | events { 9 | worker_connections 1024; 10 | } 11 | 12 | stream { 13 | server { 14 | resolver 127.0.0.11 ipv6=off; 15 | 16 | set $upstream neo4j:7687; 17 | 18 | listen 7687; 19 | proxy_pass $upstream; 20 | } 21 | 22 | server { 23 | resolver 127.0.0.11 ipv6=off; 24 | 25 | set $upstream neo4j:7474; 26 | 27 | listen 7474; 28 | proxy_pass $upstream; 29 | } 30 | } -------------------------------------------------------------------------------- /examples/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | Apache Software License, Version 2.0 22 | Neo4j Bolt Connection (Netty reference impl) 23 | Neo4j Bolt Connection (Pooled provider impl) 24 | Neo4j Bolt Connection (Provider SPI) 25 | Neo4j Bolt Connection (Routed provider impl) 26 | Netty/Buffer 27 | Netty/Codec 28 | Netty/Common 29 | Netty/Handler 30 | Netty/Resolver 31 | Netty/TomcatNative [OpenSSL - Classes] 32 | Netty/Transport 33 | Netty/Transport/Native/Unix/Common 34 | Non-Blocking Reactive Foundation for the JVM 35 | 36 | MIT No Attribution License 37 | reactive-streams 38 | 39 | -------------------------------------------------------------------------------- /examples/src/main/java/org/neo4j/docs/driver/AutocommitTransactionExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.docs.driver; 18 | 19 | import static org.neo4j.driver.Values.parameters; 20 | 21 | public class AutocommitTransactionExample extends BaseApplication { 22 | public AutocommitTransactionExample(String uri, String user, String password) { 23 | super(uri, user, password); 24 | } 25 | 26 | // tag::autocommit-transaction[] 27 | public void addPerson(String name) { 28 | try (var session = driver.session()) { 29 | session.run("CREATE (a:Person {name: $name})", parameters("name", name)); 30 | } 31 | } 32 | // end::autocommit-transaction[] 33 | } 34 | -------------------------------------------------------------------------------- /examples/src/main/java/org/neo4j/docs/driver/BaseApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.docs.driver; 18 | 19 | import org.neo4j.driver.AuthTokens; 20 | import org.neo4j.driver.Driver; 21 | import org.neo4j.driver.GraphDatabase; 22 | 23 | public abstract class BaseApplication implements AutoCloseable { 24 | protected final Driver driver; 25 | 26 | public BaseApplication(String uri, String user, String password) { 27 | driver = GraphDatabase.driver(uri, AuthTokens.basic(user, password)); 28 | } 29 | 30 | @Override 31 | public void close() throws RuntimeException { 32 | driver.close(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /examples/src/main/java/org/neo4j/docs/driver/DriverLifecycleExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.docs.driver; 18 | 19 | // tag::driver-lifecycle-import[] 20 | import org.neo4j.driver.AuthTokens; 21 | import org.neo4j.driver.Driver; 22 | import org.neo4j.driver.GraphDatabase; 23 | // end::driver-lifecycle-import[] 24 | 25 | // tag::driver-lifecycle[] 26 | public class DriverLifecycleExample implements AutoCloseable { 27 | private final Driver driver; 28 | 29 | public DriverLifecycleExample(String uri, String user, String password) { 30 | driver = GraphDatabase.driver(uri, AuthTokens.basic(user, password)); 31 | } 32 | 33 | @Override 34 | public void close() throws RuntimeException { 35 | driver.close(); 36 | } 37 | } 38 | // end::driver-lifecycle[] 39 | -------------------------------------------------------------------------------- /examples/src/main/java/org/neo4j/docs/driver/KerberosAuthExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.docs.driver; 18 | 19 | // tag::kerberos-auth-import[] 20 | import org.neo4j.driver.AuthTokens; 21 | import org.neo4j.driver.Driver; 22 | import org.neo4j.driver.GraphDatabase; 23 | // end::kerberos-auth-import[] 24 | 25 | @SuppressWarnings("unused") 26 | public class KerberosAuthExample implements AutoCloseable { 27 | private final Driver driver; 28 | 29 | // tag::kerberos-auth[] 30 | public KerberosAuthExample(String uri, String ticket) { 31 | driver = GraphDatabase.driver(uri, AuthTokens.kerberos(ticket)); 32 | } 33 | // end::kerberos-auth[] 34 | 35 | @Override 36 | public void close() throws RuntimeException { 37 | driver.close(); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/src/main/java/org/neo4j/docs/driver/TransactionFunctionExample.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package org.neo4j.docs.driver; 18 | 19 | import static org.neo4j.driver.Values.parameters; 20 | 21 | public class TransactionFunctionExample extends BaseApplication { 22 | public TransactionFunctionExample(String uri, String user, String password) { 23 | super(uri, user, password); 24 | } 25 | 26 | // tag::transaction-function[] 27 | public void addPerson(final String name) { 28 | try (var session = driver.session()) { 29 | session.executeWriteWithoutResult(tx -> tx.run("CREATE (a:Person {name: $name})", parameters("name", name)).consume()); 30 | } 31 | } 32 | // end::transaction-function[] 33 | } 34 | -------------------------------------------------------------------------------- /examples/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | target/test.log 4 | 5 | %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /testkit-backend/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | Apache Software License, Version 2.0 22 | Jackson-annotations 23 | Jackson-core 24 | jackson-databind 25 | Neo4j Bolt Connection (Netty reference impl) 26 | Neo4j Bolt Connection (Pooled provider impl) 27 | Neo4j Bolt Connection (Provider SPI) 28 | Neo4j Bolt Connection (Routed provider impl) 29 | Netty/Buffer 30 | Netty/Codec 31 | Netty/Common 32 | Netty/Handler 33 | Netty/Resolver 34 | Netty/TomcatNative [OpenSSL - Classes] 35 | Netty/Transport 36 | Netty/Transport/Native/Unix/Common 37 | Non-Blocking Reactive Foundation for the JVM 38 | 39 | MIT No Attribution License 40 | reactive-streams 41 | 42 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/CustomDriverError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend; 18 | 19 | import java.io.Serial; 20 | 21 | public class CustomDriverError extends RuntimeException { 22 | @Serial 23 | private static final long serialVersionUID = 2979071989786663535L; 24 | 25 | public CustomDriverError(Throwable cause) { 26 | super(cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/FrontendError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend; 18 | 19 | import java.io.Serial; 20 | 21 | public class FrontendError extends RuntimeException { 22 | @Serial 23 | private static final long serialVersionUID = -8369933385092563391L; 24 | } 25 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/AbstractSessionHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import java.util.concurrent.CompletableFuture; 20 | import lombok.Getter; 21 | import lombok.RequiredArgsConstructor; 22 | import lombok.Setter; 23 | import org.neo4j.driver.SessionConfig; 24 | 25 | @RequiredArgsConstructor 26 | @Getter 27 | public abstract class AbstractSessionHolder { 28 | public final DriverHolder driverHolder; 29 | public final T session; 30 | public final SessionConfig config; 31 | 32 | @Setter 33 | public CompletableFuture txWorkFuture; 34 | } 35 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/AbstractTransactionHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import lombok.Getter; 20 | import lombok.RequiredArgsConstructor; 21 | 22 | @RequiredArgsConstructor 23 | @Getter 24 | public abstract class AbstractTransactionHolder { 25 | private final T1 sessionHolder; 26 | private final T2 transaction; 27 | } 28 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/AsyncSessionHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.SessionConfig; 20 | import org.neo4j.driver.async.AsyncSession; 21 | 22 | public class AsyncSessionHolder extends AbstractSessionHolder { 23 | public AsyncSessionHolder(DriverHolder driverHolder, AsyncSession session, SessionConfig config) { 24 | super(driverHolder, session, config); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/AsyncTransactionHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.async.AsyncTransaction; 20 | 21 | public class AsyncTransactionHolder extends AbstractTransactionHolder { 22 | public AsyncTransactionHolder(AsyncSessionHolder sessionHolder, AsyncTransaction transaction) { 23 | super(sessionHolder, transaction); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/DriverHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.Config; 20 | import org.neo4j.driver.Driver; 21 | 22 | public record DriverHolder(Driver driver, Config config) {} 23 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/ReactiveSessionHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.SessionConfig; 20 | import org.neo4j.driver.reactive.ReactiveSession; 21 | 22 | public class ReactiveSessionHolder extends AbstractSessionHolder { 23 | public ReactiveSessionHolder(DriverHolder driverHolder, ReactiveSession session, SessionConfig config) { 24 | super(driverHolder, session, config); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/ReactiveSessionStreamsHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.SessionConfig; 20 | import org.neo4j.driver.reactivestreams.ReactiveSession; 21 | 22 | public class ReactiveSessionStreamsHolder extends AbstractSessionHolder { 23 | public ReactiveSessionStreamsHolder(DriverHolder driverHolder, ReactiveSession session, SessionConfig config) { 24 | super(driverHolder, session, config); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/ReactiveTransactionHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.reactive.ReactiveTransaction; 20 | 21 | public class ReactiveTransactionHolder extends AbstractTransactionHolder { 22 | public ReactiveTransactionHolder(ReactiveSessionHolder sessionHolder, ReactiveTransaction transaction) { 23 | super(sessionHolder, transaction); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/ReactiveTransactionStreamsHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.reactivestreams.ReactiveTransaction; 20 | 21 | public class ReactiveTransactionStreamsHolder 22 | extends AbstractTransactionHolder { 23 | public ReactiveTransactionStreamsHolder( 24 | ReactiveSessionStreamsHolder sessionHolder, ReactiveTransaction transaction) { 25 | super(sessionHolder, transaction); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/ResultCursorHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.async.ResultCursor; 20 | 21 | public class ResultCursorHolder extends AbstractResultHolder { 22 | public ResultCursorHolder(AsyncSessionHolder sessionHolder, ResultCursor result) { 23 | super(sessionHolder, result); 24 | } 25 | 26 | public ResultCursorHolder(AsyncTransactionHolder transactionHolder, ResultCursor result) { 27 | super(transactionHolder, result); 28 | } 29 | 30 | @Override 31 | protected AsyncSessionHolder getSessionHolder(AsyncTransactionHolder transactionHolder) { 32 | return transactionHolder.getSessionHolder(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/ResultHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.Result; 20 | 21 | public class ResultHolder extends AbstractResultHolder { 22 | public ResultHolder(SessionHolder sessionHolder, Result result) { 23 | super(sessionHolder, result); 24 | } 25 | 26 | public ResultHolder(TransactionHolder transactionHolder, Result result) { 27 | super(transactionHolder, result); 28 | } 29 | 30 | @Override 31 | protected SessionHolder getSessionHolder(TransactionHolder transactionHolder) { 32 | return transactionHolder.getSessionHolder(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/SessionHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.Session; 20 | import org.neo4j.driver.SessionConfig; 21 | 22 | public class SessionHolder extends AbstractSessionHolder { 23 | public SessionHolder(DriverHolder driverHolder, Session session, SessionConfig config) { 24 | super(driverHolder, session, config); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/holder/TransactionHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.holder; 18 | 19 | import org.neo4j.driver.Transaction; 20 | 21 | public class TransactionHolder extends AbstractTransactionHolder { 22 | public TransactionHolder(SessionHolder sessionHolder, Transaction transaction) { 23 | super(sessionHolder, transaction); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/AuthTokenAndExpiration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import com.fasterxml.jackson.annotation.JsonProperty; 20 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 21 | import lombok.Getter; 22 | import lombok.Setter; 23 | 24 | @Setter 25 | @Getter 26 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "name") 27 | public class AuthTokenAndExpiration { 28 | private AuthTokenAndExpirationBody data; 29 | 30 | @Getter 31 | @Setter 32 | public static class AuthTokenAndExpirationBody { 33 | @JsonProperty("auth") 34 | private AuthorizationToken token; 35 | 36 | private Long expiresInMs; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/AuthTokenManagerGetAuthCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | 22 | @Setter 23 | @Getter 24 | public class AuthTokenManagerGetAuthCompleted implements TestkitCallbackResult { 25 | private AuthTokenManagerGetAuthCompletedBody data; 26 | 27 | @Override 28 | public String getCallbackId() { 29 | return data.getRequestId(); 30 | } 31 | 32 | @Setter 33 | @Getter 34 | public static class AuthTokenManagerGetAuthCompletedBody { 35 | private String requestId; 36 | private AuthorizationToken auth; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/AuthTokenManagerHandleSecurityExceptionCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | 22 | @Setter 23 | @Getter 24 | public class AuthTokenManagerHandleSecurityExceptionCompleted implements TestkitCallbackResult { 25 | private AuthTokenManagerHandleSecurityExceptionCompletedBody data; 26 | 27 | @Override 28 | public String getCallbackId() { 29 | return data.getRequestId(); 30 | } 31 | 32 | @Setter 33 | @Getter 34 | public static class AuthTokenManagerHandleSecurityExceptionCompletedBody { 35 | private String requestId; 36 | private boolean handled; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/BasicAuthTokenProviderCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | 22 | @Setter 23 | @Getter 24 | public class BasicAuthTokenProviderCompleted implements TestkitCallbackResult { 25 | private BasicAuthTokenProviderCompletedBody data; 26 | 27 | @Override 28 | public String getCallbackId() { 29 | return data.getRequestId(); 30 | } 31 | 32 | @Setter 33 | @Getter 34 | public static class BasicAuthTokenProviderCompletedBody { 35 | private String requestId; 36 | private AuthorizationToken auth; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/BearerAuthTokenProviderCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | 22 | @Setter 23 | @Getter 24 | public class BearerAuthTokenProviderCompleted implements TestkitCallbackResult { 25 | private BearerAuthTokenProviderCompletedBody data; 26 | 27 | @Override 28 | public String getCallbackId() { 29 | return data.getRequestId(); 30 | } 31 | 32 | @Setter 33 | @Getter 34 | public static class BearerAuthTokenProviderCompletedBody { 35 | private String requestId; 36 | private AuthTokenAndExpiration auth; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/BookmarksConsumerCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | 22 | @Setter 23 | @Getter 24 | public class BookmarksConsumerCompleted implements TestkitCallbackResult { 25 | private BookmarksConsumerCompletedBody data; 26 | 27 | @Override 28 | public String getCallbackId() { 29 | return data.getRequestId(); 30 | } 31 | 32 | @Setter 33 | @Getter 34 | public static class BookmarksConsumerCompletedBody { 35 | private String requestId; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/BookmarksSupplierCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import java.util.Set; 20 | import lombok.Getter; 21 | import lombok.Setter; 22 | 23 | @Setter 24 | @Getter 25 | public class BookmarksSupplierCompleted implements TestkitCallbackResult { 26 | private BookmarksSupplierCompletedBody data; 27 | 28 | @Override 29 | public String getCallbackId() { 30 | return data.getRequestId(); 31 | } 32 | 33 | @Setter 34 | @Getter 35 | public static class BookmarksSupplierCompletedBody { 36 | private String requestId; 37 | private Set bookmarks; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/ClientCertificate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import com.fasterxml.jackson.annotation.JsonInclude; 20 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 21 | import lombok.Getter; 22 | import lombok.Setter; 23 | 24 | @Setter 25 | @Getter 26 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "name") 27 | public class ClientCertificate { 28 | private Data data; 29 | 30 | @Getter 31 | @Setter 32 | @JsonInclude(JsonInclude.Include.NON_NULL) 33 | public static class Data { 34 | String certfile; 35 | String keyfile; 36 | String password; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/ClientCertificateProviderCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | 22 | @Setter 23 | @Getter 24 | public class ClientCertificateProviderCompleted implements TestkitCallbackResult { 25 | private ClientCertificateProviderCompletedBody data; 26 | 27 | @Override 28 | public String getCallbackId() { 29 | return data.getRequestId(); 30 | } 31 | 32 | @Setter 33 | @Getter 34 | public static class ClientCertificateProviderCompletedBody { 35 | private String requestId; 36 | private ClientCertificate clientCertificate; 37 | private boolean hasUpdate; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/DomainNameResolutionCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import java.util.List; 20 | import lombok.Getter; 21 | import lombok.Setter; 22 | 23 | @Setter 24 | @Getter 25 | public class DomainNameResolutionCompleted implements TestkitCallbackResult { 26 | private DomainNameResolutionCompletedBody data; 27 | 28 | @Override 29 | public String getCallbackId() { 30 | return data.getRequestId(); 31 | } 32 | 33 | @Setter 34 | @Getter 35 | public static class DomainNameResolutionCompletedBody { 36 | private String requestId; 37 | private List addresses; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/FakeTimeUninstall.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import lombok.Getter; 20 | import lombok.Setter; 21 | import neo4j.org.testkit.backend.TestkitClock; 22 | import neo4j.org.testkit.backend.TestkitState; 23 | import neo4j.org.testkit.backend.messages.responses.FakeTimeAck; 24 | import neo4j.org.testkit.backend.messages.responses.TestkitResponse; 25 | 26 | @Setter 27 | @Getter 28 | public class FakeTimeUninstall extends AbstractBasicTestkitRequest { 29 | @Override 30 | protected TestkitResponse processAndCreateResponse(TestkitState testkitState) { 31 | TestkitClock.INSTANCE.setFakeTime(false); 32 | return FakeTimeAck.builder().build(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/ResolverResolutionCompleted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests; 18 | 19 | import java.util.List; 20 | import lombok.Getter; 21 | import lombok.Setter; 22 | 23 | @Setter 24 | @Getter 25 | public class ResolverResolutionCompleted implements TestkitCallbackResult { 26 | private ResolverResolutionCompletedBody data; 27 | 28 | @Override 29 | public String getCallbackId() { 30 | return data.getRequestId(); 31 | } 32 | 33 | @Setter 34 | @Getter 35 | public static class ResolverResolutionCompletedBody { 36 | private String requestId; 37 | private List addresses; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/deserializer/types/CypherType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.requests.deserializer.types; 18 | 19 | import org.neo4j.driver.Value; 20 | 21 | public interface CypherType { 22 | Value asValue(); 23 | } 24 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/AuthTokenManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class AuthTokenManager implements TestkitResponse { 25 | private AuthTokenManagerBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "AuthTokenManager"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class AuthTokenManagerBody { 35 | private String id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/AuthTokenProviderRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class AuthTokenProviderRequest implements TestkitCallback { 25 | private AuthTokenProviderRequestBody data; 26 | 27 | @Override 28 | public String getCallbackId() { 29 | return data.getId(); 30 | } 31 | 32 | @Override 33 | public String testkitName() { 34 | return "AuthTokenProviderRequest"; 35 | } 36 | 37 | @Getter 38 | @Builder 39 | public static class AuthTokenProviderRequestBody { 40 | private String id; 41 | private String authTokenProviderId; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/BackendError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class BackendError implements TestkitResponse { 25 | private final BackendErrorBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "BackendError"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class BackendErrorBody { 35 | private String msg; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/BasicAuthTokenManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class BasicAuthTokenManager implements TestkitResponse { 25 | private BasicAuthTokenManagerBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "BasicAuthTokenManager"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class BasicAuthTokenManagerBody { 35 | private String id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/BearerAuthTokenManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class BearerAuthTokenManager implements TestkitResponse { 25 | private BearerAuthTokenManagerBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "BearerAuthTokenManager"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class BearerAuthTokenManagerBody { 35 | private String id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/BookmarkManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class BookmarkManager implements TestkitResponse { 25 | private final BookmarkManagerBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "BookmarkManager"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class BookmarkManagerBody { 35 | private final String id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/Bookmarks.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import java.util.Set; 20 | import lombok.Builder; 21 | import lombok.Getter; 22 | 23 | @Getter 24 | @Builder 25 | public class Bookmarks implements TestkitResponse { 26 | BookmarksBody data; 27 | 28 | @Override 29 | public String testkitName() { 30 | return "Bookmarks"; 31 | } 32 | 33 | @Getter 34 | @Builder 35 | public static class BookmarksBody { 36 | private Set bookmarks; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/BookmarksSupplierRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class BookmarksSupplierRequest implements TestkitCallback { 25 | private BookmarksSupplierRequestBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "BookmarksSupplierRequest"; 30 | } 31 | 32 | @Override 33 | public String getCallbackId() { 34 | return data.getId(); 35 | } 36 | 37 | @Getter 38 | @Builder 39 | public static class BookmarksSupplierRequestBody { 40 | private String id; 41 | private String bookmarkManagerId; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/ClientCertificateProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class ClientCertificateProvider implements TestkitResponse { 25 | private ClientCertificateProviderBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "ClientCertificateProvider"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class ClientCertificateProviderBody { 35 | private String id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/ConnectionPoolMetrics.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class ConnectionPoolMetrics implements TestkitResponse { 25 | private final ConnectionPoolMetricsBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "ConnectionPoolMetrics"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class ConnectionPoolMetricsBody { 35 | private int inUse; 36 | private int idle; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/DomainNameResolutionRequired.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class DomainNameResolutionRequired implements TestkitCallback { 25 | private DomainNameResolutionRequiredBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "DomainNameResolutionRequired"; 30 | } 31 | 32 | @Override 33 | public String getCallbackId() { 34 | return data.getId(); 35 | } 36 | 37 | @Getter 38 | @Builder 39 | public static class DomainNameResolutionRequiredBody { 40 | private String id; 41 | 42 | private String name; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class Driver implements TestkitResponse { 25 | private final DriverBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "Driver"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class DriverBody { 35 | private final String id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/DriverIsAuthenticated.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class DriverIsAuthenticated implements TestkitResponse { 25 | private DriverIsAuthenticatedBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "DriverIsAuthenticated"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class DriverIsAuthenticatedBody { 35 | private String id; 36 | private boolean authenticated; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/DriverIsEncrypted.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class DriverIsEncrypted implements TestkitResponse { 25 | private final DriverIsEncryptedBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "DriverIsEncrypted"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class DriverIsEncryptedBody { 35 | private final boolean encrypted; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/EagerResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import java.util.List; 20 | import lombok.Builder; 21 | import lombok.Getter; 22 | 23 | @Getter 24 | @Builder 25 | public class EagerResult implements TestkitResponse { 26 | private EagerResultBody data; 27 | 28 | @Override 29 | public String testkitName() { 30 | return "EagerResult"; 31 | } 32 | 33 | @Getter 34 | @Builder 35 | public static class EagerResultBody { 36 | private final List keys; 37 | private final List records; 38 | private final Summary.SummaryBody summary; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/FakeTimeAck.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class FakeTimeAck implements TestkitResponse { 25 | @Override 26 | public String testkitName() { 27 | return "FakeTimeAck"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/FeatureList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import java.util.Set; 20 | import lombok.Builder; 21 | import lombok.Getter; 22 | 23 | @Getter 24 | @Builder 25 | public class FeatureList implements TestkitResponse { 26 | private final FeatureListBody data; 27 | 28 | @Override 29 | public String testkitName() { 30 | return "FeatureList"; 31 | } 32 | 33 | @Getter 34 | @Builder 35 | public static class FeatureListBody { 36 | private final Set features; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/Field.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class Field implements TestkitResponse { 25 | private final FieldBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "Field"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class FieldBody { 35 | private final String value; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/FrontendError.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class FrontendError implements TestkitResponse { 25 | private final FrontendErrorBody data = new FrontendErrorBody("Imagine client code that throws..."); 26 | 27 | @Override 28 | public String testkitName() { 29 | return "FrontendError"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class FrontendErrorBody { 35 | private String msg; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/MultiDBSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class MultiDBSupport implements TestkitResponse { 25 | private final MultiDBSupportBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "MultiDBSupport"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class MultiDBSupportBody { 35 | private final String id; 36 | 37 | private final boolean available; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/NullRecord.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class NullRecord implements TestkitResponse { 25 | @Override 26 | public String testkitName() { 27 | return "NullRecord"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/Record.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class Record implements TestkitResponse { 25 | private RecordBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "Record"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class RecordBody { 35 | private org.neo4j.driver.Record values; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/RecordList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import java.util.List; 20 | import lombok.Builder; 21 | import lombok.Getter; 22 | 23 | @Getter 24 | @Builder 25 | public class RecordList implements TestkitResponse { 26 | private final RecordListBody data; 27 | 28 | @Override 29 | public String testkitName() { 30 | return "RecordList"; 31 | } 32 | 33 | @Getter 34 | @Builder 35 | public static class RecordListBody { 36 | private final List records; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/ResolverResolutionRequired.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class ResolverResolutionRequired implements TestkitCallback { 25 | private ResolverResolutionRequiredBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "ResolverResolutionRequired"; 30 | } 31 | 32 | @Override 33 | public String getCallbackId() { 34 | return data.getId(); 35 | } 36 | 37 | @Getter 38 | @Builder 39 | public static class ResolverResolutionRequiredBody { 40 | private String id; 41 | 42 | private String address; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/Result.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import java.util.List; 20 | import lombok.Builder; 21 | import lombok.Getter; 22 | 23 | @Getter 24 | @Builder 25 | public class Result implements TestkitResponse { 26 | private ResultBody data; 27 | 28 | @Override 29 | public String testkitName() { 30 | return "Result"; 31 | } 32 | 33 | @Getter 34 | @Builder 35 | public static class ResultBody { 36 | private String id; 37 | 38 | private List keys; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/RetryableDone.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class RetryableDone implements TestkitResponse { 25 | @Override 26 | public String testkitName() { 27 | return "RetryableDone"; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/RetryableTry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class RetryableTry implements TestkitResponse { 25 | private RetryableTryBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "RetryableTry"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class RetryableTryBody { 35 | private String id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/RoutingTable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import java.util.List; 20 | import lombok.Builder; 21 | import lombok.Getter; 22 | 23 | @Getter 24 | @Builder 25 | public class RoutingTable implements TestkitResponse { 26 | private RoutingTableBody data; 27 | 28 | @Override 29 | public String testkitName() { 30 | return "RoutingTable"; 31 | } 32 | 33 | @Getter 34 | @Builder 35 | public static class RoutingTableBody { 36 | private String database; 37 | private long ttl; 38 | private List routers; 39 | private List readers; 40 | private List writers; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/RunSubTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | 21 | @Builder 22 | public class RunSubTests implements TestkitResponse { 23 | @Override 24 | public String testkitName() { 25 | return "RunSubTests"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/RunTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | 21 | @Builder 22 | public class RunTest implements TestkitResponse { 23 | @Override 24 | public String testkitName() { 25 | return "RunTest"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/Session.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class Session implements TestkitResponse { 25 | private SessionBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "Session"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class SessionBody { 35 | private String id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/SessionAuthSupport.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class SessionAuthSupport implements TestkitResponse { 25 | private SessionAuthSupportBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "SessionAuthSupport"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class SessionAuthSupportBody { 35 | private String id; 36 | private boolean available; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/SkipTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class SkipTest implements TestkitResponse { 25 | private SkipTestBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "SkipTest"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class SkipTestBody { 35 | private final String reason; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/TestkitCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import neo4j.org.testkit.backend.messages.requests.TestkitCallbackResult; 20 | 21 | /** 22 | * This is a special type of {@link TestkitResponse} that is typically sent during driver action processing to request some action or data from Testkit, which 23 | * must respond with {@link TestkitCallbackResult}. 24 | */ 25 | public interface TestkitCallback extends TestkitResponse { 26 | String getCallbackId(); 27 | } 28 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/TestkitResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 20 | 21 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "name") 22 | public interface TestkitResponse { 23 | String testkitName(); 24 | } 25 | -------------------------------------------------------------------------------- /testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/Transaction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) "Neo4j" 3 | * Neo4j Sweden AB [https://neo4j.com] 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package neo4j.org.testkit.backend.messages.responses; 18 | 19 | import lombok.Builder; 20 | import lombok.Getter; 21 | 22 | @Getter 23 | @Builder 24 | public class Transaction implements TestkitResponse { 25 | private final TransactionBody data; 26 | 27 | @Override 28 | public String testkitName() { 29 | return "Transaction"; 30 | } 31 | 32 | @Getter 33 | @Builder 34 | public static class TransactionBody { 35 | private final String id; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /testkit-tests/LICENSES.txt: -------------------------------------------------------------------------------- 1 | This file contains the full license text of the included third party 2 | libraries. For an overview of the licenses see the NOTICE.txt file. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /testkit-tests/NOTICE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) "Neo4j" 2 | Neo4j Sweden AB [https://neo4j.com] 3 | 4 | This file is part of Neo4j. 5 | 6 | Licensed under the Apache License, Version 2.0 (the "License"); 7 | you may not use this file except in compliance with the License. 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | 15 | Full license texts are found in LICENSES.txt. 16 | 17 | 18 | Third-party licenses 19 | -------------------- 20 | 21 | -------------------------------------------------------------------------------- /testkit-tests/src/main/docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10.0b4-buster 2 | 3 | RUN apt-get update && apt-get install -y \ 4 | apt-transport-https \ 5 | ca-certificates \ 6 | curl \ 7 | gnupg \ 8 | lsb-release 9 | 10 | RUN mkdir -p /etc/apt/keyrings \ 11 | && curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg 12 | 13 | RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \ 14 | | tee /etc/apt/sources.list.d/docker.list > /dev/null 15 | 16 | RUN apt-get update && apt-get install -y \ 17 | docker-ce-cli 18 | 19 | COPY /entrypoint.sh / 20 | 21 | RUN chmod +x /entrypoint.sh 22 | 23 | ENTRYPOINT ["/entrypoint.sh"] 24 | -------------------------------------------------------------------------------- /testkit-tests/src/main/docker/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | rm -rf $TESTKIT_CHECKOUT_PATH 6 | git clone $TESTKIT_URL $TESTKIT_CHECKOUT_PATH 7 | cd $TESTKIT_CHECKOUT_PATH 8 | git checkout $TESTKIT_VERSION 9 | 10 | echo "Testkit args: '$TESTKIT_ARGS'" 11 | python main.py $TESTKIT_ARGS 12 | -------------------------------------------------------------------------------- /testkit/.dockerignore: -------------------------------------------------------------------------------- 1 | *.py 2 | 3 | -------------------------------------------------------------------------------- /testkit/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bullseye-slim 2 | 3 | ENV JAVA_HOME=/usr/lib/jvm/openjdk-17 \ 4 | PYTHON=python3 5 | 6 | RUN apt-get update && apt-get install -y \ 7 | ca-certificates \ 8 | curl \ 9 | apt-transport-https \ 10 | python3 \ 11 | p11-kit \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | # https://hub.docker.com/_/eclipse-temurin 15 | COPY --from=eclipse-temurin:17-jdk /opt/java/openjdk $JAVA_HOME 16 | 17 | COPY --from=maven:3.9.2-eclipse-temurin-17 /usr/share/maven /opt/apache-maven 18 | 19 | # Install our own CAs on the image. 20 | # Assumes Linux Debian based image. 21 | # JAVA_HOME needed by update-ca-certificates hook to update Java with changed system CAs. 22 | COPY CAs/* /usr/local/share/ca-certificates/ 23 | COPY CustomCAs/* /usr/local/share/custom-ca-certificates/ 24 | RUN echo 'jdk.tls.disabledAlgorithms=jdk.tls.disabledAlgorithms=SSLv3, TLSv1, RC4, DES, MD5withRSA, DH keySize < 1024, EC keySize < 224, 3DES_EDE_CBC, anon, NULL' > /testkit.java.security 25 | 26 | # https://github.com/adoptium/containers/issues/293 27 | # https://github.com/adoptium/containers/pull/392 28 | # https://github.com/adoptium/containers/blob/f6d4923380ecb1ec4b0d58c633ebb0aeed4c8332/17/jdk/ubuntu/jammy/entrypoint.sh#L23 29 | RUN update-ca-certificates \ 30 | && trust extract --overwrite --format=java-cacerts --filter=ca-anchors --purpose=server-auth "$JAVA_HOME/lib/security/cacerts" 31 | 32 | ENV PATH=$JAVA_HOME/bin:/opt/apache-maven/bin:$PATH 33 | -------------------------------------------------------------------------------- /testkit/backend.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executed in Java driver container. 3 | Assumes driver and backend has been built. 4 | Responsible for starting the test backend. 5 | """ 6 | import os 7 | import subprocess 8 | import sys 9 | 10 | 11 | if __name__ == "__main__": 12 | subprocess.check_call( 13 | ["java", "-Djava.security.properties=/testkit.java.security", "-jar", "testkit-backend/target/testkit-backend.jar", 14 | os.getenv('TEST_BACKEND_SERVER', '')], 15 | stdout=sys.stdout, stderr=sys.stderr 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /testkit/build.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executed in java driver container. 3 | Responsible for building driver and test backend. 4 | """ 5 | import subprocess 6 | import os 7 | 8 | 9 | def run(args): 10 | subprocess.run( 11 | args, universal_newlines=True, stderr=subprocess.STDOUT, check=True) 12 | 13 | if __name__ == "__main__" and "TEST_SKIP_BUILD" not in os.environ: 14 | if os.getenv("TEST_NEO4J_BOLT_CONNECTION", "false") == "true" : 15 | run(["mvn", "-f", "/driver/bolt-connection/pom.xml", "--show-version", "--batch-mode", "clean", "versions:set", "-DnewVersion=0.0.0"]) 16 | run(["mvn", "-f", "/driver/bolt-connection/pom.xml", "--show-version", "--batch-mode", "clean", "install", "-DskipTests"]) 17 | run(["mvn", "--show-version", "--batch-mode", "clean", "install", "-P", "!determine-revision", "-DskipTests", "-Dneo4j-bolt-connection-bom.version=0.0.0"]) 18 | else: 19 | run(["mvn", "--show-version", "--batch-mode", "clean", "install", "-P", "!determine-revision", "-DskipTests"]) 20 | -------------------------------------------------------------------------------- /testkit/integration.py: -------------------------------------------------------------------------------- 1 | 2 | if __name__ == "__main__": 3 | print("Integration tests not ported to testkit") 4 | 5 | -------------------------------------------------------------------------------- /testkit/stress.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executed in java driver container. 3 | Responsible for invoking Java stress test suite. 4 | The stress test might be invoked multiple times against different versions 5 | of Neo4j. 6 | Assumes driver has been built before. 7 | """ 8 | import subprocess 9 | import os 10 | 11 | if __name__ == "__main__": 12 | uri = "%s://%s:%s" % ( 13 | os.environ["TEST_NEO4J_SCHEME"], 14 | os.environ["TEST_NEO4J_HOST"], 15 | os.environ["TEST_NEO4J_PORT"]) 16 | password = os.environ["TEST_NEO4J_PASS"] 17 | is_cluster = os.environ.get("TEST_NEO4J_IS_CLUSTER", False) 18 | if is_cluster: 19 | suite = "CausalClusteringStressIT" 20 | else: 21 | suite = "SingleInstanceStressIT" 22 | 23 | cmd = [ 24 | "mvn", "surefire:test", 25 | "--file", "./driver/pom.xml", 26 | "-Dtest=%s,AbstractStressTestBase" % suite, 27 | "-DexternalClusterUri=%s" % uri, 28 | "-Dneo4jUserPassword=%s" % password, 29 | "-DthreadCount=10", 30 | "-DexecutionTimeSeconds=10", 31 | "-Dmaven.gitcommitid.skip=true", 32 | ] 33 | if os.getenv("TEST_NEO4J_BOLT_CONNECTION", "false") == "true" : 34 | cmd.append("-Dneo4j-bolt-connection-bom.version=0.0.0") 35 | subprocess.run(cmd, universal_newlines=True, 36 | stderr=subprocess.STDOUT, check=True) 37 | -------------------------------------------------------------------------------- /testkit/testkit.json: -------------------------------------------------------------------------------- 1 | { 2 | "testkit": { 3 | "uri": "https://github.com/neo4j-drivers/testkit.git", 4 | "ref": "6.x" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /testkit/unittests.py: -------------------------------------------------------------------------------- 1 | """ 2 | Executed in Java driver container. 3 | Responsible for running unit tests. 4 | Assumes driver has been setup by build script prior to this. 5 | """ 6 | import subprocess 7 | import os 8 | 9 | 10 | def run(args): 11 | subprocess.run( 12 | args, universal_newlines=True, stderr=subprocess.STDOUT, check=True) 13 | 14 | 15 | if __name__ == "__main__": 16 | cmd = ["mvn", "test", "-Dmaven.gitcommitid.skip"] 17 | if os.getenv("TEST_NEO4J_BOLT_CONNECTION", "false") == "true" : 18 | cmd.append("-Dneo4j-bolt-connection-bom.version=0.0.0") 19 | run(cmd) 20 | --------------------------------------------------------------------------------