diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/AbstractSqlScriptVerifier.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/AbstractSqlScriptVerifier.java index 489370364945..71a1865b84ec 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/AbstractSqlScriptVerifier.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/AbstractSqlScriptVerifier.java @@ -182,6 +182,8 @@ public static List readStatementsFromFile(String filename, Class reso private final Map variables = new HashMap<>(); + private final boolean logStatements; + /** * Constructor for a verifier that will take a {@link GenericConnection} as a parameter to the * {@link AbstractSqlScriptVerifier#verifyStatementsInFile(GenericConnection, String, Class, @@ -194,6 +196,7 @@ public AbstractSqlScriptVerifier() { /** Constructor for a verifier that will use a connection provider for connections */ public AbstractSqlScriptVerifier(GenericConnectionProvider provider) { this.connectionProvider = provider; + this.logStatements = Boolean.parseBoolean(System.getProperty("log_sql_statements", "false")); } /** @@ -209,14 +212,10 @@ public AbstractSqlScriptVerifier(GenericConnectionProvider provider) { * semicolon (;) * @param resourceClass The class that should be used to locate the resource specified by the file * name - * @param logStatements Should the verifier log each statement that is executed and verified to - * standard out * @throws Exception */ - public void verifyStatementsInFile(String filename, Class resourceClass, boolean logStatements) - throws Exception { - verifyStatementsInFile( - connectionProvider.getConnection(), filename, resourceClass, logStatements); + public void verifyStatementsInFile(String filename, Class resourceClass) throws Exception { + verifyStatementsInFile(connectionProvider.getConnection(), filename, resourceClass); } /** @@ -230,11 +229,9 @@ public void verifyStatementsInFile(String filename, Class resourceClass, bool * @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 - * @param logStatements Should all statements be logged to standard out? */ public void verifyStatementsInFile( - GenericConnection connection, String filename, Class resourceClass, boolean logStatements) - throws Exception { + GenericConnection connection, String filename, Class resourceClass) throws Exception { try { List statements = readStatementsFromFile(filename, resourceClass); for (String statement : statements) { diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/ClientSideStatementsTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/ClientSideStatementsTest.java index 18a13017ff43..4ba2cb7a0fb4 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/ClientSideStatementsTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/ClientSideStatementsTest.java @@ -48,7 +48,7 @@ public class ClientSideStatementsTest { @Test public void testExecuteClientSideStatementsScript() throws Exception { SqlScriptVerifier verifier = new SqlScriptVerifier(new TestConnectionProvider()); - verifier.verifyStatementsInFile("ClientSideStatementsTest.sql", getClass(), false); + verifier.verifyStatementsInFile("ClientSideStatementsTest.sql", getClass()); } private static final String SCRIPT_FILE = diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/ConnectionImplGeneratedSqlScriptTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/ConnectionImplGeneratedSqlScriptTest.java index 6a56250a8785..6e2008eb1a37 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/ConnectionImplGeneratedSqlScriptTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/ConnectionImplGeneratedSqlScriptTest.java @@ -59,7 +59,7 @@ public GenericConnection getConnection() { @Test public void testGeneratedScript() throws Exception { SqlScriptVerifier verifier = new SqlScriptVerifier(new TestConnectionProvider()); - verifier.verifyStatementsInFile("ConnectionImplGeneratedSqlScriptTest.sql", getClass(), false); + verifier.verifyStatementsInFile("ConnectionImplGeneratedSqlScriptTest.sql", getClass()); } /** diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/JdbcConnectionGeneratedSqlScriptTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/JdbcConnectionGeneratedSqlScriptTest.java index 8fdbeacbd543..fb4fccbc643b 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/JdbcConnectionGeneratedSqlScriptTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/JdbcConnectionGeneratedSqlScriptTest.java @@ -57,6 +57,6 @@ public GenericConnection getConnection() { public void testGeneratedScript() throws Exception { JdbcSqlScriptVerifier verifier = new JdbcSqlScriptVerifier(new TestConnectionProvider()); verifier.verifyStatementsInFile( - "ConnectionImplGeneratedSqlScriptTest.sql", SqlScriptVerifier.class, false); + "ConnectionImplGeneratedSqlScriptTest.sql", SqlScriptVerifier.class); } } diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/JdbcTimeoutSqlTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/JdbcTimeoutSqlTest.java index fc9d81549c56..6d743d147c21 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/JdbcTimeoutSqlTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/JdbcTimeoutSqlTest.java @@ -35,6 +35,6 @@ public class JdbcTimeoutSqlTest { @Test public void testTimeoutScript() throws Exception { JdbcSqlScriptVerifier verifier = new JdbcSqlScriptVerifier(new TestConnectionProvider()); - verifier.verifyStatementsInFile("TimeoutSqlScriptTest.sql", getClass(), false); + verifier.verifyStatementsInFile("TimeoutSqlScriptTest.sql", getClass()); } } diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/SetReadOnlyStalenessSqlScriptTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/SetReadOnlyStalenessSqlScriptTest.java index 43cf113ccee5..de32e0f5bc0e 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/SetReadOnlyStalenessSqlScriptTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/SetReadOnlyStalenessSqlScriptTest.java @@ -42,6 +42,6 @@ public GenericConnection getConnection() { @Test public void testSetReadOnlyStalenessScript() throws Exception { SqlScriptVerifier verifier = new SqlScriptVerifier(new TestConnectionProvider()); - verifier.verifyStatementsInFile("SetReadOnlyStalenessTest.sql", getClass(), false); + verifier.verifyStatementsInFile("SetReadOnlyStalenessTest.sql", getClass()); } } diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/SetStatementTimeoutSqlScriptTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/SetStatementTimeoutSqlScriptTest.java index 594e5772911d..62b76b3fe389 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/SetStatementTimeoutSqlScriptTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/SetStatementTimeoutSqlScriptTest.java @@ -38,6 +38,6 @@ public GenericConnection getConnection() { @Test public void testSetStatementTimeoutScript() throws Exception { SqlScriptVerifier verifier = new SqlScriptVerifier(new TestConnectionProvider()); - verifier.verifyStatementsInFile("SetStatementTimeoutTest.sql", getClass(), false); + verifier.verifyStatementsInFile("SetStatementTimeoutTest.sql", getClass()); } } diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITDdlTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITDdlTest.java index c59d2fe668a1..1642c26bf57f 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITDdlTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITDdlTest.java @@ -32,6 +32,6 @@ public class ITDdlTest extends ITAbstractSpannerTest { @Test public void testSqlScript() throws Exception { SqlScriptVerifier verifier = new SqlScriptVerifier(new ITConnectionProvider()); - verifier.verifyStatementsInFile("ITDdlTest.sql", SqlScriptVerifier.class, true); + verifier.verifyStatementsInFile("ITDdlTest.sql", SqlScriptVerifier.class); } } diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcDdlTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcDdlTest.java index 794f8338afe6..4fe79a3febd6 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcDdlTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcDdlTest.java @@ -33,6 +33,6 @@ public class ITJdbcDdlTest extends ITAbstractJdbcTest { @Test public void testSqlScript() throws Exception { JdbcSqlScriptVerifier verifier = new JdbcSqlScriptVerifier(new ITJdbcConnectionProvider()); - verifier.verifyStatementsInFile("ITDdlTest.sql", SqlScriptVerifier.class, true); + verifier.verifyStatementsInFile("ITDdlTest.sql", SqlScriptVerifier.class); } } diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcReadOnlyTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcReadOnlyTest.java index 3bab287c6c85..8e083f592ecb 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcReadOnlyTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcReadOnlyTest.java @@ -56,7 +56,7 @@ public void createTestTables() throws Exception { // create tables JdbcSqlScriptVerifier verifier = new JdbcSqlScriptVerifier(new ITJdbcConnectionProvider()); verifier.verifyStatementsInFile( - "ITReadOnlySpannerTest_CreateTables.sql", SqlScriptVerifier.class, true); + "ITReadOnlySpannerTest_CreateTables.sql", SqlScriptVerifier.class); // fill tables with data connection.setAutoCommit(false); @@ -89,7 +89,7 @@ public void createTestTables() throws Exception { @Test public void testSqlScript() throws Exception { JdbcSqlScriptVerifier verifier = new JdbcSqlScriptVerifier(new ITJdbcConnectionProvider()); - verifier.verifyStatementsInFile("ITReadOnlySpannerTest.sql", SqlScriptVerifier.class, true); + verifier.verifyStatementsInFile("ITReadOnlySpannerTest.sql", SqlScriptVerifier.class); } @Test diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcReadWriteAutocommitTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcReadWriteAutocommitTest.java index 752cb868d30c..315cdc17e199 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcReadWriteAutocommitTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcReadWriteAutocommitTest.java @@ -56,7 +56,7 @@ public boolean doCreateDefaultTestTable() { public void test01_SqlScript() throws Exception { JdbcSqlScriptVerifier verifier = new JdbcSqlScriptVerifier(new ITJdbcConnectionProvider()); verifier.verifyStatementsInFile( - "ITReadWriteAutocommitSpannerTest.sql", SqlScriptVerifier.class, true); + "ITReadWriteAutocommitSpannerTest.sql", SqlScriptVerifier.class); } @Test diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcSqlScriptTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcSqlScriptTest.java index 43cfb43c0754..cc1334662945 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcSqlScriptTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITJdbcSqlScriptTest.java @@ -72,7 +72,7 @@ public class ITJdbcSqlScriptTest extends ITAbstractJdbcTest { public void test01_CreateTables() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), CREATE_TABLES_FILE, SqlScriptVerifier.class, true); + JdbcGenericConnection.of(connection), CREATE_TABLES_FILE, SqlScriptVerifier.class); } } @@ -83,8 +83,7 @@ public void test02_InsertTestData() throws Exception { verifier.verifyStatementsInFile( JdbcGenericConnection.of(connection), INSERT_AND_VERIFY_TEST_DATA, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -92,10 +91,7 @@ public void test02_InsertTestData() throws Exception { public void test03_TestGetReadTimestamp() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), - TEST_GET_READ_TIMESTAMP, - SqlScriptVerifier.class, - true); + JdbcGenericConnection.of(connection), TEST_GET_READ_TIMESTAMP, SqlScriptVerifier.class); } } @@ -103,10 +99,7 @@ public void test03_TestGetReadTimestamp() throws Exception { public void test04_TestGetCommitTimestamp() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), - TEST_GET_COMMIT_TIMESTAMP, - SqlScriptVerifier.class, - true); + JdbcGenericConnection.of(connection), TEST_GET_COMMIT_TIMESTAMP, SqlScriptVerifier.class); } } @@ -116,8 +109,7 @@ public void test05_TestTemporaryTransactions() throws Exception { verifier.verifyStatementsInFile( JdbcGenericConnection.of(connection), TEST_TEMPORARY_TRANSACTIONS, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -125,10 +117,7 @@ public void test05_TestTemporaryTransactions() throws Exception { public void test06_TestTransactionMode() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), - TEST_TRANSACTION_MODE, - SqlScriptVerifier.class, - true); + JdbcGenericConnection.of(connection), TEST_TRANSACTION_MODE, SqlScriptVerifier.class); } } @@ -138,8 +127,7 @@ public void test07_TestTransactionModeReadOnly() throws Exception { verifier.verifyStatementsInFile( JdbcGenericConnection.of(connection), TEST_TRANSACTION_MODE_READ_ONLY, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -147,10 +135,7 @@ public void test07_TestTransactionModeReadOnly() throws Exception { public void test08_TestReadOnlyStaleness() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), - TEST_READ_ONLY_STALENESS, - SqlScriptVerifier.class, - true); + JdbcGenericConnection.of(connection), TEST_READ_ONLY_STALENESS, SqlScriptVerifier.class); } } @@ -158,10 +143,7 @@ public void test08_TestReadOnlyStaleness() throws Exception { public void test09_TestAutocommitDmlMode() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), - TEST_AUTOCOMMIT_DML_MODE, - SqlScriptVerifier.class, - true); + JdbcGenericConnection.of(connection), TEST_AUTOCOMMIT_DML_MODE, SqlScriptVerifier.class); } } @@ -169,10 +151,7 @@ public void test09_TestAutocommitDmlMode() throws Exception { public void test10_TestAutocommitReadOnly() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), - TEST_AUTOCOMMIT_READ_ONLY, - SqlScriptVerifier.class, - true); + JdbcGenericConnection.of(connection), TEST_AUTOCOMMIT_READ_ONLY, SqlScriptVerifier.class); } } @@ -180,10 +159,7 @@ public void test10_TestAutocommitReadOnly() throws Exception { public void test11_TestStatementTimeout() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), - TEST_STATEMENT_TIMEOUT, - SqlScriptVerifier.class, - true); + JdbcGenericConnection.of(connection), TEST_STATEMENT_TIMEOUT, SqlScriptVerifier.class); } try (Connection connection = createConnection()) { // Create a statement with a query timeout, but do not set a statement timeout on the @@ -221,7 +197,7 @@ public void test11_TestStatementTimeout() throws Exception { public void test12_TestSetStatements() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), TEST_SET_STATEMENTS, SqlScriptVerifier.class, true); + JdbcGenericConnection.of(connection), TEST_SET_STATEMENTS, SqlScriptVerifier.class); } } @@ -229,10 +205,7 @@ public void test12_TestSetStatements() throws Exception { public void test13_TestInvalidStatements() throws Exception { try (Connection connection = createConnection()) { verifier.verifyStatementsInFile( - JdbcGenericConnection.of(connection), - TEST_INVALID_STATEMENTS, - SqlScriptVerifier.class, - true); + JdbcGenericConnection.of(connection), TEST_INVALID_STATEMENTS, SqlScriptVerifier.class); } } } diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITReadOnlySpannerTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITReadOnlySpannerTest.java index 8e46ceceebd1..b3aa8ea751c8 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITReadOnlySpannerTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITReadOnlySpannerTest.java @@ -69,7 +69,7 @@ public void createTestTables() throws Exception { // create tables SqlScriptVerifier verifier = new SqlScriptVerifier(new ITConnectionProvider()); verifier.verifyStatementsInFile( - "ITReadOnlySpannerTest_CreateTables.sql", SqlScriptVerifier.class, true); + "ITReadOnlySpannerTest_CreateTables.sql", SqlScriptVerifier.class); // fill tables with data connection.setAutocommit(false); @@ -102,7 +102,7 @@ public void createTestTables() throws Exception { @Test public void testSqlScript() throws Exception { SqlScriptVerifier verifier = new SqlScriptVerifier(new ITConnectionProvider()); - verifier.verifyStatementsInFile("ITReadOnlySpannerTest.sql", SqlScriptVerifier.class, true); + verifier.verifyStatementsInFile("ITReadOnlySpannerTest.sql", SqlScriptVerifier.class); } @Test diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITReadWriteAutocommitSpannerTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITReadWriteAutocommitSpannerTest.java index f08e6226721a..aa464fd4b756 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITReadWriteAutocommitSpannerTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITReadWriteAutocommitSpannerTest.java @@ -63,7 +63,7 @@ public boolean doCreateDefaultTestTable() { public void test01_SqlScript() throws Exception { SqlScriptVerifier verifier = new SqlScriptVerifier(new ITConnectionProvider()); verifier.verifyStatementsInFile( - "ITReadWriteAutocommitSpannerTest.sql", SqlScriptVerifier.class, true); + "ITReadWriteAutocommitSpannerTest.sql", SqlScriptVerifier.class); } @Test diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITSqlScriptTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITSqlScriptTest.java index be20ec3c4591..9f60ae6ccb00 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITSqlScriptTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITSqlScriptTest.java @@ -62,10 +62,7 @@ public class ITSqlScriptTest extends ITAbstractSpannerTest { public void test01_CreateTables() throws Exception { try (ITConnection connection = createConnection()) { verifier.verifyStatementsInFile( - SpannerGenericConnection.of(connection), - CREATE_TABLES_FILE, - SqlScriptVerifier.class, - true); + SpannerGenericConnection.of(connection), CREATE_TABLES_FILE, SqlScriptVerifier.class); } } @@ -75,8 +72,7 @@ public void test02_InsertTestData() throws Exception { verifier.verifyStatementsInFile( SpannerGenericConnection.of(connection), INSERT_AND_VERIFY_TEST_DATA, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -86,8 +82,7 @@ public void test03_TestGetReadTimestamp() throws Exception { verifier.verifyStatementsInFile( SpannerGenericConnection.of(connection), TEST_GET_READ_TIMESTAMP, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -97,8 +92,7 @@ public void test04_TestGetCommitTimestamp() throws Exception { verifier.verifyStatementsInFile( SpannerGenericConnection.of(connection), TEST_GET_COMMIT_TIMESTAMP, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -108,8 +102,7 @@ public void test05_TestTemporaryTransactions() throws Exception { verifier.verifyStatementsInFile( SpannerGenericConnection.of(connection), TEST_TEMPORARY_TRANSACTIONS, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -117,10 +110,7 @@ public void test05_TestTemporaryTransactions() throws Exception { public void test06_TestTransactionMode() throws Exception { try (ITConnection connection = createConnection()) { verifier.verifyStatementsInFile( - SpannerGenericConnection.of(connection), - TEST_TRANSACTION_MODE, - SqlScriptVerifier.class, - true); + SpannerGenericConnection.of(connection), TEST_TRANSACTION_MODE, SqlScriptVerifier.class); } } @@ -130,8 +120,7 @@ public void test07_TestTransactionModeReadOnly() throws Exception { verifier.verifyStatementsInFile( SpannerGenericConnection.of(connection), TEST_TRANSACTION_MODE_READ_ONLY, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -141,8 +130,7 @@ public void test08_TestReadOnlyStaleness() throws Exception { verifier.verifyStatementsInFile( SpannerGenericConnection.of(connection), TEST_READ_ONLY_STALENESS, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -152,8 +140,7 @@ public void test09_TestAutocommitDmlMode() throws Exception { verifier.verifyStatementsInFile( SpannerGenericConnection.of(connection), TEST_AUTOCOMMIT_DML_MODE, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -163,8 +150,7 @@ public void test10_TestAutocommitReadOnly() throws Exception { verifier.verifyStatementsInFile( SpannerGenericConnection.of(connection), TEST_AUTOCOMMIT_READ_ONLY, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } @@ -172,10 +158,7 @@ public void test10_TestAutocommitReadOnly() throws Exception { public void test11_TestStatementTimeout() throws Exception { try (ITConnection connection = createConnection()) { verifier.verifyStatementsInFile( - SpannerGenericConnection.of(connection), - TEST_STATEMENT_TIMEOUT, - SqlScriptVerifier.class, - true); + SpannerGenericConnection.of(connection), TEST_STATEMENT_TIMEOUT, SqlScriptVerifier.class); } } @@ -183,10 +166,7 @@ public void test11_TestStatementTimeout() throws Exception { public void test12_TestSetStatements() throws Exception { try (ITConnection connection = createConnection()) { verifier.verifyStatementsInFile( - SpannerGenericConnection.of(connection), - TEST_SET_STATEMENTS, - SqlScriptVerifier.class, - true); + SpannerGenericConnection.of(connection), TEST_SET_STATEMENTS, SqlScriptVerifier.class); } } @@ -196,8 +176,7 @@ public void test13_TestInvalidStatements() throws Exception { verifier.verifyStatementsInFile( SpannerGenericConnection.of(connection), TEST_INVALID_STATEMENTS, - SqlScriptVerifier.class, - true); + SqlScriptVerifier.class); } } } diff --git a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITTransactionModeTest.java b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITTransactionModeTest.java index 7e3959e8449a..19c204a75254 100644 --- a/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITTransactionModeTest.java +++ b/google-cloud-clients/google-cloud-contrib/google-cloud-spanner-jdbc/src/test/java/com/google/cloud/spanner/jdbc/it/ITTransactionModeTest.java @@ -55,7 +55,7 @@ public boolean doCreateDefaultTestTable() { @Test public void testSqlScript() throws Exception { SqlScriptVerifier verifier = new SqlScriptVerifier(new ITConnectionProvider()); - verifier.verifyStatementsInFile("ITTransactionModeTest.sql", SqlScriptVerifier.class, true); + verifier.verifyStatementsInFile("ITTransactionModeTest.sql", SqlScriptVerifier.class); } @Test