Skip to content

Commit 45b4621

Browse files
committed
---
yaml --- r: 2115 b: refs/heads/pubsub-alpha c: 2d1a368 h: refs/heads/master i: 2113: ddb8225 2111: baf9e48
1 parent 986a7c4 commit 45b4621

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
@@ -3,7 +3,7 @@ refs/heads/master: 689bbb466df4b2d5d2483d6edb8ac5c7c7f7c6fa
33
refs/heads/travis: e21ee7b88a5edc3f3d8c71f90c3fc32abf7e8dd6
44
refs/heads/gh-pages: 4e0561bb4504bf647db669a14417b2b2c87ba45d
55
refs/heads/bigquery: 762fa5830e6c398c0396177e3e7fd243bd62cfc3
6-
refs/heads/pubsub-alpha: 0fa9b51bceb2a29424851725d80be9aa799c3202
6+
refs/heads/pubsub-alpha: 2d1a368fd2bb455b7bec909f0cdd4f44a86ad1dc
77
refs/heads/resource-manager: ebf4adc5ee835cd2086c4ac5b4e78d01a5a005a7
88
refs/heads/update-datastore: 482954f2c5055231e5b3122ea91d2ba00ce8187c
99
refs/tags/0.0.9: 22f1839238f66c39e67ed4dfdcd273b1ae2e8444

branches/pubsub-alpha/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/pubsub-alpha/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/pubsub-alpha/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)