From 7a715b429ba2a9561d24ba66404142bdc9de5a4f Mon Sep 17 00:00:00 2001 From: Thiago Nunes Date: Mon, 17 May 2021 19:03:30 +1000 Subject: [PATCH] fix: re-adds test verifyStatementsInFile (#1181) Re-adds verifyStatementsInFile with old signature and marks it asdeprecated. --- .../connection/AbstractSqlScriptVerifier.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractSqlScriptVerifier.java b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractSqlScriptVerifier.java index 7171476b8d..ccf36449be 100644 --- a/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractSqlScriptVerifier.java +++ b/google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/AbstractSqlScriptVerifier.java @@ -241,6 +241,27 @@ public void verifyStatementsInFile(String filename, Class resourceClass) thro this.verifyStatementsInFile(filename, resourceClass, false); } + /** + * Reads sql statements from the specified file name and executes and verifies these. Statements + * that are preceded by an @EXPECT statement are verified against the @EXPECT specification. + * Statements without an @EXPECT statement will be executed and its result will be ignored, unless + * the statement throws an exception, which will fail the test case. + * + * @param providedConnection The {@link com.google.cloud.spanner.jdbc.Connection} to execute the + * statements against + * @param filename The file name containing the statements. Statements must be separated by a + * semicolon (;) + * @param resourceClass The class that defines the package where to find the input file + * @deprecated use {@link AbstractSqlScriptVerifier#verifyStatementsInFile(GenericConnection, + * String, Class)})} instead. This method does not allow parallel batch execution. + */ + @Deprecated + public void verifyStatementsInFile( + GenericConnection providedConnection, String filename, Class resourceClass) + throws Exception { + this.verifyStatementsInFile(providedConnection, filename, resourceClass, false); + } + /** * Reads sql statements from the specified file name and executes and verifies these. Statements * that are preceded by an @EXPECT statement are verified against the @EXPECT specification.