mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-08 00:16:09 +00:00
Migration to different test server
This commit is contained in:
parent
b3535a3678
commit
ac9771ea3a
28
.travis.yml
28
.travis.yml
@ -6,8 +6,7 @@ android:
|
|||||||
- android-19
|
- android-19
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
|
- echo no | android create avd --force -n test -t $ANDROID_TARGET --abi $ANDROID_ABI
|
||||||
-c 20M
|
-c 20M
|
||||||
@ -25,21 +24,22 @@ script:
|
|||||||
- ./gradlew clean build
|
- ./gradlew clean build
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- secure: a21NrzTCQnkTKtRGo7B1lyF2WWbpBT2N64V2Tf+oUcRLOUx3XM/mDi60mAdGd0WXV9tHD8GGmu0tQ7LGZ2VsIxixVxjzEYwX4HRTodewYez6WxBMjVEHHy+3jmc1zU4k3AAqr+uW7L4BKa5r9tH+nq9ecJMDMgW8o9MKXuP7Vso=
|
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
||||||
- secure: UVnaC5Qzat2C8WlMMb8aycz1ChZKjP8Kz89qBbVcqYK+PLAGKpUNxFa39/2oA5jkMyyOcXYC9bX1ZYzHLH7nJ8LbQgaxXMT4gvgvN0l6KezjDavIW60idD9BbugkwzNj/cjoU/DdxBykPsTn4vSRaESVNTdEbM27YU4FBPzTANY=
|
# via the "travis encrypt" command using the project repo's public key
|
||||||
- secure: XEQY8s7p65lWWOuKbVDdTh6ZJtRTJ74Zw3H/+2Ms6vjZhFZsdUJjGo66LW6YvlhmYDXgiPB9piYQGcrGgT3hXJwXoge6n1pdixnV250J0T0dIZMbXYTWTARxDsyq48+LgUuF3pgqvqDWhBcemrePWv48q7fs/mwzuFSOyc8QwLk=
|
- secure: epTZ0zZGDbHL3o6vSC9uNkZsi5j5SA6O/tvQBH7QW/dluuzIJxIjfhNbZHDyBReYDleirLzUFQpdWAUdvulCMLs/qZdIzFGlYXZSpxEnvPYMGQcilwADdJcxLw8L+3+ET5hSexxhjrTGw427IljkqGUpqQTxaLwFdFu98lDWSbc=
|
||||||
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
|
# The next 3 declarations are the variables needed to access the test server,
|
||||||
# via the "travis encrypt" command using the project repo's public key
|
# added via "travis encrypt", using the repo public key
|
||||||
- secure: "epTZ0zZGDbHL3o6vSC9uNkZsi5j5SA6O/tvQBH7QW/dluuzIJxIjfhNbZHDyBReYDleirLzUFQpdWAUdvulCMLs/qZdIzFGlYXZSpxEnvPYMGQcilwADdJcxLw8L+3+ET5hSexxhjrTGw427IljkqGUpqQTxaLwFdFu98lDWSbc="
|
- 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:
|
matrix:
|
||||||
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
|
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
coverity_scan:
|
coverity_scan:
|
||||||
project:
|
project:
|
||||||
name: "owncloud/android-library"
|
name: owncloud/android-library
|
||||||
description: "Build submitted via Travis CI"
|
description: Build submitted via Travis CI
|
||||||
notification_email: lukas@owncloud.com
|
notification_email: lukas@owncloud.com
|
||||||
build_command_prepend: "gradle clean"
|
build_command_prepend: gradle clean
|
||||||
build_command: "gradle build"
|
build_command: gradle build
|
||||||
branch_pattern: "coverity_scan"
|
branch_pattern: coverity_scan
|
||||||
|
@ -55,12 +55,12 @@ public class GetRemoteSharesForFileOperation extends RemoteOperation {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
* @param remoteFilePath Path to file or folder
|
* @param remoteFilePath Path to file or folder
|
||||||
* @param reshares If set to false (default), only shares owned by the current user are
|
* @param reshares If set to false (default), only shares owned by the current user are
|
||||||
* returned.
|
* returned.
|
||||||
* If set to true, shares owned by any user from the given file 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
|
* @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, all shared files within the folder are returned.
|
||||||
*/
|
*/
|
||||||
public GetRemoteSharesForFileOperation(String remoteFilePath, boolean reshares,
|
public GetRemoteSharesForFileOperation(String remoteFilePath, boolean reshares,
|
||||||
boolean subfiles) {
|
boolean subfiles) {
|
||||||
|
@ -127,9 +127,9 @@ public class GetShareesTest extends RemoteTest {
|
|||||||
JSONObject value;
|
JSONObject value;
|
||||||
byte type;
|
byte type;
|
||||||
int userCount = 0, groupCount = 0;
|
int userCount = 0, groupCount = 0;
|
||||||
assertTrue(result.isSuccess() && result.getData().size() == 3);
|
assertTrue(result.isSuccess() && result.getData().size() > 0);
|
||||||
try {
|
try {
|
||||||
for (int i=0; i<3; i++) {
|
for (int i=0; i<result.getData().size(); i++) {
|
||||||
resultItem = (JSONObject) result.getData().get(i);
|
resultItem = (JSONObject) result.getData().get(i);
|
||||||
value = resultItem.getJSONObject(GetRemoteShareesOperation.NODE_VALUE);
|
value = resultItem.getJSONObject(GetRemoteShareesOperation.NODE_VALUE);
|
||||||
type = (byte) value.getInt(GetRemoteShareesOperation.PROPERTY_SHARE_TYPE);
|
type = (byte) value.getInt(GetRemoteShareesOperation.PROPERTY_SHARE_TYPE);
|
||||||
@ -139,15 +139,15 @@ public class GetShareesTest extends RemoteTest {
|
|||||||
userCount++;
|
userCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assertEquals(userCount, 2);
|
assertTrue(userCount > 0);
|
||||||
assertEquals(groupCount, 1);
|
assertTrue(groupCount > 0);
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
AssertionFailedError afe = new AssertionFailedError(e.getLocalizedMessage());
|
AssertionFailedError afe = new AssertionFailedError(e.getLocalizedMessage());
|
||||||
afe.setStackTrace(e.getStackTrace());
|
afe.setStackTrace(e.getStackTrace());
|
||||||
throw afe;
|
throw afe;
|
||||||
}
|
}
|
||||||
|
|
||||||
// search for sharees including "ad"
|
// search for sharees including "ad" - expecting user "admin" & group "admin"
|
||||||
getShareesOperation = new GetRemoteShareesOperation("ad", 1, 50);
|
getShareesOperation = new GetRemoteShareesOperation("ad", 1, 50);
|
||||||
result = getShareesOperation.execute(mClient);
|
result = getShareesOperation.execute(mClient);
|
||||||
assertTrue(result.isSuccess() && result.getData().size() == 2);
|
assertTrue(result.isSuccess() && result.getData().size() == 2);
|
||||||
@ -172,8 +172,8 @@ public class GetShareesTest extends RemoteTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// search for sharees including "b"
|
// search for sharees including "bd" - expecting 0 results
|
||||||
getShareesOperation = new GetRemoteShareesOperation("b", 1, 50);
|
getShareesOperation = new GetRemoteShareesOperation("bd", 1, 50);
|
||||||
result = getShareesOperation.execute(mClient);
|
result = getShareesOperation.execute(mClient);
|
||||||
assertTrue(result.isSuccess() && result.getData().size() == 0);
|
assertTrue(result.isSuccess() && result.getData().size() == 0);
|
||||||
|
|
||||||
|
@ -174,7 +174,9 @@ public class UpdatePrivateShareTest extends RemoteTest {
|
|||||||
if (mFileShare != null) {
|
if (mFileShare != null) {
|
||||||
/// successful tests
|
/// successful tests
|
||||||
// Update Share permissions on a shared file
|
// 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
|
updateShare.setPermissions(OCShare.READ_PERMISSION_FLAG); // minimum permissions
|
||||||
RemoteOperationResult result = updateShare.execute(mClient);
|
RemoteOperationResult result = updateShare.execute(mClient);
|
||||||
assertTrue(result.isSuccess());
|
assertTrue(result.isSuccess());
|
||||||
@ -189,17 +191,22 @@ public class UpdatePrivateShareTest extends RemoteTest {
|
|||||||
/// unsuccessful tests
|
/// unsuccessful tests
|
||||||
// Update Share with invalid permissions
|
// Update Share with invalid permissions
|
||||||
updateShare = new UpdateRemoteShareOperation(mFileShare.getRemoteId());
|
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);
|
result = updateShare.execute(mClient);
|
||||||
assertFalse(result.isSuccess());
|
assertFalse(result.isSuccess());
|
||||||
|
|
||||||
// Unshare the file before next unsuccessful tests
|
// 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);
|
result = unshare.execute(mClient);
|
||||||
|
|
||||||
if (result.isSuccess()) {
|
if (result.isSuccess()) {
|
||||||
// Update Share permissions on unknown share
|
// 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
|
updateShare.setPermissions(OCShare.READ_PERMISSION_FLAG); // minimum permissions
|
||||||
result = updateShare.execute(mClient);
|
result = updateShare.execute(mClient);
|
||||||
assertFalse(result.isSuccess());
|
assertFalse(result.isSuccess());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user