From e6d3d26972bf55024d59b93a3568405fcc13078b Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 9 Dec 2021 09:53:41 +0100 Subject: [PATCH 1/2] rename all integration tests to *IT changed mtime to have a more sane value Signed-off-by: tobiasKaminsky --- ...ctEditingCreateFileRemoteOperationIT.java} | 12 ++--- ...tainListOfTemplatesRemoteOperationIT.java} | 8 ++-- ...DirectEditingObtainRemoteOperationIT.java} | 12 ++--- ...rectEditingOpenFileRemoteOperationIT.java} | 16 +++---- ...kt => SearchProvidersRemoteOperationIT.kt} | 2 +- ...GenerateAppPasswordRemoteOperationIT.java} | 10 ++-- ...kspaceDirectEditingRemoteOperationIT.java} | 8 ++-- ...est.kt => GetUserInfoRemoteOperationIT.kt} | 2 +- .../java/com/owncloud/android/AbstractIT.java | 7 +-- ...{DeleteFileTest.java => DeleteFileIT.java} | 6 +-- ...reateShareTest.java => CreateShareIT.java} | 10 ++-- .../{GetSharesTest.java => GetSharesIT.java} | 20 ++++---- ...UserQuotaTest.java => GetUserQuotaIT.java} | 6 +-- ...emoveShareTest.java => RemoveShareIT.java} | 6 +-- .../comments/CommentFileRemoteOperationIT.kt | 2 +- ...a => UpdateMetadataRemoteOperationIT.java} | 14 +++--- .../files/CheckEtagRemoteOperationIT.kt | 2 +- .../files/DownloadFileRemoteOperationIT.kt | 2 +- .../files/ExistenceCheckRemoteOperationIT.kt | 2 +- .../files/MoveFileRemoteOperationIT.kt | 6 +-- .../files/ReadFileRemoteOperationIT.kt | 2 +- .../files/ReadFolderRemoteOperationIT.kt | 2 +- .../files/RenameFileRemoteOperationIT.kt | 6 +-- ...Test.java => SearchRemoteOperationIT.java} | 46 ++++++++++--------- ...t.java => GetSharesRemoteOperationIT.java} | 2 +- ...java => SetUserInfoRemoteOperationIT.java} | 8 ++-- 26 files changed, 112 insertions(+), 107 deletions(-) rename src/androidTest/java/com/nextcloud/android/lib/resources/directediting/{DirectEditingCreateFileRemoteOperationTest.java => DirectEditingCreateFileRemoteOperationIT.java} (91%) rename src/androidTest/java/com/nextcloud/android/lib/resources/directediting/{DirectEditingObtainListOfTemplatesRemoteOperationTest.java => DirectEditingObtainListOfTemplatesRemoteOperationIT.java} (96%) rename src/androidTest/java/com/nextcloud/android/lib/resources/directediting/{DirectEditingObtainRemoteOperationTest.java => DirectEditingObtainRemoteOperationIT.java} (96%) rename src/androidTest/java/com/nextcloud/android/lib/resources/directediting/{DirectEditingOpenFileRemoteOperationTest.java => DirectEditingOpenFileRemoteOperationIT.java} (94%) rename src/androidTest/java/com/nextcloud/android/lib/resources/search/{SearchProvidersRemoteOperationTest.kt => SearchProvidersRemoteOperationIT.kt} (97%) rename src/androidTest/java/com/nextcloud/android/lib/resources/users/{GenerateAppPasswordRemoteOperationTest.java => GenerateAppPasswordRemoteOperationIT.java} (97%) rename src/androidTest/java/com/nextcloud/android/lib/richWorkspace/{RichWorkspaceDirectEditingRemoteOperationTest.java => RichWorkspaceDirectEditingRemoteOperationIT.java} (97%) rename src/androidTest/java/com/nextcloud/lib/resources/users/{GetUserInfoRemoteOperationTest.kt => GetUserInfoRemoteOperationIT.kt} (98%) rename src/androidTest/java/com/owncloud/android/{DeleteFileTest.java => DeleteFileIT.java} (98%) rename src/androidTest/java/com/owncloud/android/lib/common/operations/{CreateShareTest.java => CreateShareIT.java} (99%) rename src/androidTest/java/com/owncloud/android/lib/common/operations/{GetSharesTest.java => GetSharesIT.java} (87%) rename src/androidTest/java/com/owncloud/android/lib/common/operations/{GetUserQuotaTest.java => GetUserQuotaIT.java} (97%) rename src/androidTest/java/com/owncloud/android/lib/common/operations/{RemoveShareTest.java => RemoveShareIT.java} (98%) rename src/androidTest/java/com/owncloud/android/lib/resources/e2ee/{UpdateMetadataRemoteOperationTest.java => UpdateMetadataRemoteOperationIT.java} (98%) rename src/androidTest/java/com/owncloud/android/lib/resources/files/{SearchRemoteOperationTest.java => SearchRemoteOperationIT.java} (94%) rename src/androidTest/java/com/owncloud/android/lib/resources/shares/{GetSharesRemoteOperationTest.java => GetSharesRemoteOperationIT.java} (98%) rename src/androidTest/java/com/owncloud/android/lib/resources/users/{SetUserInfoRemoteOperationTest.java => SetUserInfoRemoteOperationIT.java} (99%) diff --git a/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationTest.java b/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationIT.java similarity index 91% rename from src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationTest.java rename to src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationIT.java index 6c52b238f..79a0e9c11 100644 --- a/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationTest.java +++ b/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingCreateFileRemoteOperationIT.java @@ -27,20 +27,20 @@ package com.nextcloud.android.lib.resources.directediting; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import org.junit.Test; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -public class DirectEditingCreateFileRemoteOperationTest extends AbstractIT { +public class DirectEditingCreateFileRemoteOperationIT extends AbstractIT { @Test public void createEmptyFile() { RemoteOperationResult result = new DirectEditingCreateFileRemoteOperation("/test.md", - "text", - "textdocument") + "text", + "textdocument") .execute(client); assertTrue(result.isSuccess()); diff --git a/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationTest.java b/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationIT.java similarity index 96% rename from src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationTest.java rename to src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationIT.java index bc2bba86a..f1c1d877e 100644 --- a/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationTest.java +++ b/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainListOfTemplatesRemoteOperationIT.java @@ -27,16 +27,16 @@ package com.nextcloud.android.lib.resources.directediting; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.TemplateList; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class DirectEditingObtainListOfTemplatesRemoteOperationTest extends AbstractIT { +public class DirectEditingObtainListOfTemplatesRemoteOperationIT extends AbstractIT { @Test public void testGetAll() { diff --git a/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationTest.java b/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationIT.java similarity index 96% rename from src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationTest.java rename to src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationIT.java index 569878bc9..521ea2cef 100644 --- a/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationTest.java +++ b/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingObtainRemoteOperationIT.java @@ -23,6 +23,11 @@ package com.nextcloud.android.lib.resources.directediting; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.Creator; import com.owncloud.android.lib.common.DirectEditing; @@ -31,12 +36,7 @@ import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -public class DirectEditingObtainRemoteOperationTest extends AbstractIT { +public class DirectEditingObtainRemoteOperationIT extends AbstractIT { @Test public void testGetAll() { diff --git a/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationTest.java b/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationIT.java similarity index 94% rename from src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationTest.java rename to src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationIT.java index a12fa6144..0f3505100 100644 --- a/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationTest.java +++ b/src/androidTest/java/com/nextcloud/android/lib/resources/directediting/DirectEditingOpenFileRemoteOperationIT.java @@ -27,6 +27,9 @@ package com.nextcloud.android.lib.resources.directediting; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.resources.files.ReadFileRemoteOperation; @@ -38,17 +41,14 @@ import java.io.IOException; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -public class DirectEditingOpenFileRemoteOperationTest extends AbstractIT { +public class DirectEditingOpenFileRemoteOperationIT extends AbstractIT { @Test public void openFile() throws IOException { // create file String filePath = createFile("text"); String remotePath = "/text.md"; - TestCase.assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "text/markdown", "123") - .execute(client).isSuccess()); + TestCase.assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "text/markdown", "1464818400") + .execute(client).isSuccess()); TestCase.assertTrue(new ReadFileRemoteOperation(remotePath).execute(client).isSuccess()); @@ -66,7 +66,7 @@ public void openFileWithSpecialChars() throws IOException { // create file String filePath = createFile("text"); String remotePath = "/äää.md"; - TestCase.assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "text/markdown", "123") + TestCase.assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "text/markdown", "1464818400") .execute(client).isSuccess()); TestCase.assertTrue(new ReadFileRemoteOperation(remotePath).execute(client).isSuccess()); @@ -85,7 +85,7 @@ public void openFileWithSpecialChars2() throws IOException { // create file String filePath = createFile("text"); String remotePath = "/あ.md"; - TestCase.assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "text/markdown", "123") + TestCase.assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "text/markdown", "1464818400") .execute(client).isSuccess()); TestCase.assertTrue(new ReadFileRemoteOperation(remotePath).execute(client).isSuccess()); diff --git a/src/androidTest/java/com/nextcloud/android/lib/resources/search/SearchProvidersRemoteOperationTest.kt b/src/androidTest/java/com/nextcloud/android/lib/resources/search/SearchProvidersRemoteOperationIT.kt similarity index 97% rename from src/androidTest/java/com/nextcloud/android/lib/resources/search/SearchProvidersRemoteOperationTest.kt rename to src/androidTest/java/com/nextcloud/android/lib/resources/search/SearchProvidersRemoteOperationIT.kt index a402c3952..f82c23005 100644 --- a/src/androidTest/java/com/nextcloud/android/lib/resources/search/SearchProvidersRemoteOperationTest.kt +++ b/src/androidTest/java/com/nextcloud/android/lib/resources/search/SearchProvidersRemoteOperationIT.kt @@ -32,7 +32,7 @@ import org.junit.Assert.assertTrue import org.junit.Assume.assumeTrue import org.junit.Test -class SearchProvidersRemoteOperationTest : AbstractIT() { +class SearchProvidersRemoteOperationIT : AbstractIT() { @Test fun getSearchProviders() { // only on NC20+ diff --git a/src/androidTest/java/com/nextcloud/android/lib/resources/users/GenerateAppPasswordRemoteOperationTest.java b/src/androidTest/java/com/nextcloud/android/lib/resources/users/GenerateAppPasswordRemoteOperationIT.java similarity index 97% rename from src/androidTest/java/com/nextcloud/android/lib/resources/users/GenerateAppPasswordRemoteOperationTest.java rename to src/androidTest/java/com/nextcloud/android/lib/resources/users/GenerateAppPasswordRemoteOperationIT.java index 728ec52c7..9712052c6 100644 --- a/src/androidTest/java/com/nextcloud/android/lib/resources/users/GenerateAppPasswordRemoteOperationTest.java +++ b/src/androidTest/java/com/nextcloud/android/lib/resources/users/GenerateAppPasswordRemoteOperationIT.java @@ -27,6 +27,10 @@ package com.nextcloud.android.lib.resources.users; +import static junit.framework.TestCase.assertFalse; +import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertNotEquals; + import android.text.TextUtils; import com.owncloud.android.AbstractIT; @@ -37,11 +41,7 @@ import org.junit.Test; -import static junit.framework.TestCase.assertFalse; -import static junit.framework.TestCase.assertTrue; -import static org.junit.Assert.assertNotEquals; - -public class GenerateAppPasswordRemoteOperationTest extends AbstractIT { +public class GenerateAppPasswordRemoteOperationIT extends AbstractIT { @Test public void generateAppPassword() { diff --git a/src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationTest.java b/src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationIT.java similarity index 97% rename from src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationTest.java rename to src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationIT.java index 3650ab6c7..59ff84f17 100644 --- a/src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationTest.java +++ b/src/androidTest/java/com/nextcloud/android/lib/richWorkspace/RichWorkspaceDirectEditingRemoteOperationIT.java @@ -21,6 +21,9 @@ package com.nextcloud.android.lib.richWorkspace; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + import android.webkit.URLUtil; import com.owncloud.android.AbstractIT; @@ -33,10 +36,7 @@ import java.io.File; import java.io.IOException; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; - -public class RichWorkspaceDirectEditingRemoteOperationTest extends AbstractIT { +public class RichWorkspaceDirectEditingRemoteOperationIT extends AbstractIT { @Test public void getEditLinkForRoot() { diff --git a/src/androidTest/java/com/nextcloud/lib/resources/users/GetUserInfoRemoteOperationTest.kt b/src/androidTest/java/com/nextcloud/lib/resources/users/GetUserInfoRemoteOperationIT.kt similarity index 98% rename from src/androidTest/java/com/nextcloud/lib/resources/users/GetUserInfoRemoteOperationTest.kt rename to src/androidTest/java/com/nextcloud/lib/resources/users/GetUserInfoRemoteOperationIT.kt index 8cf877042..82b8151f4 100644 --- a/src/androidTest/java/com/nextcloud/lib/resources/users/GetUserInfoRemoteOperationTest.kt +++ b/src/androidTest/java/com/nextcloud/lib/resources/users/GetUserInfoRemoteOperationIT.kt @@ -36,7 +36,7 @@ import org.junit.Assert.assertEquals import org.junit.Assert.assertTrue import org.junit.Test -class GetUserInfoRemoteOperationTest : AbstractIT() { +class GetUserInfoRemoteOperationIT : AbstractIT() { @Test fun testGetUserNoQuota() { nextcloudClient.credentials = Credentials.basic("user1", "user1") diff --git a/src/androidTest/java/com/owncloud/android/AbstractIT.java b/src/androidTest/java/com/owncloud/android/AbstractIT.java index 87c09ec4b..a54460854 100644 --- a/src/androidTest/java/com/owncloud/android/AbstractIT.java +++ b/src/androidTest/java/com/owncloud/android/AbstractIT.java @@ -26,6 +26,8 @@ */ package com.owncloud.android; +import static junit.framework.TestCase.assertTrue; + import android.content.Context; import android.net.Uri; import android.os.Bundle; @@ -66,8 +68,6 @@ import okhttp3.Credentials; -import static junit.framework.TestCase.assertTrue; - /** * Common base for all integration tests */ @@ -75,8 +75,9 @@ public abstract class AbstractIT { @Rule public RetryTestRule retryTestRule = new RetryTestRule(); - + private static final int BUFFER_SIZE = 1024; + public static final String RANDOM_MTIME = "1464818400"; public static OwnCloudClient client; protected static NextcloudClient nextcloudClient; diff --git a/src/androidTest/java/com/owncloud/android/DeleteFileTest.java b/src/androidTest/java/com/owncloud/android/DeleteFileIT.java similarity index 98% rename from src/androidTest/java/com/owncloud/android/DeleteFileTest.java rename to src/androidTest/java/com/owncloud/android/DeleteFileIT.java index b6cf4f088..6984228ba 100644 --- a/src/androidTest/java/com/owncloud/android/DeleteFileTest.java +++ b/src/androidTest/java/com/owncloud/android/DeleteFileIT.java @@ -26,6 +26,8 @@ */ package com.owncloud.android; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.lib.common.operations.RemoteOperationResult; import com.owncloud.android.lib.resources.files.CreateFolderRemoteOperation; import com.owncloud.android.lib.resources.files.RemoveFileRemoteOperation; @@ -37,13 +39,11 @@ import java.io.File; -import static org.junit.Assert.assertTrue; - /** * Class to test Delete a File Operation */ -public class DeleteFileTest extends AbstractIT { +public class DeleteFileIT extends AbstractIT { /* Folder data to delete. */ private static final String FOLDER_PATH = "/folderToDelete"; diff --git a/src/androidTest/java/com/owncloud/android/lib/common/operations/CreateShareTest.java b/src/androidTest/java/com/owncloud/android/lib/common/operations/CreateShareIT.java similarity index 99% rename from src/androidTest/java/com/owncloud/android/lib/common/operations/CreateShareTest.java rename to src/androidTest/java/com/owncloud/android/lib/common/operations/CreateShareIT.java index 721bfa5a4..001ffa47a 100644 --- a/src/androidTest/java/com/owncloud/android/lib/common/operations/CreateShareTest.java +++ b/src/androidTest/java/com/owncloud/android/lib/common/operations/CreateShareIT.java @@ -26,6 +26,10 @@ */ package com.owncloud.android.lib.common.operations; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode; import com.owncloud.android.lib.resources.files.UploadFileRemoteOperation; @@ -37,14 +41,10 @@ import java.io.File; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - /** * Test create share */ -public class CreateShareTest extends AbstractIT { +public class CreateShareIT extends AbstractIT { private static final String NON_EXISTENT_FILE = "/nonExistentFile.txt"; private static final String serverUri2 = "server2"; diff --git a/src/androidTest/java/com/owncloud/android/lib/common/operations/GetSharesTest.java b/src/androidTest/java/com/owncloud/android/lib/common/operations/GetSharesIT.java similarity index 87% rename from src/androidTest/java/com/owncloud/android/lib/common/operations/GetSharesTest.java rename to src/androidTest/java/com/owncloud/android/lib/common/operations/GetSharesIT.java index 0081615ca..190dd0f0c 100644 --- a/src/androidTest/java/com/owncloud/android/lib/common/operations/GetSharesTest.java +++ b/src/androidTest/java/com/owncloud/android/lib/common/operations/GetSharesIT.java @@ -26,6 +26,9 @@ */ package com.owncloud.android.lib.common.operations; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.resources.files.CreateFolderRemoteOperation; import com.owncloud.android.lib.resources.shares.CreateShareRemoteOperation; @@ -37,25 +40,22 @@ import java.util.List; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - /** * Class to test Get Shares Operation * * @author masensio */ -public class GetSharesTest extends AbstractIT { - @Test +public class GetSharesIT extends AbstractIT { + @Test public void testGetShares() { assertTrue(new CreateFolderRemoteOperation("/1/", true).execute(client).isSuccess()); assertTrue(new CreateShareRemoteOperation("/1/", - ShareType.PUBLIC_LINK, - "", - false, - "", - 1).execute(client).isSuccess()); + ShareType.PUBLIC_LINK, + "", + false, + "", + 1).execute(client).isSuccess()); assertTrue(new CreateFolderRemoteOperation("/2/", true).execute(client).isSuccess()); assertTrue(new CreateShareRemoteOperation("/2/", diff --git a/src/androidTest/java/com/owncloud/android/lib/common/operations/GetUserQuotaTest.java b/src/androidTest/java/com/owncloud/android/lib/common/operations/GetUserQuotaIT.java similarity index 97% rename from src/androidTest/java/com/owncloud/android/lib/common/operations/GetUserQuotaTest.java rename to src/androidTest/java/com/owncloud/android/lib/common/operations/GetUserQuotaIT.java index bb308ef47..3f698544a 100644 --- a/src/androidTest/java/com/owncloud/android/lib/common/operations/GetUserQuotaTest.java +++ b/src/androidTest/java/com/owncloud/android/lib/common/operations/GetUserQuotaIT.java @@ -26,6 +26,8 @@ */ package com.owncloud.android.lib.common.operations; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.Quota; import com.owncloud.android.lib.common.UserInfo; @@ -33,15 +35,13 @@ import org.junit.Test; -import static org.junit.Assert.assertTrue; - /** * Class to test Get User Quota * * @author Bartosz Przybylski */ -public class GetUserQuotaTest extends AbstractIT { +public class GetUserQuotaIT extends AbstractIT { @Test public void testGetUserQuota() { diff --git a/src/androidTest/java/com/owncloud/android/lib/common/operations/RemoveShareTest.java b/src/androidTest/java/com/owncloud/android/lib/common/operations/RemoveShareIT.java similarity index 98% rename from src/androidTest/java/com/owncloud/android/lib/common/operations/RemoveShareTest.java rename to src/androidTest/java/com/owncloud/android/lib/common/operations/RemoveShareIT.java index ba44f5e52..47edd3493 100644 --- a/src/androidTest/java/com/owncloud/android/lib/common/operations/RemoveShareTest.java +++ b/src/androidTest/java/com/owncloud/android/lib/common/operations/RemoveShareIT.java @@ -26,6 +26,8 @@ */ package com.owncloud.android.lib.common.operations; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.resources.files.UploadFileRemoteOperation; import com.owncloud.android.lib.resources.shares.CreateShareRemoteOperation; @@ -39,9 +41,7 @@ import java.io.IOException; import java.util.List; -import static org.junit.Assert.assertTrue; - -public class RemoveShareTest extends AbstractIT { +public class RemoveShareIT extends AbstractIT { private static final String FILE_TO_UNSHARE = "/fileToUnshare.txt"; /** diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/comments/CommentFileRemoteOperationIT.kt b/src/androidTest/java/com/owncloud/android/lib/resources/comments/CommentFileRemoteOperationIT.kt index 6bc083722..25cf5dd22 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/comments/CommentFileRemoteOperationIT.kt +++ b/src/androidTest/java/com/owncloud/android/lib/resources/comments/CommentFileRemoteOperationIT.kt @@ -39,7 +39,7 @@ class CommentFileRemoteOperationIT : AbstractIT() { val filePath: String = createFile("commentFile") val remotePath = "/commentFile.txt" assertTrue( - UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, remotePath, "image/jpg", RANDOM_MTIME) .execute(client).isSuccess ) diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationTest.java b/src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationIT.java similarity index 98% rename from src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationTest.java rename to src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationIT.java index dd7d50641..0db601aa0 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationTest.java +++ b/src/androidTest/java/com/owncloud/android/lib/resources/e2ee/UpdateMetadataRemoteOperationIT.java @@ -22,6 +22,12 @@ package com.owncloud.android.lib.resources.e2ee; +import static junit.framework.TestCase.assertEquals; +import static junit.framework.TestCase.assertNotNull; +import static junit.framework.TestCase.assertTrue; +import static org.junit.Assert.assertFalse; +import static org.junit.Assume.assumeTrue; + import android.text.TextUtils; import com.owncloud.android.AbstractIT; @@ -37,13 +43,7 @@ import org.junit.Test; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.assertNotNull; -import static junit.framework.TestCase.assertTrue; -import static org.junit.Assert.assertFalse; -import static org.junit.Assume.assumeTrue; - -public class UpdateMetadataRemoteOperationTest extends AbstractIT { +public class UpdateMetadataRemoteOperationIT extends AbstractIT { @Test public void uploadAndModify() { // tests only for NC19+ diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/files/CheckEtagRemoteOperationIT.kt b/src/androidTest/java/com/owncloud/android/lib/resources/files/CheckEtagRemoteOperationIT.kt index eca9f70fc..3f4c6f04e 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/files/CheckEtagRemoteOperationIT.kt +++ b/src/androidTest/java/com/owncloud/android/lib/resources/files/CheckEtagRemoteOperationIT.kt @@ -39,7 +39,7 @@ class CheckEtagRemoteOperationIT : AbstractIT() { val filePath = createFile("eTagFile") val remotePath = "/eTagFile.txt" assertTrue( - UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "1464818400") .execute(client).isSuccess ) diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/files/DownloadFileRemoteOperationIT.kt b/src/androidTest/java/com/owncloud/android/lib/resources/files/DownloadFileRemoteOperationIT.kt index 7b961c993..9b90cf7e6 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/files/DownloadFileRemoteOperationIT.kt +++ b/src/androidTest/java/com/owncloud/android/lib/resources/files/DownloadFileRemoteOperationIT.kt @@ -38,7 +38,7 @@ class DownloadFileRemoteOperationIT : AbstractIT() { val filePath = createFile("download") val remotePath = "/download.jpg" assertTrue( - UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "1464818400") .execute(client).isSuccess ) diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/files/ExistenceCheckRemoteOperationIT.kt b/src/androidTest/java/com/owncloud/android/lib/resources/files/ExistenceCheckRemoteOperationIT.kt index 67c6ed005..fe0c5a40a 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/files/ExistenceCheckRemoteOperationIT.kt +++ b/src/androidTest/java/com/owncloud/android/lib/resources/files/ExistenceCheckRemoteOperationIT.kt @@ -38,7 +38,7 @@ class ExistenceCheckRemoteOperationIT : AbstractIT() { val remotePath = "/existenceCheckFile.jpg" val notExistingRemotePath = "/notExistingCheckFile.jpg" assertTrue( - UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, remotePath, "image/jpg", RANDOM_MTIME) .execute(client).isSuccess ) diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/files/MoveFileRemoteOperationIT.kt b/src/androidTest/java/com/owncloud/android/lib/resources/files/MoveFileRemoteOperationIT.kt index 22169acd3..18daa041e 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/files/MoveFileRemoteOperationIT.kt +++ b/src/androidTest/java/com/owncloud/android/lib/resources/files/MoveFileRemoteOperationIT.kt @@ -40,7 +40,7 @@ class MoveFileRemoteOperationIT : AbstractIT() { val oldRemotePath = "/move1.jpg" val newRemotePath = "/move2.png" assertTrue( - UploadFileRemoteOperation(filePath, oldRemotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, oldRemotePath, "image/jpg", RANDOM_MTIME) .execute(client) .isSuccess ) @@ -69,13 +69,13 @@ class MoveFileRemoteOperationIT : AbstractIT() { val firstRemotePath = "/overwrite1.jpg" val secondRemotePath = "/overwrite2.png" assertTrue( - UploadFileRemoteOperation(filePath, firstRemotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, firstRemotePath, "image/jpg", RANDOM_MTIME) .execute(client) .isSuccess ) assertTrue( - UploadFileRemoteOperation(filePath, secondRemotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, secondRemotePath, "image/jpg", RANDOM_MTIME) .execute(client) .isSuccess ) diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFileRemoteOperationIT.kt b/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFileRemoteOperationIT.kt index dfafe0634..1f0ffb5f6 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFileRemoteOperationIT.kt +++ b/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFileRemoteOperationIT.kt @@ -45,7 +45,7 @@ class ReadFileRemoteOperationIT : AbstractIT() { val filePath = createFile("text") val remotePath = "/test.md" assertTrue( - UploadFileRemoteOperation(filePath, remotePath, "text/markdown", "123") + UploadFileRemoteOperation(filePath, remotePath, "text/markdown", RANDOM_MTIME) .execute(client).isSuccess ) diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFolderRemoteOperationIT.kt b/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFolderRemoteOperationIT.kt index fba1af8c2..4084758e7 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFolderRemoteOperationIT.kt +++ b/src/androidTest/java/com/owncloud/android/lib/resources/files/ReadFolderRemoteOperationIT.kt @@ -37,7 +37,7 @@ class ReadFolderRemoteOperationIT : AbstractIT() { // create file val filePath = createFile("text") assertTrue( - UploadFileRemoteOperation(filePath, remotePath + "1.txt", "text/markdown", "123") + UploadFileRemoteOperation(filePath, remotePath + "1.txt", "text/markdown", RANDOM_MTIME) .execute(client).isSuccess ) diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/files/RenameFileRemoteOperationIT.kt b/src/androidTest/java/com/owncloud/android/lib/resources/files/RenameFileRemoteOperationIT.kt index 0bf095927..d829933bc 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/files/RenameFileRemoteOperationIT.kt +++ b/src/androidTest/java/com/owncloud/android/lib/resources/files/RenameFileRemoteOperationIT.kt @@ -40,7 +40,7 @@ class RenameFileRemoteOperationIT : AbstractIT() { val oldRemotePath = "/file1.jpg" val newRemotePath = "/file2.png" assertTrue( - UploadFileRemoteOperation(filePath, oldRemotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, oldRemotePath, "image/jpg", RANDOM_MTIME) .execute(client) .isSuccess ) @@ -61,13 +61,13 @@ class RenameFileRemoteOperationIT : AbstractIT() { val firstRemotePath = "/file1.jpg" val secondRemotePath = "/file2.png" assertTrue( - UploadFileRemoteOperation(filePath, firstRemotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, firstRemotePath, "image/jpg", RANDOM_MTIME) .execute(client) .isSuccess ) assertTrue( - UploadFileRemoteOperation(filePath, secondRemotePath, "image/jpg", "123") + UploadFileRemoteOperation(filePath, secondRemotePath, "image/jpg", RANDOM_MTIME) .execute(client) .isSuccess ) diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationTest.java b/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java similarity index 94% rename from src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationTest.java rename to src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java index d48eb52ec..d4072bbc6 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationTest.java +++ b/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java @@ -26,6 +26,9 @@ */ package com.owncloud.android.lib.resources.files; +import static junit.framework.TestCase.assertEquals; +import static junit.framework.TestCase.assertTrue; + import android.net.Uri; import android.os.Bundle; @@ -43,15 +46,12 @@ import java.io.IOException; import java.util.List; -import static junit.framework.TestCase.assertEquals; -import static junit.framework.TestCase.assertTrue; - -public class SearchRemoteOperationTest extends AbstractIT { +public class SearchRemoteOperationIT extends AbstractIT { @Test public void testSearchByFileIdEmpty() { SearchRemoteOperation sut = new SearchRemoteOperation("123123", - SearchRemoteOperation.SearchType.FILE_ID_SEARCH, - false); + SearchRemoteOperation.SearchType.FILE_ID_SEARCH, + false); RemoteOperationResult> result = sut.execute(client); assertTrue(result.isSuccess()); @@ -81,8 +81,8 @@ public void testFileSearchEmpty() throws IOException { for (int i = 0; i < 10; i++) { String filePath = createFile("image" + i); String remotePath = "/image" + i + ".jpg"; - assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "123") - .execute(client).isSuccess()); + assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", RANDOM_MTIME) + .execute(client).isSuccess()); } SearchRemoteOperation sut = new SearchRemoteOperation("123123", @@ -99,8 +99,8 @@ public void testFileSearchEverything() throws IOException { for (int i = 0; i < 10; i++) { String filePath = createFile("image" + i); String remotePath = "/image" + i + ".jpg"; - assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "123") - .execute(client).isSuccess()); + assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", RANDOM_MTIME) + .execute(client).isSuccess()); } SearchRemoteOperation sut = new SearchRemoteOperation("", SearchRemoteOperation.SearchType.FILE_SEARCH, false); @@ -115,7 +115,7 @@ public void testFileSearchSuccess() throws IOException { for (int i = 0; i < 10; i++) { String filePath = createFile("image" + i); String remotePath = "/image" + i + ".jpg"; - assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "123") + assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", RANDOM_MTIME) .execute(client).isSuccess()); } @@ -207,12 +207,12 @@ public void testPhotoSearchNoFiles() { @Test public void testPhotoSearch() throws IOException { String imagePath = createFile("image"); - assertTrue(new UploadFileRemoteOperation(imagePath, "/image.jpg", "image/jpg", "123") - .execute(client).isSuccess()); + assertTrue(new UploadFileRemoteOperation(imagePath, "/image.jpg", "image/jpg", RANDOM_MTIME) + .execute(client).isSuccess()); String filePath = createFile("pdf"); - assertTrue(new UploadFileRemoteOperation(filePath, "/pdf.pdf", "application/pdf", "123") - .execute(client).isSuccess()); + assertTrue(new UploadFileRemoteOperation(filePath, "/pdf.pdf", "application/pdf", RANDOM_MTIME) + .execute(client).isSuccess()); SearchRemoteOperation sut = new SearchRemoteOperation("image/%", SearchRemoteOperation.SearchType.PHOTO_SEARCH, false); @@ -256,7 +256,11 @@ public void testPhotoSearchTimestamps() throws IOException { for (int i = 0; i < 10; i++) { String filePath = createFile("image" + i); String remotePath = "/image" + i + ".jpg"; - assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", String.valueOf(i)) + assertTrue(new UploadFileRemoteOperation( + filePath, + remotePath, + "image/jpg", + String.valueOf(1464818400 + i)) .execute(client).isSuccess()); } @@ -311,15 +315,15 @@ public void testGallerySearch() throws IOException { for (int i = 0; i < 10; i++) { String filePath = createFile("image" + i); String remotePath = "/image" + i + ".jpg"; - assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "123") + assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", RANDOM_MTIME) .execute(client).isSuccess()); } String videoPath = createFile("video"); - assertTrue(new UploadFileRemoteOperation(videoPath, "/video.mp4", "video/mpeg", "123") + assertTrue(new UploadFileRemoteOperation(videoPath, "/video.mp4", "video/mpeg", RANDOM_MTIME) .execute(client).isSuccess()); String filePath = createFile("pdf"); - assertTrue(new UploadFileRemoteOperation(filePath, "/pdf.pdf", "application/pdf", "123") + assertTrue(new UploadFileRemoteOperation(filePath, "/pdf.pdf", "application/pdf", RANDOM_MTIME) .execute(client).isSuccess()); SearchRemoteOperation sut = new SearchRemoteOperation("image/%", @@ -336,8 +340,8 @@ public void showOnlyFolders() throws IOException { for (int i = 0; i < 10; i++) { String filePath = createFile("image" + i); String remotePath = "/image" + i + ".jpg"; - assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", "123") - .execute(client).isSuccess()); + assertTrue(new UploadFileRemoteOperation(filePath, remotePath, "image/jpg", RANDOM_MTIME) + .execute(client).isSuccess()); } SearchRemoteOperation sut = new SearchRemoteOperation("", SearchRemoteOperation.SearchType.FILE_SEARCH, diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationTest.java b/src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationIT.java similarity index 98% rename from src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationTest.java rename to src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationIT.java index a342b02cf..0e35f4082 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationTest.java +++ b/src/androidTest/java/com/owncloud/android/lib/resources/shares/GetSharesRemoteOperationIT.java @@ -38,7 +38,7 @@ import static junit.framework.TestCase.assertEquals; import static org.junit.Assert.assertTrue; -public class GetSharesRemoteOperationTest extends AbstractIT { +public class GetSharesRemoteOperationIT extends AbstractIT { @Test public void searchSharedFiles() { assertTrue(new CreateFolderRemoteOperation("/shareToAdmin/", true).execute(client).isSuccess()); diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/users/SetUserInfoRemoteOperationTest.java b/src/androidTest/java/com/owncloud/android/lib/resources/users/SetUserInfoRemoteOperationIT.java similarity index 99% rename from src/androidTest/java/com/owncloud/android/lib/resources/users/SetUserInfoRemoteOperationTest.java rename to src/androidTest/java/com/owncloud/android/lib/resources/users/SetUserInfoRemoteOperationIT.java index c2c88404e..54ed5136f 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/users/SetUserInfoRemoteOperationTest.java +++ b/src/androidTest/java/com/owncloud/android/lib/resources/users/SetUserInfoRemoteOperationIT.java @@ -27,6 +27,9 @@ package com.owncloud.android.lib.resources.users; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + import com.owncloud.android.AbstractIT; import com.owncloud.android.lib.common.UserInfo; import com.owncloud.android.lib.common.operations.RemoteOperationResult; @@ -36,10 +39,7 @@ import org.junit.Test; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - -public class SetUserInfoRemoteOperationTest extends AbstractIT { +public class SetUserInfoRemoteOperationIT extends AbstractIT { @Test public void testSetEmail() { RemoteOperationResult userInfo = new GetUserInfoRemoteOperation().execute(nextcloudClient); From ff6ab370d457010eb05a97a301d77f66417b23b8 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Thu, 9 Dec 2021 09:53:41 +0100 Subject: [PATCH 2/2] rename all integration tests to *IT changed mtime to have a more sane value Signed-off-by: tobiasKaminsky --- .../android/lib/resources/files/SearchRemoteOperationIT.java | 4 ++-- .../java/com/owncloud/android/lib/resources/users/Status.kt | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java b/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java index d4072bbc6..699ad3135 100644 --- a/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java +++ b/src/androidTest/java/com/owncloud/android/lib/resources/files/SearchRemoteOperationIT.java @@ -178,7 +178,7 @@ public void testRecentlyModifiedSearch() throws IOException { .execute(client).isSuccess()); String oldPath = createFile("pdf"); - assertTrue(new UploadFileRemoteOperation(oldPath, "/old.pdf", "application/pdf", "1") + assertTrue(new UploadFileRemoteOperation(oldPath, "/old.pdf", "application/pdf", RANDOM_MTIME) .execute(client).isSuccess()); SearchRemoteOperation sut = new SearchRemoteOperation("", @@ -273,7 +273,7 @@ public void testPhotoSearchTimestamps() throws IOException { assertEquals(10, result.getResultData().size()); // limit to timestamp 5 - sut.setTimestamp(5); + sut.setTimestamp(1464818405); result = sut.execute(client); assertTrue(result.isSuccess()); diff --git a/src/main/java/com/owncloud/android/lib/resources/users/Status.kt b/src/main/java/com/owncloud/android/lib/resources/users/Status.kt index 40b1ad891..7d07744d6 100644 --- a/src/main/java/com/owncloud/android/lib/resources/users/Status.kt +++ b/src/main/java/com/owncloud/android/lib/resources/users/Status.kt @@ -32,8 +32,7 @@ class Status(val status: StatusType, val message: String?, val icon: String, val parcel.readString(), parcel.readString().orEmpty(), parcel.readLong() - ) { - } + ) override fun writeToParcel(parcel: Parcel, flags: Int) { parcel.writeString(status.name)