From ac9771ea3a58c5a423a1341f390c26c8e6ccba3e Mon Sep 17 00:00:00 2001 From: "David A. Velasco" Date: Wed, 27 Jan 2016 10:31:46 +0100 Subject: [PATCH] Migration to different test server --- .travis.yml | 28 +++++++++---------- .../GetRemoteSharesForFileOperation.java | 10 +++---- .../lib/test_project/test/GetShareesTest.java | 16 +++++------ .../test/UpdatePrivateShareTest.java | 15 +++++++--- 4 files changed, 38 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 04831290..2598e3e7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,7 @@ android: - android-19 branches: only: - - master - + - master before_install: - echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI -c 20M @@ -25,21 +24,22 @@ script: - ./gradlew clean build env: global: - - secure: a21NrzTCQnkTKtRGo7B1lyF2WWbpBT2N64V2Tf+oUcRLOUx3XM/mDi60mAdGd0WXV9tHD8GGmu0tQ7LGZ2VsIxixVxjzEYwX4HRTodewYez6WxBMjVEHHy+3jmc1zU4k3AAqr+uW7L4BKa5r9tH+nq9ecJMDMgW8o9MKXuP7Vso= - - secure: UVnaC5Qzat2C8WlMMb8aycz1ChZKjP8Kz89qBbVcqYK+PLAGKpUNxFa39/2oA5jkMyyOcXYC9bX1ZYzHLH7nJ8LbQgaxXMT4gvgvN0l6KezjDavIW60idD9BbugkwzNj/cjoU/DdxBykPsTn4vSRaESVNTdEbM27YU4FBPzTANY= - - secure: XEQY8s7p65lWWOuKbVDdTh6ZJtRTJ74Zw3H/+2Ms6vjZhFZsdUJjGo66LW6YvlhmYDXgiPB9piYQGcrGgT3hXJwXoge6n1pdixnV250J0T0dIZMbXYTWTARxDsyq48+LgUuF3pgqvqDWhBcemrePWv48q7fs/mwzuFSOyc8QwLk= - # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created - # via the "travis encrypt" command using the project repo's public key - - secure: "epTZ0zZGDbHL3o6vSC9uNkZsi5j5SA6O/tvQBH7QW/dluuzIJxIjfhNbZHDyBReYDleirLzUFQpdWAUdvulCMLs/qZdIzFGlYXZSpxEnvPYMGQcilwADdJcxLw8L+3+ET5hSexxhjrTGw427IljkqGUpqQTxaLwFdFu98lDWSbc=" + # The next declaration is the encrypted COVERITY_SCAN_TOKEN, created + # via the "travis encrypt" command using the project repo's public key + - secure: epTZ0zZGDbHL3o6vSC9uNkZsi5j5SA6O/tvQBH7QW/dluuzIJxIjfhNbZHDyBReYDleirLzUFQpdWAUdvulCMLs/qZdIzFGlYXZSpxEnvPYMGQcilwADdJcxLw8L+3+ET5hSexxhjrTGw427IljkqGUpqQTxaLwFdFu98lDWSbc= + # The next 3 declarations are the variables needed to access the test server, + # added via "travis encrypt", using the repo public key + - secure: gPCBnpGLA2sdSMtfhT+/InThmXNEU8XrrS54uuIP8iXBLvVe0yZrNl76GbMosV0ry3YtDngsmsbHwRjPPb0+3mTTdAqZ60HHzGaNPgEm6b5t0t4bpJ3LW9osLZsuf9jRsI2LD66zxblaMrK2+8hN/dUrj707ijsZHp3SPSQJ6g8= + - secure: AnxLVarfwM7IhJ7Sca35USyRlFHFvlcBhWTt2TVDcyQ+ldDyb+U6IWXFK0Yy82QP0ZH/RCLu7FnmHK/rKG0BHNRt1Ymco1VkTQql0MZcHXP+4IKgEvgJyUn1TqYj+hSVmM6lgTA+QUjZYGSfwU8mhUFiU7644ZTdTe6ALdqa+v8= + - secure: ezKyZbb3q1Phcv/vJntuJe0C2req+Hp4/C+tFZIWZ3o8wRO9jVI3bnED9TWQyQOOT0SoRYjJ5zqp0UcEOGCzPeWFO6bA7RWp+zA/R9sziLNcVWMVv3WXnuClQjPBHJeXRnP7YmNjxDmSfV97a14dk5d9LgJZYliTDepH4dLsxro= matrix: - ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a - addons: coverity_scan: project: - name: "owncloud/android-library" - description: "Build submitted via Travis CI" + name: owncloud/android-library + description: Build submitted via Travis CI notification_email: lukas@owncloud.com - build_command_prepend: "gradle clean" - build_command: "gradle build" - branch_pattern: "coverity_scan" + build_command_prepend: gradle clean + build_command: gradle build + branch_pattern: coverity_scan diff --git a/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java b/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java index c2019f7a..6076b40f 100644 --- a/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java +++ b/src/com/owncloud/android/lib/resources/shares/GetRemoteSharesForFileOperation.java @@ -55,12 +55,12 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation { /** * Constructor * - * @param remoteFilePath Path to file or folder - * @param reshares If set to false (default), only shares owned by the current user are + * @param remoteFilePath Path to file or folder + * @param reshares If set to false (default), only shares owned by the current user are * returned. - * If set to true, shares owned by any user from the given file are returned. - * @param subfiles If set to false (default), lists only the folder being shared - * If set to true, all shared files within the folder are returned. + * If set to true, shares owned by any user from the given file are returned. + * @param subfiles If set to false (default), lists only the folder being shared + * If set to true, all shared files within the folder are returned. */ public GetRemoteSharesForFileOperation(String remoteFilePath, boolean reshares, boolean subfiles) { diff --git a/test_client/tests/src/com/owncloud/android/lib/test_project/test/GetShareesTest.java b/test_client/tests/src/com/owncloud/android/lib/test_project/test/GetShareesTest.java index 80bcd107..c80f805c 100644 --- a/test_client/tests/src/com/owncloud/android/lib/test_project/test/GetShareesTest.java +++ b/test_client/tests/src/com/owncloud/android/lib/test_project/test/GetShareesTest.java @@ -127,9 +127,9 @@ public class GetShareesTest extends RemoteTest { JSONObject value; byte type; int userCount = 0, groupCount = 0; - assertTrue(result.isSuccess() && result.getData().size() == 3); + assertTrue(result.isSuccess() && result.getData().size() > 0); try { - for (int i=0; i<3; i++) { + for (int i=0; i 0); + assertTrue(groupCount > 0); } catch (JSONException e) { AssertionFailedError afe = new AssertionFailedError(e.getLocalizedMessage()); afe.setStackTrace(e.getStackTrace()); throw afe; } - - // search for sharees including "ad" + + // search for sharees including "ad" - expecting user "admin" & group "admin" getShareesOperation = new GetRemoteShareesOperation("ad", 1, 50); result = getShareesOperation.execute(mClient); assertTrue(result.isSuccess() && result.getData().size() == 2); @@ -172,8 +172,8 @@ public class GetShareesTest extends RemoteTest { } - // search for sharees including "b" - getShareesOperation = new GetRemoteShareesOperation("b", 1, 50); + // search for sharees including "bd" - expecting 0 results + getShareesOperation = new GetRemoteShareesOperation("bd", 1, 50); result = getShareesOperation.execute(mClient); assertTrue(result.isSuccess() && result.getData().size() == 0); diff --git a/test_client/tests/src/com/owncloud/android/lib/test_project/test/UpdatePrivateShareTest.java b/test_client/tests/src/com/owncloud/android/lib/test_project/test/UpdatePrivateShareTest.java index 60b1d141..d839530b 100644 --- a/test_client/tests/src/com/owncloud/android/lib/test_project/test/UpdatePrivateShareTest.java +++ b/test_client/tests/src/com/owncloud/android/lib/test_project/test/UpdatePrivateShareTest.java @@ -174,7 +174,9 @@ public class UpdatePrivateShareTest extends RemoteTest { if (mFileShare != null) { /// successful tests // Update Share permissions on a shared file - UpdateRemoteShareOperation updateShare = new UpdateRemoteShareOperation(mFileShare.getRemoteId()); + UpdateRemoteShareOperation updateShare = new UpdateRemoteShareOperation( + mFileShare.getRemoteId() + ); updateShare.setPermissions(OCShare.READ_PERMISSION_FLAG); // minimum permissions RemoteOperationResult result = updateShare.execute(mClient); assertTrue(result.isSuccess()); @@ -189,17 +191,22 @@ public class UpdatePrivateShareTest extends RemoteTest { /// unsuccessful tests // Update Share with invalid permissions updateShare = new UpdateRemoteShareOperation(mFileShare.getRemoteId()); - updateShare.setPermissions(OCShare.MAXIMUM_PERMISSIONS_FOR_FOLDER + 1); // greater than maximum value + // greater than maximum value + updateShare.setPermissions(OCShare.MAXIMUM_PERMISSIONS_FOR_FOLDER + 1); result = updateShare.execute(mClient); assertFalse(result.isSuccess()); // Unshare the file before next unsuccessful tests - RemoveRemoteShareOperation unshare = new RemoveRemoteShareOperation((int) mFileShare.getRemoteId()); + RemoveRemoteShareOperation unshare = new RemoveRemoteShareOperation( + (int) mFileShare.getRemoteId() + ); result = unshare.execute(mClient); if (result.isSuccess()) { // Update Share permissions on unknown share - UpdateRemoteShareOperation updateNoShare = new UpdateRemoteShareOperation(mFileShare.getRemoteId()); + UpdateRemoteShareOperation updateNoShare = new UpdateRemoteShareOperation( + mFileShare.getRemoteId() + ); updateShare.setPermissions(OCShare.READ_PERMISSION_FLAG); // minimum permissions result = updateShare.execute(mClient); assertFalse(result.isSuccess());