#include <ClientTest.h>
Public Types | |
typedef SyncSource *(* | createsource_t )(ClientTest &client, int source, bool isSourceA) |
typedef SyncSource *(* | createsource_t )(ClientTest &client, int source, bool isSourceA) |
Public Attributes | |
const char * | sourceName |
const char * | uri |
createsource_t | createSourceA |
createsource_t | createSourceB |
const char * | templateItem |
const char * | uniqueProperties |
int | numItems |
const char * | sizeProperty |
const char * | insertItem |
const char * | updateItem |
const char * | complexUpdateItem |
const char * | mergeItem1 |
const char * | mergeItem2 |
const char * | parentItem |
const char * | childItem |
const char * | parentItemUpdate |
const char * | childItemUpdate |
bool | sourceKnowsItemSemantic |
int(* | dump )(ClientTest &client, SyncSource &source, const char *file) |
int(* | import )(ClientTest &client, SyncSource &source, const char *file) |
bool(* | compare )(ClientTest &client, const char *fileA, const char *fileB) |
const char * | testcases |
const char * | type |
Definition at line 217 of file ClientTest.h.
typedef SyncSource*(* ClientTest::Config::createsource_t)(ClientTest &client, int source, bool isSourceA) |
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.
client | the same instance to which this config belongs | |
source | index of the data source (from 0 to ClientTest::getNumSources() - 1) | |
isSourceA | true if the requested SyncSource is the first one accessing that data, otherwise the second |
typedef SyncSource*(* ClientTest::Config::createsource_t)(ClientTest &client, int source, bool isSourceA) |
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.
client | the same instance to which this config belongs | |
source | index of the data source (from 0 to ClientTest::getNumSources() - 1) | |
isSourceA | true if the requested SyncSource is the first one accessing that data, otherwise the second |
const char * ClientTest::Config::childItem |
Definition at line 357 of file ClientTest.h.
Referenced by LocalTests::addTests(), ClientTest::getTestData(), LocalTests::testLinkedItemsChild(), LocalTests::testLinkedItemsChildChangesParent(), LocalTests::testLinkedItemsChildParent(), LocalTests::testLinkedItemsInsertBothUpdateChild(), LocalTests::testLinkedItemsInsertBothUpdateParent(), LocalTests::testLinkedItemsInsertChildTwice(), LocalTests::testLinkedItemsInsertParentTwice(), LocalTests::testLinkedItemsParent(), LocalTests::testLinkedItemsParentChild(), LocalTests::testLinkedItemsParentUpdate(), LocalTests::testLinkedItemsRemoveNormal(), LocalTests::testLinkedItemsRemoveParentFirst(), and LocalTests::testLinkedItemsUpdateChild().
const char * ClientTest::Config::childItemUpdate |
Definition at line 357 of file ClientTest.h.
Referenced by LocalTests::addTests(), ClientTest::getTestData(), LocalTests::testLinkedItemsInsertBothUpdateChild(), LocalTests::testLinkedItemsInsertChildTwice(), and LocalTests::testLinkedItemsUpdateChild().
bool(* ClientTest::Config::compare)(ClientTest &client, const char *fileA, const char *fileB) | ( | ClientTest & | client, | |
const char * | fileA, | |||
const char * | fileB | |||
) |
a function which compares two files with items in the format used by "dump"
fileA | first file name | |
fileB | second file name |
Referenced by SyncTests::addTests(), LocalTests::addTests(), LocalTests::compareDatabases(), TestEvolution::getSourceConfig(), ClientTest::getTestData(), and LocalTests::testImport().
const char * ClientTest::Config::complexUpdateItem |
A more heavily modified version of insertItem. Same UID if necessary, but can test changes to items only supported by more advanced servers.
Definition at line 322 of file ClientTest.h.
Referenced by SyncTests::addTests(), and ClientTest::getTestData().
Creates a sync source which references the primary database; it may report the same changes as the sync source used during sync tests.
Definition at line 258 of file ClientTest.h.
Referenced by SyncTests::addTests(), LocalTests::addTests(), EvolutionLocalTests::addTests(), TestEvolution::getSourceConfig(), LocalTests::testIterateTwice(), LocalTests::testLocalDeleteAll(), LocalTests::testOpen(), and LocalTests::testSimpleInsert().
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:
In tests with a server the usage is:
Definition at line 276 of file ClientTest.h.
Referenced by LocalTests::addTests(), EvolutionLocalTests::addTests(), TestEvolution::getSourceConfig(), and LocalTests::testChanges().
int(* ClientTest::Config::dump)(ClientTest &client, SyncSource &source, const char *file) | ( | ClientTest & | client, | |
SyncSource & | source, | |||
const char * | file | |||
) |
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.
source | sync source A already created and with beginSync() called | |
file | a file name |
Referenced by SyncTests::addTests(), LocalTests::addTests(), LocalTests::compareDatabases(), ClientTest::getTestData(), and LocalTests::testImport().
int(* ClientTest::Config::import)(ClientTest &client, SyncSource &source, const char *file) | ( | 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.
source | sync source A already created and with beginSync() called | |
file | the name of the file to import |
Referenced by SyncTests::addTests(), LocalTests::addTests(), ClientTest::getTestData(), and LocalTests::testImport().
const char * ClientTest::Config::insertItem |
A very simple item that is inserted during basic tests. Ideally it only contains properties supported by all servers.
Definition at line 308 of file ClientTest.h.
Referenced by SyncTests::addTests(), LocalTests::addTests(), ClientTest::getTestData(), LocalTests::testLocalDeleteAll(), and LocalTests::testSimpleInsert().
const char * ClientTest::Config::mergeItem1 |
To test merge conflicts two different updates of insertItem are needed. This is the first such update.
Definition at line 328 of file ClientTest.h.
Referenced by SyncTests::addTests(), and ClientTest::getTestData().
const char * ClientTest::Config::mergeItem2 |
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.
Definition at line 336 of file ClientTest.h.
Referenced by SyncTests::addTests(), and ClientTest::getTestData().
the number of items to create during stress tests
Definition at line 296 of file ClientTest.h.
Referenced by ClientTest::getTestData(), and LocalTests::insertManyItems().
const char * ClientTest::Config::parentItem |
These two items are related: one is main one, the other is a subordinate one. The semantic is that the main item is complete on it its own, while the other normally should only be used in combination with the main one.
Because SyncML cannot express such dependencies between items, a SyncSource has to be able to insert, updated and remove both items independently. However, operations which violate the semantic of the related items (like deleting the parent, but not the child) may have unspecified results (like also deleting the child). See LINKED_ITEMS_RELAXED_SEMANTIC.
One example for main and subordinate items are a recurring iCalendar 2.0 event and a detached recurrence.
The updated items are needed in same tests; they should differ from the normal ones in some relevant properties.
These two items are related: one is main one, the other is a subordinate one. The semantic is that the main item is complete on it its own, while the other normally should only be used in combination with the main one.
Because SyncML cannot express such dependencies between items, a SyncSource has to be able to insert, updated and remove both items independently. However, operations which violate the semantic of the related items (like deleting the parent, but not the child) may have unspecified results (like also deleting the child). See LINKED_ITEMS_RELAXED_SEMANTIC.
One example for main and subordinate items are a recurring iCalendar 2.0 event and a detached recurrence.
Definition at line 357 of file ClientTest.h.
Referenced by LocalTests::addTests(), ClientTest::getTestData(), LocalTests::testLinkedItemsChild(), LocalTests::testLinkedItemsChildChangesParent(), LocalTests::testLinkedItemsChildParent(), LocalTests::testLinkedItemsInsertBothUpdateChild(), LocalTests::testLinkedItemsInsertBothUpdateParent(), LocalTests::testLinkedItemsInsertChildTwice(), LocalTests::testLinkedItemsInsertParentTwice(), LocalTests::testLinkedItemsParent(), LocalTests::testLinkedItemsParentChild(), LocalTests::testLinkedItemsParentUpdate(), LocalTests::testLinkedItemsRemoveNormal(), LocalTests::testLinkedItemsRemoveParentFirst(), and LocalTests::testLinkedItemsUpdateChild().
const char * ClientTest::Config::parentItemUpdate |
Definition at line 357 of file ClientTest.h.
Referenced by LocalTests::addTests(), ClientTest::getTestData(), LocalTests::testLinkedItemsInsertBothUpdateParent(), and LocalTests::testLinkedItemsParentUpdate().
const char * ClientTest::Config::sizeProperty |
This is a single property in templateItem which can be extended to increase the size of generated items.
Definition at line 302 of file ClientTest.h.
Referenced by ClientTest::getTestData(), and LocalTests::insertManyItems().
Overwrite the default 'true' with 'false' to disable tests which assume that the source being tested follows certain conventions for the items being exchanged.
For example, testLinkedItemsInsertParentTwice inserts a calendar event twice and expects that the source only keeps one event because the UID has to be kept unique. A dumb file sync source doesn't know that and would keep two copies of the same event.
Definition at line 379 of file ClientTest.h.
Referenced by LocalTests::addTests(), and ClientTest::getTestData().
const char * ClientTest::Config::sourceName |
The name is used in test names and has to be set.
Definition at line 221 of file ClientTest.h.
Referenced by TestEvolution::getSourceConfig(), ClientTest::getTestData(), ClientTestFactory::makeTest(), SyncTests::SyncTests(), and TestEvolution::TestEvolution().
const char * ClientTest::Config::templateItem |
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.
Definition at line 285 of file ClientTest.h.
Referenced by SyncTests::addTests(), LocalTests::addTests(), EvolutionLocalTests::addTests(), ClientTest::getTestData(), LocalTests::insertManyItems(), and LocalTests::testManyChanges().
const char * ClientTest::Config::testcases |
a file with test cases in the format expected by import and compare
Definition at line 420 of file ClientTest.h.
Referenced by LocalTests::addTests(), ClientTest::getTestData(), and LocalTests::testImport().
const char * ClientTest::Config::type |
the item type normally used by the source (not used by the tests themselves; client-test.cpp uses it to initialize source configs)
Definition at line 426 of file ClientTest.h.
Referenced by ClientTest::getTestData(), and TestEvolution::TestEvolution().
const char * ClientTest::Config::uniqueProperties |
This is a colon (:) separated list of properties which need to be modified in templateItem.
Definition at line 291 of file ClientTest.h.
Referenced by LocalTests::addTests(), EvolutionLocalTests::addTests(), ClientTest::getTestData(), LocalTests::insertManyItems(), and LocalTests::testManyChanges().
const char * ClientTest::Config::updateItem |
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.
Definition at line 315 of file ClientTest.h.
Referenced by SyncTests::addTests(), LocalTests::addTests(), ClientTest::getTestData(), LocalTests::testChanges(), and LocalTests::testLocalUpdate().
const char * ClientTest::Config::uri |
A default URI to be used when creating a client config.
Definition at line 226 of file ClientTest.h.
Referenced by ClientTest::getTestData(), and TestEvolution::TestEvolution().