Skip to content

Commit 870f8f6

Browse files
committed
Reduce format changes
1 parent 8870ac0 commit 870f8f6

4 files changed

Lines changed: 80 additions & 34 deletions

File tree

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITAuthTests.java

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,9 @@ public void testValidGoogleUserAccountAuthentication() throws SQLException {
191191
getBaseConnectionUrl()
192192
+ "PROJECTID="
193193
+ PROJECT_ID
194-
+ ";OAuthType=1;OAuthClientId=client_id;OAuthClientSecret=client_secret;";
194+
+ ";OAuthType=1;"
195+
+ "OAuthClientId=client_id;"
196+
+ "OAuthClientSecret=client_secret;";
195197

196198
Connection connection = DriverManager.getConnection(connection_uri);
197199
assertNotNull(connection);
@@ -215,8 +217,10 @@ public void testValidExternalAccountAuthentication() throws SQLException {
215217
+ PROJECT_ID
216218
+ ";OAUTHTYPE=4;"
217219
+ "BYOID_AudienceUri=//iam.googleapis.com/projects/<project>/locations/<location>/workloadIdentityPools/<pool>/providers/<provider>;"
218-
+ "BYOID_SubjectTokenType=<type>;BYOID_CredentialSource={\"file\":\"/path/to/file\"};"
219-
+ "BYOID_SA_Impersonation_Uri=<sa>;BYOID_TokenUri=<uri>;";
220+
+ "BYOID_SubjectTokenType=<type>;"
221+
+ "BYOID_CredentialSource={\"file\":\"/path/to/file\"};"
222+
+ "BYOID_SA_Impersonation_Uri=<sa>;"
223+
+ "BYOID_TokenUri=<uri>;";
220224

221225
Connection connection = DriverManager.getConnection(connection_uri);
222226
assertNotNull(connection);
@@ -261,7 +265,8 @@ public void testValidExternalAccountAuthenticationRawJson() throws SQLException
261265
getBaseConnectionUrl()
262266
+ "PROJECTID="
263267
+ PROJECT_ID
264-
+ ";OAUTHTYPE=4;OAuthPvtKey={\n"
268+
+ ";OAUTHTYPE=4;"
269+
+ "OAuthPvtKey={\n"
265270
+ " \"universe_domain\": \"googleapis.com\",\n"
266271
+ " \"type\": \"external_account\",\n"
267272
+ " \"audience\":"
@@ -323,8 +328,10 @@ public void testValidRefreshTokenAuthentication() throws SQLException {
323328
getBaseConnectionUrl()
324329
+ "PROJECTID="
325330
+ PROJECT_ID
326-
+ ";OAUTHTYPE=2;OAuthRefreshToken=refresh_token;"
327-
+ ";OAuthClientId=client;OAuthClientSecret=secret;";
331+
+ ";OAUTHTYPE=2;"
332+
+ "OAuthRefreshToken=refresh_token;"
333+
+ ";OAuthClientId=client;"
334+
+ "OAuthClientSecret=secret;";
328335

329336
Connection connection = DriverManager.getConnection(connection_uri);
330337
assertNotNull(connection);

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITBigQueryJDBCTest.java

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ public void testValidAllDataTypesSerializationFromSelectQueryArrowDataset() thro
107107
String selectQuery = "select * from " + DATASET + "." + TABLE_NAME + " LIMIT 5000;";
108108
String connection_uri =
109109
ITBigQueryJDBCTest.connection_uri
110-
+ "EnableHighThroughputAPI=1;HighThroughputActivationRatio=2;HighThroughputMinTableSize=1000;";
110+
+ "EnableHighThroughputAPI=1;"
111+
+ "HighThroughputActivationRatio=2;"
112+
+ "HighThroughputMinTableSize=1000;";
111113

112114
// Read data via JDBC
113115
Connection connection = DriverManager.getConnection(connection_uri);
@@ -234,8 +236,10 @@ public void testReadAPIPathLarge() throws SQLException {
234236
public void testReadAPIPathLargeWithThresholdParameters() throws SQLException {
235237
String connectionUri =
236238
ITBigQueryJDBCTest.connection_uri
237-
+ "MaxResults=300;HighThroughputActivationRatio=2;"
238-
+ "HighThroughputMinTableSize=100;EnableHighThroughputAPI=1";
239+
+ "MaxResults=300;"
240+
+ "HighThroughputActivationRatio=2;"
241+
+ "HighThroughputMinTableSize=100;"
242+
+ "EnableHighThroughputAPI=1";
239243
Connection connection = DriverManager.getConnection(connectionUri);
240244
Statement statement = connection.createStatement();
241245
int expectedCnt = 1000;
@@ -251,7 +255,8 @@ public void testReadAPIPathLargeWithThresholdNotMet() throws SQLException {
251255
String connectionUri =
252256
ITBigQueryJDBCTest.connection_uri
253257
+ "HighThroughputActivationRatio=4;"
254-
+ "HighThroughputMinTableSize=100;EnableHighThroughputAPI=1";
258+
+ "HighThroughputMinTableSize=100;"
259+
+ "EnableHighThroughputAPI=1";
255260
Connection connection = DriverManager.getConnection(connectionUri);
256261
Statement statement = connection.createStatement();
257262
int expectedCnt = 5000;
@@ -1261,7 +1266,12 @@ public void testUnsupportedHTAPIFallbacksToStandardQueriesWithRange() throws SQL
12611266
String selectQuery = "select * from `DATATYPERANGETEST.RangeIntervalTestTable` LIMIT 5000;";
12621267
String connection_uri =
12631268
ITBigQueryJDBCTest.connection_uri
1264-
+ "MaxResults=500;HighThroughputActivationRatio=1;HighThroughputMinTableSize=100;EnableHighThroughputAPI=1;UnsupportedHTAPIFallback=1;JobCreationMode=1;";
1269+
+ "MaxResults=500;"
1270+
+ "HighThroughputActivationRatio=1;"
1271+
+ "HighThroughputMinTableSize=100;"
1272+
+ "EnableHighThroughputAPI=1;"
1273+
+ "UnsupportedHTAPIFallback=1;"
1274+
+ "JobCreationMode=1;";
12651275

12661276
// Read data via JDBC
12671277
Connection connection = DriverManager.getConnection(connection_uri);
@@ -1281,7 +1291,11 @@ public void testIntervalDataTypeWithArrowResultSet() throws SQLException {
12811291
"select * from `DATATYPERANGETEST.RangeIntervalTestTable` order by intColumn limit 5000;";
12821292
String connection_uri =
12831293
ITBigQueryJDBCTest.connection_uri
1284-
+ "MaxResults=500;HighThroughputActivationRatio=0;HighThroughputMinTableSize=100;EnableHighThroughputAPI=1;JobCreationMode=1;";
1294+
+ "MaxResults=500;"
1295+
+ "HighThroughputActivationRatio=0;"
1296+
+ "HighThroughputMinTableSize=100;"
1297+
+ "EnableHighThroughputAPI=1;"
1298+
+ "JobCreationMode=1;";
12851299

12861300
// Read data via JDBC
12871301
Connection connection = DriverManager.getConnection(connection_uri);
@@ -1302,7 +1316,11 @@ public void testIntervalDataTypeWithJsonResultSet() throws SQLException {
13021316
"select * from `DATATYPERANGETEST.RangeIntervalTestTable` order by intColumn limit 10 ;";
13031317
String connection_uri =
13041318
ITBigQueryJDBCTest.connection_uri
1305-
+ "MaxResults=500;HighThroughputActivationRatio=1;HighThroughputMinTableSize=100;EnableHighThroughputAPI=0;JobCreationMode=1;";
1319+
+ "MaxResults=500;"
1320+
+ "HighThroughputActivationRatio=1;"
1321+
+ "HighThroughputMinTableSize=100;"
1322+
+ "EnableHighThroughputAPI=0;"
1323+
+ "JobCreationMode=1;";
13061324

13071325
// Read data via JDBC
13081326
Connection connection = DriverManager.getConnection(connection_uri);
@@ -1678,7 +1696,7 @@ public void testNonEnabledUseLegacySQLThrowsSyntaxError() throws SQLException {
16781696
public void testUseLegacySQLWithLargeResultsNotAllowedQueries() throws SQLException {
16791697
// setup
16801698
String connection_uri =
1681-
ITBigQueryJDBCTest.connection_uri + "QueryDialect=BIG_QUERY;AllowLargeResults=0;";
1699+
ITBigQueryJDBCTest.connection_uri + "QueryDialect=BIG_QUERY;" + "AllowLargeResults=0;";
16821700
String selectLegacyQuery =
16831701
"SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 250000;";
16841702
Connection connection = DriverManager.getConnection(connection_uri, new Properties());
@@ -1756,7 +1774,7 @@ public void testUseLegacySQLWithLargeResultsAllowedWithNoDestinationTableDefault
17561774
throws SQLException {
17571775
// setup
17581776
String connection_uri =
1759-
ITBigQueryJDBCTest.connection_uri + "QueryDialect=BIG_QUERY;AllowLargeResults=1;";
1777+
ITBigQueryJDBCTest.connection_uri + "QueryDialect=BIG_QUERY;" + "AllowLargeResults=1;";
17601778
String selectLegacyQuery =
17611779
"SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 250000;";
17621780
Connection connection = DriverManager.getConnection(connection_uri, new Properties());
@@ -1908,7 +1926,11 @@ public void testRangeDataTypeWithArrowResultSet() throws SQLException {
19081926

19091927
String connection_uri =
19101928
ITBigQueryJDBCTest.connection_uri
1911-
+ "MaxResults=500;HighThroughputActivationRatio=0;HighThroughputMinTableSize=100;EnableHighThroughputAPI=1;JobCreationMode=1;";
1929+
+ "MaxResults=500;"
1930+
+ "HighThroughputActivationRatio=0;"
1931+
+ "HighThroughputMinTableSize=100;"
1932+
+ "EnableHighThroughputAPI=1;"
1933+
+ "JobCreationMode=1;";
19121934

19131935
// Read data via JDBC
19141936
Connection connection = DriverManager.getConnection(connection_uri);

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITConnectionPoolingTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class ITConnectionPoolingTest extends ITBase {
4343

4444
@Test
4545
public void testPooledConnectionDataSourceSuccess() throws SQLException {
46-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
46+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
4747

4848
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
4949
pooledDataSource.setURL(connectionUrl);
@@ -70,7 +70,7 @@ public void testPooledConnectionDataSourceFailInvalidConnectionURl() {
7070

7171
@Test
7272
public void testPooledConnectionAddConnectionListener() throws SQLException {
73-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
73+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
7474

7575
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
7676
pooledDataSource.setURL(connectionUrl);
@@ -85,7 +85,7 @@ public void testPooledConnectionAddConnectionListener() throws SQLException {
8585

8686
@Test
8787
public void testPooledConnectionRemoveConnectionListener() throws SQLException {
88-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
88+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
8989

9090
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
9191
pooledDataSource.setURL(connectionUrl);
@@ -100,7 +100,7 @@ public void testPooledConnectionRemoveConnectionListener() throws SQLException {
100100

101101
@Test
102102
public void testPooledConnectionConnectionClosed() throws SQLException {
103-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
103+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
104104

105105
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
106106
pooledDataSource.setURL(connectionUrl);
@@ -123,7 +123,7 @@ public void testPooledConnectionConnectionClosed() throws SQLException {
123123

124124
@Test
125125
public void testPooledConnectionClose() throws SQLException {
126-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
126+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
127127

128128
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
129129
pooledDataSource.setURL(connectionUrl);
@@ -142,7 +142,7 @@ public void testPooledConnectionClose() throws SQLException {
142142

143143
@Test
144144
public void testPooledConnectionConnectionError() throws SQLException {
145-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
145+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
146146

147147
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
148148
pooledDataSource.setURL(connectionUrl);
@@ -170,7 +170,7 @@ public void testPooledConnectionConnectionError() throws SQLException {
170170

171171
@Test
172172
public void testPooledConnectionListenerAddListener() throws SQLException {
173-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
173+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
174174

175175
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
176176
pooledDataSource.setURL(connectionUrl);
@@ -185,7 +185,7 @@ public void testPooledConnectionListenerAddListener() throws SQLException {
185185

186186
@Test
187187
public void testPooledConnectionListenerRemoveListener() throws SQLException {
188-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
188+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
189189

190190
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
191191
pooledDataSource.setURL(connectionUrl);
@@ -203,7 +203,7 @@ public void testPooledConnectionListenerRemoveListener() throws SQLException {
203203

204204
@Test
205205
public void testPooledConnectionListenerCloseConnection() throws SQLException {
206-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
206+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
207207

208208
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
209209
pooledDataSource.setURL(connectionUrl);
@@ -225,7 +225,7 @@ public void testPooledConnectionListenerCloseConnection() throws SQLException {
225225

226226
@Test
227227
public void testPooledConnectionListenerClosePooledConnection() throws SQLException {
228-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
228+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
229229

230230
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
231231
pooledDataSource.setURL(connectionUrl);
@@ -242,7 +242,7 @@ public void testPooledConnectionListenerClosePooledConnection() throws SQLExcept
242242

243243
@Test
244244
public void testPooledConnectionListenerConnectionError() throws SQLException {
245-
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;ListenerPoolSize=20;";
245+
String connectionUrl = ITBase.connectionUrl + "ConnectionPoolSize=20;" + "ListenerPoolSize=20;";
246246

247247
PooledConnectionDataSource pooledDataSource = new PooledConnectionDataSource();
248248
pooledDataSource.setURL(connectionUrl);

java-bigquery-jdbc/src/test/java/com/google/cloud/bigquery/jdbc/it/ITNightlyBigQueryTest.java

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,10 @@ public void testHTAPIWithValidDestinationTableSavesQueriesWithStandardSQL() thro
338338
// setup
339339
String connection_uri =
340340
ITNightlyBigQueryTest.connection_uri
341-
+ "QueryDialect=SQL;LargeResultTable=destination_table_test;LargeResultDataset=INTEGRATION_TESTS;EnableHighThroughputAPI=1;";
341+
+ "QueryDialect=SQL;"
342+
+ "LargeResultTable=destination_table_test;"
343+
+ "LargeResultDataset=INTEGRATION_TESTS;"
344+
+ "EnableHighThroughputAPI=1;";
342345
String selectLegacyQuery =
343346
"SELECT * FROM `bigquery-public-data.deepmind_alphafold.metadata` LIMIT 200000;";
344347
Driver driver = BigQueryDriver.getRegisteredDriver();
@@ -722,7 +725,10 @@ public void testHTAPIWithValidDestinationTableSavesQueriesWithLegacy() throws SQ
722725
// setup
723726
String connection_uri =
724727
ITNightlyBigQueryTest.connection_uri
725-
+ "QueryDialect=BIG_QUERY;LargeResultTable=destination_table_test;LargeResultDataset=INTEGRATION_TESTS;EnableHighThroughputAPI=1;";
728+
+ "QueryDialect=BIG_QUERY;"
729+
+ "LargeResultTable=destination_table_test;"
730+
+ "LargeResultDataset=INTEGRATION_TESTS;"
731+
+ "EnableHighThroughputAPI=1;";
726732
String selectLegacyQuery =
727733
"SELECT * FROM [bigquery-public-data.deepmind_alphafold.metadata] LIMIT 200000;";
728734
Driver driver = BigQueryDriver.getRegisteredDriver();
@@ -1104,7 +1110,9 @@ public void testValidAllDataTypesSerializationFromSelectQueryArrowDataset() thro
11041110
String selectQuery = "select * from " + DATASET + "." + TABLE_NAME + " LIMIT 5000;";
11051111
String connection_uri =
11061112
ITNightlyBigQueryTest.connection_uri
1107-
+ "EnableHighThroughputAPI=1;HighThroughputActivationRatio=2;HighThroughputMinTableSize=1000;";
1113+
+ "EnableHighThroughputAPI=1;"
1114+
+ "HighThroughputActivationRatio=2;"
1115+
+ "HighThroughputMinTableSize=1000;";
11081116

11091117
// Read data via JDBC
11101118
Connection connection = DriverManager.getConnection(connection_uri);
@@ -1162,7 +1170,9 @@ public void testBulkInsertOperation() throws SQLException {
11621170

11631171
String connection_uri =
11641172
ITNightlyBigQueryTest.connection_uri
1165-
+ "EnableWriteAPI=1;SWA_ActivationRowCount=5;SWA_AppendRowCount=500";
1173+
+ "EnableWriteAPI=1;"
1174+
+ "SWA_ActivationRowCount=5;"
1175+
+ "SWA_AppendRowCount=500";
11661176

11671177
try (Connection connection = DriverManager.getConnection(connection_uri)) {
11681178
bigQueryStatement.execute(createQuery);
@@ -1209,7 +1219,9 @@ public void testBulkInsertOperationStandard() throws SQLException {
12091219

12101220
String connection_uri =
12111221
ITNightlyBigQueryTest.connection_uri
1212-
+ "EnableWriteAPI=0;SWA_ActivationRowCount=50;SWA_AppendRowCount=500";
1222+
+ "EnableWriteAPI=0;"
1223+
+ "SWA_ActivationRowCount=50;"
1224+
+ "SWA_AppendRowCount=500";
12131225

12141226
try (Connection connection = DriverManager.getConnection(connection_uri)) {
12151227
bigQueryStatement.execute(createQuery);
@@ -1625,7 +1637,10 @@ public void testReadAPIPathLarge() throws SQLException {
16251637
public void testReadAPIPathLargeWithThresholdParameters() throws SQLException {
16261638
String connectionUri =
16271639
ITNightlyBigQueryTest.connection_uri
1628-
+ "MaxResults=300;HighThroughputActivationRatio=2;HighThroughputMinTableSize=100;EnableHighThroughputAPI=1";
1640+
+ "MaxResults=300;"
1641+
+ "HighThroughputActivationRatio=2;"
1642+
+ "HighThroughputMinTableSize=100;"
1643+
+ "EnableHighThroughputAPI=1";
16291644

16301645
Connection connection = DriverManager.getConnection(connectionUri);
16311646
Statement statement = connection.createStatement();
@@ -1642,7 +1657,9 @@ public void testReadAPIPathLargeWithThresholdParameters() throws SQLException {
16421657
public void testReadAPIPathLargeWithThresholdNotMet() throws SQLException {
16431658
String connectionUri =
16441659
ITNightlyBigQueryTest.connection_uri
1645-
+ "HighThroughputActivationRatio=4;HighThroughputMinTableSize=100;EnableHighThroughputAPI=1";
1660+
+ "HighThroughputActivationRatio=4;"
1661+
+ "HighThroughputMinTableSize=100;"
1662+
+ "EnableHighThroughputAPI=1";
16461663

16471664
Connection connection = DriverManager.getConnection(connectionUri);
16481665
Statement statement = connection.createStatement();

0 commit comments

Comments
 (0)