Examples of SyncFolderItemsResponseType


Examples of com.microsoft.schemas.exchange.services.x2006.messages.SyncFolderItemsResponseType

        getDefaultFolder().setSyncStateToken("old sync state");

        SyncFolderItemsType syncItems = SyncFolderItemsHelper.getSyncFolderItemsRequest(getDefaultConfig(),
                                                                                        getDefaultFolder());

        SyncFolderItemsResponseType syncItemsResponse = mock(SyncFolderItemsResponseType.class);
        ArrayOfResponseMessagesType arrayOfResponseMessages = mock(ArrayOfResponseMessagesType.class);

        when(getService().syncFolderItems(likeThis(syncItems), eq(getDefaultFolder().getUser()))).
                thenReturn(syncItemsResponse);
        when(syncItemsResponse.getResponseMessages()).thenReturn(arrayOfResponseMessages);
        when(arrayOfResponseMessages.getSyncFolderItemsResponseMessageArray())
                .thenReturn(new SyncFolderItemsResponseMessageType[]{});
        SyncFolderItemsResult result = SyncFolderItemsHelper
                .syncFolderItems(getService(), getDefaultConfig(), getDefaultFolder());
        assertEquals(0, result.getIds().size());
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.messages.SyncFolderItemsResponseType

        final String oldState = "old sync state";
        getDefaultFolder().setSyncStateToken(oldState);
        SyncFolderItemsType syncItems = SyncFolderItemsHelper.getSyncFolderItemsRequest(getDefaultConfig(),
                                                                                        getDefaultFolder());

        SyncFolderItemsResponseType syncItemsResponse = mock(SyncFolderItemsResponseType.class);
        ArrayOfResponseMessagesType arrayOfResponseMessages = mock(ArrayOfResponseMessagesType.class);
        SyncFolderItemsResponseMessageType syncFolderItemsResponseMessage =
                mock(SyncFolderItemsResponseMessageType.class);
        SyncFolderItemsChangesType syncFolderItemsChanges = mock(SyncFolderItemsChangesType.class);

        when(getService().syncFolderItems(likeThis(syncItems), eq(getDefaultFolder().getUser()))).
                thenReturn(syncItemsResponse);
        when(syncItemsResponse.getResponseMessages()).thenReturn(arrayOfResponseMessages);
        when(arrayOfResponseMessages.getSyncFolderItemsResponseMessageArray())
                .thenReturn(new SyncFolderItemsResponseMessageType[]{syncFolderItemsResponseMessage});
        when(syncFolderItemsResponseMessage.getResponseCode()).thenReturn(ResponseCodeType.ERROR_ACCESS_DENIED);
        try
        {
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.messages.SyncFolderItemsResponseType

        final String newSyncState = "MySweetNewSyncState";
        getDefaultFolder().setSyncStateToken(oldSyncState);
        SyncFolderItemsType syncItems = SyncFolderItemsHelper.getSyncFolderItemsRequest(getDefaultConfig(),
                                                                                        getDefaultFolder());

        SyncFolderItemsResponseType syncItemsResponse = mock(SyncFolderItemsResponseType.class);
        ArrayOfResponseMessagesType arrayOfResponseMessages = mock(ArrayOfResponseMessagesType.class);
        SyncFolderItemsResponseMessageType syncFolderItemsResponseMessage =
                mock(SyncFolderItemsResponseMessageType.class);
        SyncFolderItemsChangesType syncFolderItemsChanges = mock(SyncFolderItemsChangesType.class);

        when(getService().syncFolderItems(likeThis(syncItems), eq(getDefaultFolder().getUser())))
                .thenReturn(syncItemsResponse);
        when(syncItemsResponse.getResponseMessages()).thenReturn(arrayOfResponseMessages);
        when(arrayOfResponseMessages.getSyncFolderItemsResponseMessageArray())
                .thenReturn(new SyncFolderItemsResponseMessageType[]{syncFolderItemsResponseMessage});
        when(syncFolderItemsResponseMessage.getResponseCode()).thenReturn(ResponseCodeType.NO_ERROR);
        when(syncFolderItemsResponseMessage.isSetIncludesLastItemInRange()).thenReturn(false);
        when(syncFolderItemsResponseMessage.isSetSyncState()).thenReturn(true);
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.messages.SyncFolderItemsResponseType

        final String oldSyncState = "oldSyncState";
        getDefaultFolder().setSyncStateToken(oldSyncState);
        SyncFolderItemsType syncItems = SyncFolderItemsHelper.getSyncFolderItemsRequest(getDefaultConfig(),
                                                                                        getDefaultFolder());

        SyncFolderItemsResponseType syncItemsResponse = mock(SyncFolderItemsResponseType.class);
        ArrayOfResponseMessagesType arrayOfResponseMessages = mock(ArrayOfResponseMessagesType.class);
        SyncFolderItemsResponseMessageType syncFolderItemsResponseMessage =
                mock(SyncFolderItemsResponseMessageType.class);
        SyncFolderItemsChangesType syncFolderItemsChanges = mock(SyncFolderItemsChangesType.class);

        when(getService().syncFolderItems(likeThis(syncItems), eq(getDefaultFolder().getUser())))
                .thenReturn(syncItemsResponse);
        when(syncItemsResponse.getResponseMessages()).thenReturn(arrayOfResponseMessages);
        when(arrayOfResponseMessages.getSyncFolderItemsResponseMessageArray())
                .thenReturn(new SyncFolderItemsResponseMessageType[]{syncFolderItemsResponseMessage});
        when(syncFolderItemsResponseMessage.getResponseCode()).thenReturn(ResponseCodeType.NO_ERROR);
        when(syncFolderItemsResponseMessage.isSetIncludesLastItemInRange()).thenReturn(true);
        when(syncFolderItemsResponseMessage.getIncludesLastItemInRange()).thenReturn(false);
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.messages.SyncFolderItemsResponseType

        String[] ids = new String[0];
        final String myNewSyncState = "MyNewSyncState";
        SyncFolderItemsType syncItems = SyncFolderItemsHelper.getSyncFolderItemsRequest(getDefaultConfig(),
                                                                                        getDefaultFolder());

        SyncFolderItemsResponseType syncItemsResponse = mock(SyncFolderItemsResponseType.class);
        ArrayOfResponseMessagesType arrayOfResponseMessages = mock(ArrayOfResponseMessagesType.class);
        SyncFolderItemsResponseMessageType syncFolderItemsResponseMessage =
                mock(SyncFolderItemsResponseMessageType.class);

        when(getService().syncFolderItems(likeThis(syncItems), eq(getDefaultFolder().getUser())))
                .thenReturn(syncItemsResponse);
        when(syncItemsResponse.getResponseMessages()).thenReturn(arrayOfResponseMessages);
        when(arrayOfResponseMessages.getSyncFolderItemsResponseMessageArray())
                .thenReturn(new SyncFolderItemsResponseMessageType[]{syncFolderItemsResponseMessage});
        when(syncFolderItemsResponseMessage.getResponseCode()).thenReturn(ResponseCodeType.NO_ERROR);
        when(syncFolderItemsResponseMessage.isSetIncludesLastItemInRange()).thenReturn(true);
        when(syncFolderItemsResponseMessage.getIncludesLastItemInRange()).thenReturn(true);
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.messages.SyncFolderItemsResponseType

            throws ServiceCallException, HttpErrorException
    {
        Configuration config = new Configuration(maxIds, 0);
        SyncFolderItemsType syncItems = SyncFolderItemsHelper.getSyncFolderItemsRequest(config, folder);

        SyncFolderItemsResponseType syncItemsResponse = mock(SyncFolderItemsResponseType.class);
        ArrayOfResponseMessagesType arrayOfResponseMessages = mock(ArrayOfResponseMessagesType.class);
        SyncFolderItemsResponseMessageType syncFolderItemsResponseMessage =
                mock(SyncFolderItemsResponseMessageType.class);
        SyncFolderItemsChangesType syncFolderItemsChanges = mock(SyncFolderItemsChangesType.class);

        LOG.debug("Expecting SyncFolderItems with User:{} Request:\n{}", folder.getUser(), syncItems);
        when(service.syncFolderItems(likeThis(syncItems), eq(folder.getUser()))).thenReturn(syncItemsResponse);
        when(syncItemsResponse.getResponseMessages()).thenReturn(arrayOfResponseMessages);
        when(arrayOfResponseMessages.getSyncFolderItemsResponseMessageArray())
                .thenReturn(new SyncFolderItemsResponseMessageType[]{syncFolderItemsResponseMessage});
        when(syncFolderItemsResponseMessage.getResponseCode()).thenReturn(ResponseCodeType.NO_ERROR);
        when(syncFolderItemsResponseMessage.isSetIncludesLastItemInRange()).thenReturn(true);
        when(syncFolderItemsResponseMessage.getIncludesLastItemInRange()).thenReturn(includesLastItemInRange);
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.messages.SyncFolderItemsResponseType

        SyncFolderItemsType
                syncRequest = SyncFolderItemsDocument.Factory.parse(SYNC_FOLDER_ITEMS_REQUEST).getSyncFolderItems();

        ExchangeService service = new ExchangeService(URL, factory);
        SyncFolderItemsResponseType response = service.syncFolderItems(syncRequest, "bkerr");

        SyncFolderItemsResponseType expected = EnvelopeDocument.Factory.parse(soap(SYNC_FOLDER_ITEMS_RESPONSE))
                                                                .getEnvelope().getBody().getSyncFolderItemsResponse();

        assertEquals(expected.xmlText(), response.xmlText());
    }
View Full Code Here

Examples of com.microsoft.schemas.exchange.services.x2006.messages.SyncFolderItemsResponseType

    private static SyncFolderItemsResult syncFolderItems(final ExchangeService exchangeService,
                                                         final SyncFolderItemsType syncFolderItemsRequest,
                                                         final String targetUser, final FolderContext folder)
            throws ServiceCallException, HttpErrorException
    {
        SyncFolderItemsResponseType response = exchangeService.syncFolderItems(syncFolderItemsRequest, targetUser);
        if (response == null)
        {
            LOG.debug("Exchange service returned null sync folder items response for request:\n{}",
                      syncFolderItemsRequest);
            throw new ServiceCallException(ServiceCallException.Reason.OTHER, "Null response from Exchange service.");
        }
        ArrayOfResponseMessagesType array = response.getResponseMessages();
        SyncFolderItemsResult result = new SyncFolderItemsResult(folder.getSyncStateToken());
        boolean hasMessages = false;
        for (SyncFolderItemsResponseMessageType message : array.getSyncFolderItemsResponseMessageArray())
        {
            hasMessages = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.