- remove files after test

- use new AndroidJunit4

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-02-27 11:43:47 +01:00
parent 5b64410074
commit b584ab79d2
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
2 changed files with 22 additions and 2 deletions

View file

@ -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());
}
}

View file

@ -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());
}
}