1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-11 16:33:03 +00:00

Migration to different test server

This commit is contained in:
David A. Velasco
2016-01-27 10:31:46 +01:00
parent b3535a3678
commit ac9771ea3a
4 changed files with 38 additions and 31 deletions
@@ -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<result.getData().size(); i++) {
resultItem = (JSONObject) result.getData().get(i);
value = resultItem.getJSONObject(GetRemoteShareesOperation.NODE_VALUE);
type = (byte) value.getInt(GetRemoteShareesOperation.PROPERTY_SHARE_TYPE);
@@ -139,15 +139,15 @@ public class GetShareesTest extends RemoteTest {
userCount++;
}
}
assertEquals(userCount, 2);
assertEquals(groupCount, 1);
assertTrue(userCount > 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);
@@ -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());