Skip to content

Commit c272165

Browse files
committed
reformatted
1 parent 40b3f89 commit c272165

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/ITAbstractSpannerTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import com.google.cloud.NoCredentials;
2020
import com.google.cloud.spanner.Database;
21-
import com.google.cloud.spanner.Dialect;
2221
import com.google.cloud.spanner.ErrorCode;
2322
import com.google.cloud.spanner.GceTestEnvConfig;
2423
import com.google.cloud.spanner.IntegrationTestEnv;
@@ -323,7 +322,9 @@ protected boolean tableExists(Connection connection, String table) {
323322
try (ResultSet rs =
324323
connection.executeQuery(
325324
Statement.newBuilder(
326-
String.format("SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE UPPER(TABLE_NAME)=UPPER(\'%s\')", table))
325+
String.format(
326+
"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE UPPER(TABLE_NAME)=UPPER(\'%s\')",
327+
table))
327328
.build())) {
328329
while (rs.next()) {
329330
return true;

google-cloud-spanner/src/test/java/com/google/cloud/spanner/connection/it/ITExplainTest.java

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,13 @@ public void appendConnectionUri(StringBuilder uri) {
4444
}
4545

4646
@BeforeClass
47-
public static void setupPostgreSQL(){
48-
database = env.getTestHelper().createTestDatabase(Dialect.POSTGRESQL, Collections.emptyList());;
47+
public static void setupPostgreSQL() {
48+
database = env.getTestHelper().createTestDatabase(Dialect.POSTGRESQL, Collections.emptyList());
49+
;
4950
}
5051

51-
5252
@Before
5353
public void createTestTable() {
54-
5554
try (Connection connection = createConnection()) {
5655
connection.setAutocommit(true);
5756
if (!tableExists(connection, "TEST")) {
@@ -63,21 +62,20 @@ public void createTestTable() {
6362
connection.runBatch();
6463
}
6564
}
66-
6765
}
6866

6967
@Test
7068
public void testExplainStatement() {
7169
try (ITConnection connection = createConnection()) {
7270
connection.bufferedWrite(
7371
Arrays.asList(
74-
Mutation.newInsertBuilder("TEST").set("ID").to(1L).set("NAME").to("TEST-1").build(),
75-
Mutation.newInsertBuilder("TEST").set("ID").to(2L).set("NAME").to("TEST-2").build()));
72+
Mutation.newInsertBuilder("TEST").set("ID").to(3L).set("NAME").to("TEST-3").build(),
73+
Mutation.newInsertBuilder("TEST").set("ID").to(4L).set("NAME").to("TEST-4").build()));
7674
connection.commit();
7775

7876
ResultSet resultSet =
7977
connection.execute(Statement.of("EXPLAIN SELECT * from TEST")).getResultSet();
80-
while(resultSet.next()){
78+
while (resultSet.next()) {
8179
assertNotNull(resultSet.getString("QUERY PLAN"));
8280
}
8381
assertEquals(1, resultSet.getColumnCount());
@@ -95,12 +93,11 @@ public void testExplainAnalyzeStatement() {
9593

9694
ResultSet resultSet =
9795
connection.execute(Statement.of("EXPLAIN ANALYZE SELECT * from TEST")).getResultSet();
98-
while(resultSet.next()){
96+
while (resultSet.next()) {
9997
assertNotNull(resultSet.getString("QUERY PLAN"));
10098
assertNotNull(resultSet.getString("EXECUTION STATS"));
10199
}
102100
assertEquals(2, resultSet.getColumnCount());
103101
}
104102
}
105-
106103
}

0 commit comments

Comments
 (0)