Skip to content

Commit 7bda996

Browse files
authored
Merge 28b1b98 into ac5883e
2 parents ac5883e + 28b1b98 commit 7bda996

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

firebase-storage/src/main/java/com/google/firebase/storage/UploadTask.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ protected void schedule() {
226226
}
227227

228228
if (mStorageRef.getParent() == null) {
229+
System.out.println("Illegal!");
229230
mException =
230231
new IllegalArgumentException(
231232
"Cannot upload to getRoot. You should upload to a "
@@ -569,6 +570,7 @@ public void run() {
569570
@NonNull
570571
/*package*/ TaskSnapshot snapStateImpl() {
571572
Exception error = mException != null ? mException : mServerException;
573+
System.out.println(error);
572574
return new TaskSnapshot(
573575
StorageException.fromExceptionAndHttpCode(error, mResultCode),
574576
mBytesUploaded.get(),

firebase-storage/src/test/java/com/google/firebase/storage/UploadTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,20 @@ public void cantUploadToRoot() throws Exception {
141141

142142
final UploadTask task = storage.putBytes(new byte[] {});
143143

144+
// This is a bad test. We assume at this stage that the task isn't done yet.
144145
try {
145146
task.getResult();
146147
Assert.fail();
147-
} catch (IllegalStateException ignore) {
148+
} catch (Exception notIgnore) {
149+
System.out.println("MTEWANI: EXCEPTION: " + notIgnore);
148150
// Task is not yet done.
149151
}
150152

151153
Assert.assertNull(task.getException());
152154

153155
task.addOnFailureListener(
154156
(exception) -> {
157+
System.out.println("e:" + exception);
155158
Assert.assertEquals(
156159
"Cannot upload to getRoot. You should upload to a storage location such as "
157160
+ ".getReference('image.png').putFile...",

firebase-storage/src/testUtil/java/com/google/firebase/storage/TestUploadHelper.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ private static void verifyTaskCount(StorageReference reference, int expectedTask
696696
"Expected active upload task at location %s to contain %s item(s), "
697697
+ "but contained %s item(s)",
698698
reference.getParent(),
699+
expectedTasks,
699700
uploadTasksAtParent.size());
700701
}
701702

0 commit comments

Comments
 (0)