mirror of
https://github.com/nextcloud/android.git
synced 2024-11-30 18:21:10 +03:00
- remove files after test
- use new AndroidJunit4 Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
parent
5b64410074
commit
b584ab79d2
2 changed files with 22 additions and 2 deletions
|
@ -2,12 +2,13 @@ package com.owncloud.android;
|
|||
|
||||
import com.owncloud.android.lib.common.operations.RemoteOperationResult;
|
||||
import com.owncloud.android.operations.CreateFolderOperation;
|
||||
import com.owncloud.android.operations.RemoveFileOperation;
|
||||
import com.owncloud.android.operations.common.SyncOperation;
|
||||
|
||||
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;
|
||||
import static org.junit.Assert.assertNull;
|
||||
|
@ -32,6 +33,9 @@ public class FileIT extends AbstractIT {
|
|||
|
||||
// folder exists
|
||||
assertTrue(getStorageManager().getFileByPath(path).isFolder());
|
||||
|
||||
// cleanup
|
||||
new RemoveFileOperation(path, false, account, false, context).execute(client, getStorageManager());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -46,5 +50,8 @@ public class FileIT extends AbstractIT {
|
|||
|
||||
// folder exists
|
||||
assertTrue(getStorageManager().getFileByPath(path).isFolder());
|
||||
|
||||
// cleanup
|
||||
new RemoveFileOperation("/testFolder/", false, account, false, context).execute(client, getStorageManager());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue