|
@@ -3,13 +3,14 @@ package com.owncloud.android;
|
|
|
import com.owncloud.android.db.OCUpload;
|
|
|
import com.owncloud.android.files.services.FileUploader;
|
|
|
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
|
|
+import com.owncloud.android.operations.RemoveFileOperation;
|
|
|
import com.owncloud.android.operations.UploadFileOperation;
|
|
|
import com.owncloud.android.utils.FileStorageUtils;
|
|
|
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
|
|
-import androidx.test.runner.AndroidJUnit4;
|
|
|
+import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
|
|
|
|
import static junit.framework.TestCase.assertTrue;
|
|
|
|
|
@@ -28,6 +29,9 @@ public class UploadIT extends AbstractIT {
|
|
|
RemoteOperationResult result = testUpload(ocUpload);
|
|
|
|
|
|
assertTrue(result.isSuccess());
|
|
|
+
|
|
|
+ // cleanup
|
|
|
+ new RemoveFileOperation("/testUpload/", false, account, false, context).execute(client, getStorageManager());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
@@ -38,6 +42,9 @@ public class UploadIT extends AbstractIT {
|
|
|
RemoteOperationResult result = testUpload(ocUpload);
|
|
|
|
|
|
assertTrue(result.isSuccess());
|
|
|
+
|
|
|
+ // cleanup
|
|
|
+ new RemoveFileOperation("/testUpload/", false, account, false, context).execute(client, getStorageManager());
|
|
|
}
|
|
|
|
|
|
@Test
|
|
@@ -48,6 +55,9 @@ public class UploadIT extends AbstractIT {
|
|
|
RemoteOperationResult result = testUpload(ocUpload);
|
|
|
|
|
|
assertTrue(result.isSuccess());
|
|
|
+
|
|
|
+ // cleanup
|
|
|
+ new RemoveFileOperation("/testUpload/", false, account, false, context).execute(client, getStorageManager());
|
|
|
}
|
|
|
|
|
|
public RemoteOperationResult testUpload(OCUpload ocUpload) {
|
|
@@ -92,5 +102,8 @@ public class UploadIT extends AbstractIT {
|
|
|
|
|
|
RemoteOperationResult result = newUpload.execute(client, getStorageManager());
|
|
|
assertTrue(result.isSuccess());
|
|
|
+
|
|
|
+ // cleanup
|
|
|
+ new RemoveFileOperation("/testUpload/", false, account, false, context).execute(client, getStorageManager());
|
|
|
}
|
|
|
}
|