Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BigQuery:Fix deprecated warnings removed #5240

Merged
merged 2 commits into from
May 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ public void testDeleteTable() {
EasyMock.expect(bigqueryRpcMock.deleteTable(PROJECT, DATASET, TABLE)).andReturn(true);
EasyMock.replay(bigqueryRpcMock);
bigquery = options.getService();
assertTrue(bigquery.delete(DATASET, TABLE));
assertTrue(bigquery.delete(TABLE_ID));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public Iterable<FieldValueList> getValues() {

replay(status, bigquery, mockOptions);
initializeJob(jobInfo);
assertThat(job.waitFor(TEST_RETRY_OPTIONS)).isSameAs(completedJob);
assertThat(job.waitFor(TEST_RETRY_OPTIONS)).isSameInstanceAs(completedJob);
assertThat(job.getQueryResults().iterateAll()).isEmpty();
verify(status, mockOptions);
}
Expand Down Expand Up @@ -345,7 +345,7 @@ public void testWaitForAndGetQueryResultsEmptyWithSchema() throws InterruptedExc

replay(status, bigquery, mockOptions);
initializeJob(jobInfo);
assertThat(job.waitFor(TEST_RETRY_OPTIONS)).isSameAs(completedJob);
assertThat(job.waitFor(TEST_RETRY_OPTIONS)).isSameInstanceAs(completedJob);
assertThat(job.getQueryResults().getSchema())
.isEqualTo(Schema.of(Field.of("field1", LegacySQLTypeName.BOOLEAN)));
verify(status, mockOptions);
Expand Down Expand Up @@ -424,7 +424,7 @@ public Iterable<FieldValueList> getValues() {

replay(status, bigquery, mockOptions);
initializeJob(jobInfo);
assertThat(job.waitFor(TEST_RETRY_OPTIONS)).isSameAs(completedJob);
assertThat(job.waitFor(TEST_RETRY_OPTIONS)).isSameInstanceAs(completedJob);
assertThat(job.getQueryResults().iterateAll()).hasSize(0);
verify(status, mockOptions);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ public void testListPartitions() throws InterruptedException {
List<String> partitions = bigquery.listPartitions(TableId.of(DATASET, tableName));
assertEquals(1, partitions.size());
} finally {
bigquery.delete(DATASET, tableName);
bigquery.delete(tableId);
}
}

Expand Down Expand Up @@ -806,7 +806,7 @@ public void testUpdateNonExistingTable() {

@Test
public void testDeleteNonExistingTable() {
assertFalse(bigquery.delete(DATASET, "test_delete_non_existing_table"));
assertFalse(bigquery.delete("test_delete_non_existing_table"));
}

@Test
Expand Down Expand Up @@ -1280,7 +1280,7 @@ public void testCreateAndGetJob() throws InterruptedException, TimeoutException

assertNotNull(completedJob);
assertNull(completedJob.getStatus().getError());
assertTrue(bigquery.delete(DATASET, destinationTableName));
assertTrue(bigquery.delete(destinationTable));
}

@Test
Expand Down Expand Up @@ -1330,7 +1330,7 @@ public void testCreateAndGetJobWithSelectedFields()
RetryOption.totalTimeout(Duration.ofMinutes(1)));
assertNotNull(completedJob);
assertNull(completedJob.getStatus().getError());
assertTrue(bigquery.delete(DATASET, destinationTableName));
assertTrue(bigquery.delete(destinationTable));
}

@Test
Expand Down Expand Up @@ -1388,7 +1388,7 @@ public void testQueryJob() throws InterruptedException, TimeoutException {
rowCount++;
}
assertEquals(2, rowCount);
assertTrue(bigquery.delete(DATASET, tableName));
assertTrue(bigquery.delete(destinationTable));
Job queryJob = bigquery.getJob(remoteJob.getJobId());
JobStatistics.QueryStatistics statistics = queryJob.getStatistics();
assertNotNull(statistics.getQueryPlan());
Expand Down Expand Up @@ -1435,7 +1435,7 @@ public void testExtractJob() throws InterruptedException, TimeoutException {
new String(storage.readAllBytes(BUCKET, EXTRACT_FILE), StandardCharsets.UTF_8);
assertEquals(
Sets.newHashSet(CSV_CONTENT.split("\n")), Sets.newHashSet(extractedCsv.split("\n")));
assertTrue(bigquery.delete(DATASET, tableName));
assertTrue(bigquery.delete(destinationTable));
}

@Test
Expand Down Expand Up @@ -1532,7 +1532,7 @@ public void testInsertFromFile() throws InterruptedException, IOException, Timeo
rowCount++;
}
assertEquals(2, rowCount);
assertTrue(bigquery.delete(DATASET, destinationTableName));
assertTrue(bigquery.delete(tableId));
}

@Test
Expand Down