Skip to content

Commit 9610820

Browse files
committed
---
yaml --- r: 6693 b: refs/heads/tswast-patch-1 c: 2d1a368 h: refs/heads/master i: 6691: 93017bf
1 parent 75cbaa0 commit 9610820

4 files changed

Lines changed: 11 additions & 26 deletions

File tree

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,5 @@ refs/tags/v0.18.0: 9d193c4c4b9d1c6f21515dd8e50836b9194ec9bb
5757
refs/tags/v0.19.0: e67b56e4d8dad5f9a7b38c9b2107c23c828f2ed5
5858
refs/tags/v0.20.0: 839f7fb7156535146aa1cb2c5aadd8d375d854e8
5959
refs/tags/v0.20.1: 370471f437f1f4f68a11e068df5cd6bf39edb1fa
60-
refs/heads/tswast-patch-1: 0fa9b51bceb2a29424851725d80be9aa799c3202
60+
refs/heads/tswast-patch-1: 2d1a368fd2bb455b7bec909f0cdd4f44a86ad1dc
6161
refs/heads/pubsub-streaming-pull: 19262b752ee874eb2ca3b950eb2aef44d5a5267b

branches/tswast-patch-1/gcloud-java-bigquery/src/test/java/com/google/gcloud/bigquery/ITBigQueryTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ public void testInsertAll() {
476476
}
477477

478478
@Test
479-
public void testInsertAllWithSuffix() {
479+
public void testInsertAllWithSuffix() throws InterruptedException {
480480
String tableName = "test_insert_all_with_suffix_table";
481481
BaseTableInfo tableInfo = TableInfo.of(TableId.of(DATASET, tableName), TABLE_SCHEMA);
482482
assertNotNull(bigquery.create(tableInfo));
@@ -505,7 +505,12 @@ public void testInsertAllWithSuffix() {
505505
assertFalse(response.hasErrors());
506506
assertEquals(0, response.insertErrors().size());
507507
String newTableName = tableName + "_suffix";
508-
assertNotNull(bigquery.getTable(DATASET, newTableName, TableOption.fields()));
508+
BaseTableInfo suffixTable = bigquery.getTable(DATASET, newTableName, TableOption.fields());
509+
while (suffixTable == null) {
510+
Thread.sleep(1000L);
511+
suffixTable = bigquery.getTable(DATASET, newTableName, TableOption.fields());
512+
}
513+
assertNotNull(suffixTable);
509514
assertTrue(bigquery.delete(TableId.of(DATASET, tableName)));
510515
assertTrue(bigquery.delete(TableId.of(DATASET, newTableName)));
511516
}

branches/tswast-patch-1/gcloud-java-resourcemanager/src/main/java/com/google/gcloud/resourcemanager/Project.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ public Project(ResourceManager resourceManager, ProjectInfo projectInfo) {
4242
/**
4343
* Constructs a Project object that contains project information loaded from the server.
4444
*
45-
* @return Project object containing the project's metadata or {@code null} if not found
45+
* @return Project object containing the project's metadata
4646
* @throws ResourceManagerException upon failure
4747
*/
4848
public static Project load(ResourceManager resourceManager, String projectId) {
4949
ProjectInfo projectInfo = resourceManager.get(projectId);
50-
return projectInfo != null ? new Project(resourceManager, projectInfo) : null;
50+
return new Project(resourceManager, projectInfo);
5151
}
5252

5353
/**
@@ -67,7 +67,7 @@ public ResourceManager resourceManager() {
6767
/**
6868
* Returns a Project object with updated project information.
6969
*
70-
* @return Project object containing the project's updated metadata or {@code null} if not found
70+
* @return Project object containing the project's updated metadata
7171
* @throws ResourceManagerException upon failure
7272
*/
7373
public Project reload() {

branches/tswast-patch-1/gcloud-java-resourcemanager/src/test/java/com/google/gcloud/resourcemanager/ProjectTest.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
import static org.easymock.EasyMock.replay;
2222
import static org.easymock.EasyMock.verify;
2323
import static org.junit.Assert.assertEquals;
24-
import static org.junit.Assert.assertNotNull;
25-
import static org.junit.Assert.assertNull;
2624
import static org.junit.Assert.assertSame;
2725

2826
import com.google.common.collect.ImmutableMap;
@@ -80,24 +78,6 @@ public void testReload() {
8078
assertEquals(newInfo, newProject.info());
8179
}
8280

83-
@Test
84-
public void testLoadNull() {
85-
expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(null);
86-
replay(resourceManager);
87-
assertNull(Project.load(resourceManager, PROJECT_INFO.projectId()));
88-
}
89-
90-
@Test
91-
public void testReloadDeletedProject() {
92-
expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(PROJECT_INFO);
93-
expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(null);
94-
replay(resourceManager);
95-
Project loadedProject = Project.load(resourceManager, PROJECT_INFO.projectId());
96-
assertNotNull(loadedProject);
97-
Project reloadedProject = loadedProject.reload();
98-
assertNull(reloadedProject);
99-
}
100-
10181
@Test
10282
public void testInfo() {
10383
replay(resourceManager);

0 commit comments

Comments
 (0)