#include <EvolutionSyncSource.h>
Public Member Functions | |
virtual void | updateConfig (ClientTestConfig &config) const =0 |
RegisterSyncSourceTest (const string &configName, const string &testCaseName) | |
virtual | ~RegisterSyncSourceTest () |
Static Public Member Functions | |
static int | dump (ClientTest &client, SyncSource &source, const char *file) |
Public Attributes | |
const string | m_configName |
const string | m_testCaseName |
This code depends on the C++ client library test framework and therefore CPPUnit. To avoid a hard dependency on that in the normal "syncevolution" binary, the actual usage of the test Config class is limited to the *Register.cpp files when compiling them for inclusion in the "client-test" binary, i.e., they are protected by ifdef ENABLE_UNIT_TESTS.
Sync sources have to work stand-alone without a full SyncClient configuration for all local tests. The minimal configuration prepared for the source includes:
No other properties are set, which implies that currently sync sources which require further parameters cannot be tested.
Definition at line 217 of file EvolutionSyncSource.h.
RegisterSyncSourceTest::RegisterSyncSourceTest | ( | const string & | configName, | |
const string & | testCaseName | |||
) |
configName | a unique string: the predefined names known by ClientTest::getTestData() are already used for the initial set of Evolution sync sources, for new sync sources build a string by combining them with the sync source name (e.g., "sqlite_vcard30") | |
testCaseName | a string recognized by ClientTest::getTestData() or an empty string if there are no predefined test cases |
Definition at line 147 of file EvolutionSyncSource.cpp.
References EvolutionSyncSource::getTestRegistry().
virtual RegisterSyncSourceTest::~RegisterSyncSourceTest | ( | ) | [inline, virtual] |
Definition at line 248 of file EvolutionSyncSource.h.
int RegisterSyncSourceTest::dump | ( | ClientTest & | client, | |
SyncSource & | source, | |||
const char * | file | |||
) | [static] |
Dump items in the native format, not the one currently selected for exchange with the SyncML server. Useful for testing sync sources which normally use one format internally, but also support another one (EvolutionContactSource).
Definition at line 485 of file client-test-app.cpp.
virtual void RegisterSyncSourceTest::updateConfig | ( | ClientTestConfig & | config | ) | const [pure virtual] |
This call is invoked after setting up the config with default values for the test cases selected via the constructor's testCaseName parameter (one of vcard21, vcard30, ical20, itodo20; see ClientTest in the Funambol client library for the current list).
This call can then override any of the values or (if there are no predefined test cases) add them.
The "type" property must select your sync source and the data format for the test.
config | change any field whose default is not suitable |
Referenced by TestEvolution::getSourceConfig().
const string RegisterSyncSourceTest::m_configName |
Definition at line 258 of file EvolutionSyncSource.h.
Referenced by TestEvolution::getSourceConfig(), TestRegistry::operator[](), and TestEvolution::TestEvolution().
const string RegisterSyncSourceTest::m_testCaseName |
Definition at line 259 of file EvolutionSyncSource.h.
Referenced by TestEvolution::getSourceConfig().