diff --git a/testkit-backend/src/main/java/neo4j/org/testkit/backend/FrontendError.java b/testkit-backend/src/main/java/neo4j/org/testkit/backend/FrontendError.java new file mode 100644 index 0000000000..e7aee6d970 --- /dev/null +++ b/testkit-backend/src/main/java/neo4j/org/testkit/backend/FrontendError.java @@ -0,0 +1,23 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package neo4j.org.testkit.backend; + +public class FrontendError extends RuntimeException +{ +} diff --git a/testkit-backend/src/main/java/neo4j/org/testkit/backend/channel/handler/TestkitRequestProcessorHandler.java b/testkit-backend/src/main/java/neo4j/org/testkit/backend/channel/handler/TestkitRequestProcessorHandler.java index 5ea2d22b4e..4616847da7 100644 --- a/testkit-backend/src/main/java/neo4j/org/testkit/backend/channel/handler/TestkitRequestProcessorHandler.java +++ b/testkit-backend/src/main/java/neo4j/org/testkit/backend/channel/handler/TestkitRequestProcessorHandler.java @@ -22,6 +22,7 @@ import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import neo4j.org.testkit.backend.CustomDriverError; +import neo4j.org.testkit.backend.FrontendError; import neo4j.org.testkit.backend.TestkitState; import neo4j.org.testkit.backend.messages.requests.TestkitRequest; import neo4j.org.testkit.backend.messages.responses.BackendError; @@ -160,6 +161,10 @@ else if ( throwable instanceof CustomDriverError ) ) .build(); } + else if ( throwable instanceof FrontendError ) + { + return neo4j.org.testkit.backend.messages.responses.FrontendError.builder().build(); + } else { return BackendError.builder().data( BackendError.BackendErrorBody.builder().msg( throwable.toString() ).build() ).build(); diff --git a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/RetryableNegative.java b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/RetryableNegative.java index c5f5c0466c..5499b620eb 100644 --- a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/RetryableNegative.java +++ b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/RetryableNegative.java @@ -20,6 +20,7 @@ import lombok.Getter; import lombok.Setter; +import neo4j.org.testkit.backend.FrontendError; import neo4j.org.testkit.backend.TestkitState; import neo4j.org.testkit.backend.holder.SessionHolder; import neo4j.org.testkit.backend.messages.responses.TestkitResponse; @@ -44,7 +45,7 @@ public TestkitResponse process( TestkitState testkitState ) } else { - throwable = new RuntimeException( "Error from client in retryable tx" ); + throwable = new FrontendError(); } sessionHolder.getTxWorkFuture().completeExceptionally( throwable ); return null; @@ -64,7 +65,7 @@ public CompletionStage processAsync( TestkitState testkitState } else { - throwable = new RuntimeException( "Error from client in retryable tx" ); + throwable = new FrontendError(); } sessionHolder.getTxWorkFuture().completeExceptionally( throwable ); return null; @@ -85,7 +86,7 @@ public Mono processRx( TestkitState testkitState ) } else { - throwable = new RuntimeException( "Error from client in retryable tx" ); + throwable = new FrontendError(); } sessionHolder.getTxWorkFuture().completeExceptionally( throwable ); return null; diff --git a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/StartTest.java b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/StartTest.java index c2aaa4de0a..8eb19361cc 100644 --- a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/StartTest.java +++ b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/requests/StartTest.java @@ -53,10 +53,11 @@ public class StartTest implements TestkitRequest COMMON_SKIP_PATTERN_TO_REASON.put( "^.*\\.test_partial_summary_contains_system_updates$", "Does not contain updates because value is zero" ); COMMON_SKIP_PATTERN_TO_REASON.put( "^.*\\.test_partial_summary_contains_updates$", "Does not contain updates because value is zero" ); COMMON_SKIP_PATTERN_TO_REASON.put( "^.*\\.test_supports_multi_db$", "Database is None" ); + COMMON_SKIP_PATTERN_TO_REASON.put( "^.*\\.test_managed_tx_raises_tx_managed_exec$", + "Driver (still) allows explicit managing of managed transaction" ); String skipMessage = "This test expects hostname verification to be turned off when all certificates are trusted"; COMMON_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestTrustAllCertsConfig\\.test_trusted_ca_wrong_hostname$", skipMessage ); COMMON_SKIP_PATTERN_TO_REASON.put( "^.*\\.TestTrustAllCertsConfig\\.test_untrusted_ca_wrong_hostname$", skipMessage ); - ASYNC_SKIP_PATTERN_TO_REASON.putAll( COMMON_SKIP_PATTERN_TO_REASON ); REACTIVE_SKIP_PATTERN_TO_REASON.putAll( COMMON_SKIP_PATTERN_TO_REASON ); diff --git a/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/FrontendError.java b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/FrontendError.java new file mode 100644 index 0000000000..780da00e4e --- /dev/null +++ b/testkit-backend/src/main/java/neo4j/org/testkit/backend/messages/responses/FrontendError.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) "Neo4j" + * Neo4j Sweden AB [http://neo4j.com] + * + * This file is part of Neo4j. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package neo4j.org.testkit.backend.messages.responses; + +import lombok.Builder; +import lombok.Getter; + +@Getter +@Builder +public class FrontendError implements TestkitResponse +{ + private final FrontendErrorBody data = new FrontendErrorBody("Imagine client code that throws..."); + + @Override + public String testkitName() + { + return "FrontendError"; + } + + @Getter + @Builder + public static class FrontendErrorBody + { + private String msg; + } +}