Search in sources :

Example 1 with LiveOperation

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

the class FileOperationApiTest method testAsyncResponseBodyValidWithUserState.

@Override
public void testAsyncResponseBodyValidWithUserState() throws Throwable {
    this.loadValidResponseBody();
    String requestPath = "file.123123";
    String destination = "file.123109";
    Object userState = new Object();
    this.runTestOnUiThread(createAsyncRunnable(requestPath, destination, userState));
    LiveOperation fromMethod = this.responseQueue.take();
    LiveOperation fromCallback = this.pollResponseQueue();
    this.checkReturnedOperations(fromMethod, fromCallback);
    this.checkOperationMembers(fromMethod, this.getMethod(), requestPath, userState);
    this.checkValidResponseBody(fromMethod);
}
Also used : LiveOperation(com.microsoft.live.LiveOperation)

Example 2 with LiveOperation

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

the class FileOperationApiTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    this.responseQueue = new LinkedBlockingQueue<LiveOperation>();
    this.queueingListener = new OperationQueueingListener(this.exceptionQueue, this.responseQueue);
}
Also used : LiveOperation(com.microsoft.live.LiveOperation) OperationQueueingListener(com.microsoft.live.test.util.OperationQueueingListener)

Example 3 with LiveOperation

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

the class FileOperationApiTest method testAsyncResponseBodyInvalid.

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

Example 4 with LiveOperation

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

the class JsonEnclosingApiTest method setUp.

@Override
protected void setUp() throws Exception {
    super.setUp();
    this.responseQueue = new LinkedBlockingQueue<LiveOperation>();
    this.queueingListener = new OperationQueueingListener(this.exceptionQueue, this.responseQueue);
}
Also used : LiveOperation(com.microsoft.live.LiveOperation) OperationQueueingListener(com.microsoft.live.test.util.OperationQueueingListener)

Example 5 with LiveOperation

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

the class DeleteTest method testAsyncResponseBodyValidWithUserState.

@Override
public void testAsyncResponseBodyValidWithUserState() throws Throwable {
    this.loadValidResponseBody();
    Object userState = new Object();
    String requestPath = this.calendarId;
    this.runTestOnUiThread(createAsyncRunnable(requestPath, 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