Search in sources :

Example 11 with LiveOperation

use of com.microsoft.live.LiveOperation in project LiveSDK-for-Android by liveservices.

the class PostTest method testAsyncResponseBodyValidWithUserState.

@Override
public void testAsyncResponseBodyValidWithUserState() throws Throwable {
    this.loadValidResponseBody();
    Object userState = new Object();
    String requestPath = Paths.ME_CALENDARS;
    this.runTestOnUiThread(createAsyncRunnable(requestPath, CALENDAR, userState));
    LiveOperation fromMethod = this.responseQueue.take();
    LiveOperation fromCallback = this.pollResponseQueue();
    this.checkReturnedOperations(fromMethod, fromCallback);
    this.checkOperationMembers(fromMethod, METHOD, requestPath, userState);
    this.checkValidResponseBody(fromMethod);
}
Also used : LiveOperation(com.microsoft.live.LiveOperation) JSONObject(org.json.JSONObject)

Example 12 with LiveOperation

use of com.microsoft.live.LiveOperation in project LiveSDK-for-Android by liveservices.

the class UploadTest method testAsyncResponseBodyInvalid.

@Override
public void testAsyncResponseBodyInvalid() throws Throwable {
    this.loadInvalidResponseBody();
    String requestPath = Paths.ME_SKYDRIVE;
    this.runTestOnUiThread(createAsyncRunnable(requestPath, FILENAME, FILE));
    LiveOperation fromMethod = this.responseQueue.take();
    LiveOperation fromCallback = this.pollResponseQueue();
    LiveOperationException exception = this.pollExceptionQueue();
    this.checkReturnedException(fromMethod, fromCallback, exception);
    this.checkOperationMembers(fromMethod, getMethod(), requestPath);
    this.checkResponseBodyInvalid(fromMethod);
}
Also used : LiveOperation(com.microsoft.live.LiveOperation) LiveOperationException(com.microsoft.live.LiveOperationException)

Example 13 with LiveOperation

use of com.microsoft.live.LiveOperation in project LiveSDK-for-Android by liveservices.

the class UploadTest method testSyncResponseBodyValidWithOverwrite.

public void testSyncResponseBodyValidWithOverwrite() throws Exception {
    this.loadUploadLocationResponseBody();
    this.loadValidResponseBody();
    String requestPath = Paths.ME_SKYDRIVE;
    LiveOperation operation = this.liveConnectClient.upload(requestPath, FILENAME, FILE, OverwriteOption.Overwrite);
    this.checkOperationMembers(operation, getMethod(), requestPath);
    this.checkValidResponseBody(operation);
}
Also used : LiveOperation(com.microsoft.live.LiveOperation)

Example 14 with LiveOperation

use of com.microsoft.live.LiveOperation in project LiveSDK-for-Android by liveservices.

the class UploadTest method testAsyncResponseBodyValidWithOverwrite.

public void testAsyncResponseBodyValidWithOverwrite() throws Throwable {
    this.loadUploadLocationResponseBody();
    this.loadValidResponseBody();
    String requestPath = Paths.ME_SKYDRIVE;
    Object userState = new Object();
    this.runTestOnUiThread(createAsyncRunnable(requestPath, FILENAME, OverwriteOption.Overwrite, FILE, userState));
    LiveOperation fromMethod = this.responseQueue.take();
    LiveOperation fromCallback = this.pollResponseQueue();
    this.checkReturnedOperations(fromMethod, fromCallback);
    this.checkOperationMembers(fromMethod, getMethod(), requestPath, userState);
    this.checkValidResponseBody(fromMethod);
}
Also used : LiveOperation(com.microsoft.live.LiveOperation) JSONObject(org.json.JSONObject)

Example 15 with LiveOperation

use of com.microsoft.live.LiveOperation in project LiveSDK-for-Android by liveservices.

the class PutTest method testAsyncResponseBodyValidWithUserState.

@Override
public void testAsyncResponseBodyValidWithUserState() throws Throwable {
    this.loadValidResponseBody();
    Object userState = new Object();
    String requestPath = this.calendarId;
    this.runTestOnUiThread(createAsyncRunnable(requestPath, CALENDAR, userState));
    LiveOperation fromMethod = this.responseQueue.take();
    LiveOperation fromCallback = this.pollResponseQueue();
    this.checkReturnedOperations(fromMethod, fromCallback);
    this.checkOperationMembers(fromMethod, METHOD, requestPath, userState);
    this.checkValidResponseBody(fromMethod);
}
Also used : LiveOperation(com.microsoft.live.LiveOperation) JSONObject(org.json.JSONObject)

Aggregations

LiveOperation (com.microsoft.live.LiveOperation)36 LiveOperationException (com.microsoft.live.LiveOperationException)10 JSONObject (org.json.JSONObject)10 OperationQueueingListener (com.microsoft.live.test.util.OperationQueueingListener)4 ProgressDialog (android.app.ProgressDialog)3 LiveOperationListener (com.microsoft.live.LiveOperationListener)3 ArrayList (java.util.ArrayList)2 JSONArray (org.json.JSONArray)2 DialogInterface (android.content.DialogInterface)1 OnCancelListener (android.content.DialogInterface.OnCancelListener)1 View (android.view.View)1 OnClickListener (android.view.View.OnClickListener)1 TextView (android.widget.TextView)1 LiveAuthClient (com.microsoft.live.LiveAuthClient)1 LiveAuthException (com.microsoft.live.LiveAuthException)1 LiveAuthListener (com.microsoft.live.LiveAuthListener)1 LiveConnectClient (com.microsoft.live.LiveConnectClient)1 LiveConnectSession (com.microsoft.live.LiveConnectSession)1 LiveDownloadOperation (com.microsoft.live.LiveDownloadOperation)1 LiveDownloadOperationListener (com.microsoft.live.LiveDownloadOperationListener)1