Package com.ripariandata.timberwolf.writer.console

Examples of com.ripariandata.timberwolf.writer.console.InMemoryUserFolderSyncStateStorage


        syncFolderItems.addNewSyncFolderId().addNewFolderId().setId("MySweetExchangeId");
        syncFolderItems.setSyncState("MySweetSyncToken");

        Configuration config = new Configuration(4000, 200);
        FolderContext folder = new FolderContext("MySweetExchangeId", getDefaultUser(),
                                                 new InMemoryUserFolderSyncStateStorage());
        folder.setSyncStateToken("MySweetSyncToken");
        assertEquals(syncFolderItems.xmlText(),
                     SyncFolderItemsHelper.getSyncFolderItemsRequest(config, folder).xmlText());
    }
View Full Code Here


    {
        final int idPageSize = 13;
        final int getItemSize = 3;
        Configuration config = new Configuration(idPageSize, getItemSize);
        Assert.assertTrue(config.getSyncStateStorage() instanceof InMemoryUserFolderSyncStateStorage);
        InMemoryUserFolderSyncStateStorage newSyncStorage = new InMemoryUserFolderSyncStateStorage();
        final UserFolderSyncStateStorage oldSyncStateStorage = config.getSyncStateStorage();
        assertNotSame(oldSyncStateStorage, newSyncStorage);
        Configuration newConfig = config.withSyncStateStorage(newSyncStorage);
        assertEquals(idPageSize, newConfig.getIdPageSize());
        assertEquals(getItemSize, newConfig.getItemPageSize());
View Full Code Here

    {
        // Exchange returns 0 mail when syncFolderItems is called
        defaultMockFindFolders();
        mockSyncFolderItems(new String[0], "newSyncState");
        ExchangeMailStore store = new ExchangeMailStore(getService());
        for (MailboxItem mailboxItem : store.getMail(defaultUser, new InMemoryUserFolderSyncStateStorage()))
        {
            fail("There shouldn't be any mailBoxItems");
        }
    }
View Full Code Here

                   ServiceCallException
    {
        // Exchange returns 0 mail when syncFolderItems is called
        mockFindFolders(new FolderType[0]);
        ExchangeMailStore store = new ExchangeMailStore(getService());
        for (MailboxItem mailboxItem : store.getMail(defaultUser, new InMemoryUserFolderSyncStateStorage()))
        {
            fail("There shouldn't be any mailBoxItems");
        }
    }
View Full Code Here

        defaultMockFindFolders();

        try
        {
            ExchangeMailStore store = new ExchangeMailStore(getService());
            Iterable<MailboxItem> mail = store.getMail(defaultUser, new InMemoryUserFolderSyncStateStorage());
        }
        catch (ExchangeRuntimeException e)
        {
            assertEquals("Failed to get item details.", e.getMessage());
        }
View Full Code Here

        defaultMockFindFolders();
        MessageType[] messages = mockSyncFolderItems(0, 512, count, "newSyncState");
        mockGetItem(messages, 0, count, 0, count, getDefaultFolderId());
        int i = 0;
        ExchangeMailStore store = new ExchangeMailStore(getService());
        for (MailboxItem mailboxItem : store.getMail(defaultUser, new InMemoryUserFolderSyncStateStorage()))
        {
            assertEquals(requestedList.get(i), mailboxItem.getHeader(idHeaderKey));
            i++;
        }
        if (i < requestedList.size())
View Full Code Here

                    generateIds(offsetZero, countTwo, "FOLDER-THREE-ID"));

        final int idPageSize = 10;
        final int getItemPageSize = 5;
        ExchangeMailStore store = new ExchangeMailStore(getService(), idPageSize, getItemPageSize);
        Iterator<MailboxItem> mail = store.getMail(defaultUser, new InMemoryUserFolderSyncStateStorage()).iterator();
        final int folderIdTwoCount = 13;
        final int folderIdOtherCount = 2;
        for (String folder : new String[]{"FOLDER-ONE-ID", "FOLDER-TWO-ID", "FOLDER-THREE-ID"})
        {
            for (int i = 0; i < (folder == "FOLDER-TWO-ID" ? folderIdTwoCount : folderIdOtherCount); i++)
View Full Code Here

        users.add("alice");

        final int idPageSize = 10;
        final int getItemPageSize = 5;
        ExchangeMailStore store = new ExchangeMailStore(getService(), idPageSize, getItemPageSize);
        Iterator<MailboxItem> mail = store.getMail(users, new InMemoryUserFolderSyncStateStorage()).iterator();

        final int count = 2;
        for (String folder : new String[]{bobFolderId, aliceFolderId})
        {
            for (int i = 0; i < count; i++)
View Full Code Here

        syncStateStorage = userFolderSyncStateStorage;
    }

    public FolderContext(final String folder, final String targetUser)
    {
        this(folder, targetUser, new InMemoryUserFolderSyncStateStorage());
    }
View Full Code Here

     * @param sizeOfIdPages Must be greater than or equal to 1.
     * @param sizeOfItemPages Must be greater than or equal to 1.
     */
    public Configuration(final int sizeOfIdPages, final int sizeOfItemPages)
    {
        this(sizeOfIdPages, sizeOfItemPages, new InMemoryUserFolderSyncStateStorage());
    }
View Full Code Here

TOP

Related Classes of com.ripariandata.timberwolf.writer.console.InMemoryUserFolderSyncStateStorage

Copyright © 2018 www.massapicom. 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.