RegisterSyncSourceTest Class Reference

#include <EvolutionSyncSource.h>

List of all members.

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


Detailed Description

In addition to registering the sync source itself by creating an instance of RegisterSyncSource, configurations for testing it can also be registered. A sync source which supports more than one data exchange format can register one configuration for each format, but not registering any configuration is also okay.

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.

Warning:
There is a potential problem with the registration mechanism. Both the sync source tests as well as the CPPUnit tests derived from them are registrered when global class instances are initialized. If the RegisterTestEvolution instance in client-test-app.cpp is initialized *before* the sync source tests, then those won't show up in the test list. Currently the right order seems to be used, so everything works as expected.

Definition at line 217 of file EvolutionSyncSource.h.


Constructor & Destructor Documentation

RegisterSyncSourceTest::RegisterSyncSourceTest ( const string &  configName,
const string &  testCaseName 
)

Parameters:
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.


Member Function Documentation

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.

Return values:
config change any field whose default is not suitable

Referenced by TestEvolution::getSourceConfig().


Member Data Documentation

Definition at line 259 of file EvolutionSyncSource.h.

Referenced by TestEvolution::getSourceConfig().


The documentation for this class was generated from the following files:

Generated on Sat Oct 18 17:17:05 2008 for SyncEvolution and Funambol by  doxygen 1.5.7.1