亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? clienttest.h

?? funambol windows mobile plugin source code, the source code is taken from the funambol site
?? H
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*
 * Copyright (C) 2005-2007 Funambol, Inc
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY, TITLE, NONINFRINGEMENT or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
 * 02111-1307  USA
 */

#ifndef INCL_TESTSYNCCLIENT
#define INCL_TESTSYNCCLIENT
/** @cond API */
/** @addtogroup Client */
/** @{ */

#include <string>
#include <vector>
#include "spds/SyncSource.h"
#include "spds/SyncReport.h"

#ifdef ENABLE_INTEGRATION_TESTS

#include <cppunit/TestSuite.h>
#include <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>

/**
 * This class encapsulates logging and checking of a SyncReport.
 * When constructed with default parameters, no checking will be done.
 * Otherwise the sync report has to contain exactly the expected result.
 * When multiple sync sources are active, @b all of them have to behave
 * alike (which is how the tests are constructed).
 *
 * No item is ever supposed to fail.
 */
class CheckSyncReport {
  public:
    CheckSyncReport(int clAdded = -1, int clUpdated = -1, int clDeleted = -1,
                    int srAdded = -1, int srUpdated = -1, int srDeleted = -1) :
        clientAdded(clAdded),
        clientUpdated(clUpdated),
        clientDeleted(clDeleted),
        serverAdded(srAdded),
        serverUpdated(srUpdated),
        serverDeleted(srDeleted)
        {}

    const int clientAdded, clientUpdated, clientDeleted,
        serverAdded, serverUpdated, serverDeleted;

    /**
     * checks that the sync completed as expected and throws
     * CPPUnit exceptions if something is wrong
     *
     * @param res     return code from SyncClient::sync()
     * @param report  the sync report stored in the SyncClient
     */
    virtual void check(int res, SyncReport &report) const;
};

class LocalTests;
class SyncTests;

/**
 * This is the interface expected by the testing framework for sync
 * clients.  It defines several methods that a derived class must
 * implement if it wants to use that framework. Note that this class
 * itself is not derived from SyncClient. This gives a user of this
 * framework the freedom to implement it in two different ways:
 * - implement a class derived from both SyncClient and ClientTest
 * - add testing of an existing subclass of SyncClient by implementing
 *   a ClientTest which uses that subclass
 *
 * The client is expected to support change tracking for multiple
 * servers. Although the framework always always tests against the
 * same server, for most tests it is necessary to access the database
 * without affecting the next synchronization with the server. This is
 * done by asking the client for two different sync sources via
 * Config::createSourceA and Config::createSourceB which have to
 * create them in a suitable way - pretty much as if the client was
 * synchronized against different server. A third, different change
 * tracking is needed for real synchronizations of the data.
 *
 * Furthermore the client is expected to support multiple data sources
 * of the same kind, f.i. two different address books. This is used to
 * test full client A <-> server <-> client B synchronizations in some
 * tests or to check server modifications done by client A with a
 * synchronization against client B. In those tests client A is mapped
 * to the first data source and client B to the second one.
 *
 * Finally the SyncSource API is used in slightly different ways which
 * go beyond what is normally expected from a SyncSource implementation:
 * - beginSync() may be called without setting a sync mode:
 *   when SyncSource::getSyncMode() returns SYNC_NONE the source is
 *   expected to make itself ready to iterate over all, new, updated and
 *   deleted items
 * - items may be added via SyncSource::addItem() with a type of "raw":
 *   this implies that the type is the one used for items in the
 *   ClientTest::Config below
 *
 * Handling configuration and creating classes is entirely done by the
 * subclass of ClientTest, the frameworks makes no assumptions
 * about how this is done. Instead it queries the ClientTest for
 * properties (like available sync sources) and then creates several
 * tests.
 */
class ClientTest {
  public:
    ClientTest(int serverSleepSec = 0, const std::string &serverLog= "");
    virtual ~ClientTest();

    /**
     * This function registers tests using this instance of ClientTest for
     * later use during a test run.
     *
     * The instance must remain valid until after the tests were
     * run. To run them use a separate test runner, like the one from
     * client-test-main.cpp.
     */
    virtual void registerTests();

    class Config;

    /**
     * Creates an instance of LocalTests (default implementation) or a
     * class derived from it.  LocalTests provides tests which cover
     * the SyncSource interface and can be executed without a SyncML
     * server. It also contains utility functions for working with
     * SyncSources.
     *
     * A ClientTest implementation can, but doesn't have to extend
     * these tests by instantiating a derived class here.
     */
    virtual LocalTests *createLocalTests(const std::string &name, int sourceParam, ClientTest::Config &co);

    /**
     * Creates an instance of SyncTests (default) or a class derived
     * from it.  SyncTests provides tests which cover the actual
     * interaction with a SyncML server.
     *
     * A ClientTest implementation can, but doesn't have to extend
     * these tests by instantiating a derived class here.
     */
    virtual SyncTests *createSyncTests(const std::string &name, std::vector<int> sourceIndices, bool isClientA = true);

    /**
     * utility function for dumping items which are C strings with blank lines as separator
     */
    static int dump(ClientTest &client, SyncSource &source, const char *file);

    /**
     * utility function for importing items with blank lines as separator
     */
    static int import(ClientTest &client, SyncSource &source, const char *file);

    /**
     * utility function for comparing vCard and iCal files with the external
     * synccompare.pl Perl script
     */
    static bool compare(ClientTest &client, const char *fileA, const char *fileB);

    struct Config;

    /**
     * A derived class can use this call to get default test
     * cases, but still has to add callbacks which create sources
     * and execute a sync session.
     *
     * Some of the test cases are compiled into the library, other
     * depend on the auxiliary files from the "test" directory.
     * Currently supported types:
     * - vcard30 = vCard 3.0 contacts
     * - vcard21 = vCard 2.1 contacts
     * - ical20 = iCal 2.0 events
     * - vcal10 = vCal 1.0 events
     * - itodo20 = iCal 2.0 tasks
     */
    static void getTestData(const char *type, Config &config);

    /**
     * Information about a data source. For the sake of simplicity all
     * items pointed to are owned by the ClientTest and must
     * remain valid throughout a test session. Not setting a pointer
     * is okay, but it will disable all tests that need the
     * information.
     */
    struct Config {
        /**
         * The name is used in test names and has to be set.
         */
        const char *sourceName;

        /**
         * A default URI to be used when creating a client config.
         */
        const char *uri;

        /**
         * A member function of a subclass which is called to create a
         * sync source referencing the data. This is used in tests of
         * the SyncSource API itself as well as in tests which need to
         * modify or check the data sources used during synchronization.
         *
         * The test framework will call beginSync() and then some of
         * the functions it wants to test. After a successful test it
         * will call endSync() which is then expected to store all
         * changes persistently. Creating a sync source again
         * with the same call should not report any
         * new/updated/deleted items until such changes are made via
         * another sync source.
         *
         * The instance will be deleted by the caller. Because this
         * may be in the error case or in an exception handler,
         * the sync source's desctructor should not thow exceptions.
         *
         * @param client    the same instance to which this config belongs
         * @param source    index of the data source (from 0 to ClientTest::getNumSources() - 1)
         * @param isSourceA true if the requested SyncSource is the first one accessing that
         *                  data, otherwise the second
         */
        typedef SyncSource *(*createsource_t)(ClientTest &client, int source, bool isSourceA);

        /**
         * Creates a sync source which references the primary database;
         * it may report the same changes as the sync source used during
         * sync tests.
         */
        createsource_t createSourceA;

        /**
         * A second sync source also referencing the primary data
         * source, but configured so that it tracks changes
         * independently from the the primary sync source.
         *
         * In local tests the usage is like this:
         * - add item via first SyncSource
         * - iterate over new items in second SyncSource
         * - check that it lists the added item
         *
         * In tests with a server the usage is:
         * - do a synchronization with the server
         * - iterate over items in second SyncSource
         * - check that the total number and number of
         *   added/updated/deleted items is as expected
         */
        createsource_t createSourceB;

        /**
         * The framework can generate vCard and vCalendar/iCalendar items
         * automatically by copying a template item and modifying certain
         * properties.
         *
         * This is the template for these automatically generated items.
         */
        const char *templateItem;

         /**
         * This is a colon (:) separated list of properties which need
         * to be modified in templateItem.
         */
        const char *uniqueProperties;

        /**
         * the number of items to create during stress tests
         */
        int numItems;

        /**
         * This is a single property in templateItem which can be extended
         * to increase the size of generated items.
         */
        const char *sizeProperty;

        /**
         * A very simple item that is inserted during basic tests. Ideally
         * it only contains properties supported by all servers.
         */
        const char *insertItem;

        /**
         * A slightly modified version of insertItem. If the source has UIDs
         * embedded into the item data, then both must have the same UID.
         * Again all servers should better support these modified properties.
         */
        const char *updateItem;

        /**
         * A more heavily modified version of insertItem. Same UID if necessary,
         * but can test changes to items only supported by more advanced
         * servers.
         */
        const char *complexUpdateItem;

        /**
         * To test merge conflicts two different updates of insertItem are
         * needed. This is the first such update.
         */
        const char *mergeItem1;

        /**
         * The second merge update item. To avoid true conflicts it should
         * update different properties than mergeItem1, but even then servers
         * usually have problems perfectly merging items. Therefore the
         * test is run without expecting a certain merge result.
         */
        const char *mergeItem2;

        /**
         * called to dump all items into a file, required by tests which need
         * to compare items
         *
         * ClientTest::dump can be used: it will simply dump all items of the source
         * with a blank line as separator.
         *
         * @param source     sync source A already created and with beginSync() called
         * @param file       a file name
         * @return error code, 0 for success
         */
        int (*dump)(ClientTest &client, SyncSource &source, const char *file);

        /**
         * import test items: which these are is determined entirely by
         * the implementor, but tests work best if several complex items are
         * imported
         *
         * ClientTest::import can be used if the file contains items separated by
         * empty lines.
         *
         * @param source     sync source A already created and with beginSync() called
         * @param file       the name of the file to import
         * @return error code, 0 for success
         */
        int (*import)(ClientTest &client, SyncSource &source, const char *file);

        /**
         * a function which compares two files with items in the format used by "dump"
         *
         * @param fileA      first file name
         * @param fileB      second file name
         * @return true if the content of the files is considered equal
         */
        bool (*compare)(ClientTest &client, const char *fileA, const char *fileB);

        /**
         * a file with test cases in the format expected by import and compare
         */
        const char *testcases;

        /**
         * the item type normally used by the source (not used by the tests
         * themselves; client-test.cpp uses it to initialize source configs)
         */
        const char *type;
    };

    /**
     * Data sources are enumbered from 0 to n-1 for the purpose of
     * testing. This call returns n.
     */
    virtual int getNumSources() = 0;

    /**
     * Called to fill the given test source config with information
     * about a sync source identified by its index. It's okay to only
     * fill in the available pieces of information and set everything
     * else to zero.
     */
    virtual void getSourceConfig(int source, Config &config) = 0;

    /**
     * The instance to use as second client. Returning NULL disables
     * all checks which require a second client. The returned pointer
     * must remain valid throughout the life time of the tests.
     *
     * The second client must be configured to access the same server
     * and have data sources which match the ones from the primary
     * client.
     */
    virtual ClientTest *getClientB() = 0;

    /**

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美偷拍三级| 欧美蜜桃一区二区三区| 久久久精品国产免大香伊| 美国av一区二区| 亚洲精品在线三区| 国产综合久久久久久久久久久久| 欧美刺激午夜性久久久久久久| 蜜臀av一区二区| 久久免费电影网| 成人免费视频国产在线观看| 亚洲人成小说网站色在线| 在线观看成人小视频| 秋霞影院一区二区| 精品第一国产综合精品aⅴ| 国产不卡视频在线播放| 国产精品理论在线观看| 91久久一区二区| 日韩电影在线一区| 久久午夜老司机| 91丝袜美腿高跟国产极品老师| 亚洲一区视频在线| 精品少妇一区二区三区视频免付费| 国产福利一区二区三区视频在线 | 99精品一区二区三区| 亚洲一区二区欧美日韩| 日韩一区二区三区电影| 高清不卡一区二区在线| 一卡二卡欧美日韩| 精品福利av导航| 欧美亚洲国产一区在线观看网站| 麻豆国产精品777777在线| 国产日韩欧美不卡| 欧美三级日韩在线| 国产成人午夜视频| 五月天丁香久久| 国产精品国产自产拍高清av| 777a∨成人精品桃花网| 成人免费av网站| 男男视频亚洲欧美| 亚洲少妇中出一区| 精品精品欲导航| 在线亚洲欧美专区二区| 国产在线精品一区二区三区不卡 | 日本成人中文字幕| 国产精品日韩成人| 欧美一区二区三区小说| a美女胸又www黄视频久久| 奇米精品一区二区三区在线观看| 亚洲日本成人在线观看| 久久人人97超碰com| 欧美精品在线视频| 成人av网站在线观看| 另类小说一区二区三区| 亚洲一二三四久久| 国产精品麻豆网站| 精品播放一区二区| 欧美电影一区二区| 色妞www精品视频| 成人va在线观看| 韩国av一区二区三区四区| 亚洲国产cao| 亚洲图片自拍偷拍| 国产精品国产三级国产普通话99| 欧美va亚洲va| 欧美成人一级视频| 欧美日韩国产美| 欧美日韩视频在线第一区| 91美女精品福利| 色综合咪咪久久| 97se狠狠狠综合亚洲狠狠| 成人综合婷婷国产精品久久免费| 国产一区欧美一区| 国产在线播放一区三区四| 美女任你摸久久| 久久精品国产精品亚洲综合| 麻豆久久一区二区| 日本欧美加勒比视频| 免费高清在线视频一区·| 青青草国产成人av片免费| 午夜精品国产更新| 五月综合激情婷婷六月色窝| 亚洲高清免费一级二级三级| 午夜亚洲福利老司机| 婷婷六月综合网| 青青草97国产精品免费观看| 另类专区欧美蜜桃臀第一页| 精品一区二区三区在线观看| 精品在线免费观看| 国产成+人+日韩+欧美+亚洲| 99久久伊人精品| 欧美午夜精品久久久久久超碰| 欧美日韩国产一级片| 欧美一区午夜视频在线观看| 精品国产第一区二区三区观看体验| 欧美精品一区二区三区一线天视频| 日韩你懂的在线观看| 国产亚洲精品福利| 国产精品国产a| 亚洲成人高清在线| 久久国产三级精品| 国产成人啪午夜精品网站男同| 成人国产精品免费观看动漫| 一本到三区不卡视频| 欧美日韩一区二区在线观看 | 国产中文字幕精品| 不卡电影免费在线播放一区| 91麻豆文化传媒在线观看| 欧洲激情一区二区| 91精品国产综合久久小美女 | 国产精品毛片大码女人 | 欧美aaaaaa午夜精品| 国产又黄又大久久| 色呦呦网站一区| 日韩欧美电影一区| 国产精品伦理在线| 午夜精品福利在线| 国内偷窥港台综合视频在线播放| 99这里只有久久精品视频| 欧美日韩黄视频| 国产亚洲1区2区3区| 亚洲一区二区三区中文字幕在线| 玖玖九九国产精品| 91在线视频18| 日韩欧美在线影院| 国产精品激情偷乱一区二区∴| 日韩成人午夜电影| av影院午夜一区| 日韩欧美国产综合| 亚洲色图第一区| 韩国女主播成人在线观看| 色婷婷香蕉在线一区二区| 久久久综合视频| 日本免费在线视频不卡一不卡二| 91在线视频官网| 精品久久国产字幕高潮| 亚洲动漫第一页| 成人av网址在线观看| 精品国产乱码久久久久久久| 亚洲国产另类精品专区| 成人免费毛片嘿嘿连载视频| 日韩免费观看高清完整版在线观看| 亚洲精品成人在线| 高清视频一区二区| 精品国产乱码久久久久久1区2区| 亚洲sss视频在线视频| 91女人视频在线观看| 国产三级三级三级精品8ⅰ区| 精品在线观看视频| 欧美一区二区三区人| 亚洲精品日韩专区silk| 成人精品鲁一区一区二区| 欧美成人a视频| 日本成人中文字幕| 欧美顶级少妇做爰| 偷窥少妇高潮呻吟av久久免费| 91久久一区二区| 亚洲激情图片一区| 91小宝寻花一区二区三区| 国产精品另类一区| 国产成人免费在线| 国产喂奶挤奶一区二区三区| 国产乱一区二区| 欧美va亚洲va在线观看蝴蝶网| 肉丝袜脚交视频一区二区| 欧美探花视频资源| 亚洲高清免费在线| 欧美欧美欧美欧美首页| 日韩一区精品字幕| 欧美一二三四区在线| 久久精品国产一区二区三 | 91精品福利在线一区二区三区| 亚洲444eee在线观看| 久久精品二区亚洲w码| 91在线porny国产在线看| 国产精品久久久久桃色tv| 成人小视频在线观看| 欧美高清在线精品一区| 国产精品白丝jk黑袜喷水| 国产欧美精品一区二区色综合| 成人午夜看片网址| 亚洲视频香蕉人妖| 在线免费观看日韩欧美| 亚洲成人免费在线| 91麻豆精品国产91久久久使用方法 | 91精品国产91热久久久做人人| 日av在线不卡| 久久综合久久鬼色| 国产成人免费在线视频| 日韩一区中文字幕| 欧美三片在线视频观看| 欧美aaa在线| 日本一区二区成人| 99久久综合狠狠综合久久| 亚洲天堂2016| 欧美精品tushy高清| 狠狠色综合日日| 亚洲视频狠狠干| 欧美一区二区三区的| 国产精品69毛片高清亚洲| 亚洲欧美在线另类|