ClientTest::Config Struct Reference

#include <ClientTest.h>

Collaboration diagram for ClientTest::Config:

Collaboration graph
[legend]

List of all members.

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


Detailed Description

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.

Definition at line 217 of file ClientTest.h.


Member Typedef Documentation

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.

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

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


Member Data Documentation

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"

Parameters:
fileA first file name
fileB second file name
Returns:
true if the content of the files is considered equal

Referenced by SyncTests::addTests(), LocalTests::addTests(), LocalTests::compareDatabases(), TestEvolution::getSourceConfig(), ClientTest::getTestData(), and LocalTests::testImport().

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:

  • 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

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.

Parameters:
source sync source A already created and with beginSync() called
file a file name
Returns:
error code, 0 for success

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.

Parameters:
source sync source A already created and with beginSync() called
file the name of the file to import
Returns:
error code, 0 for success

Referenced by SyncTests::addTests(), LocalTests::addTests(), ClientTest::getTestData(), and LocalTests::testImport().

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().

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().

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().

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().

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().

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().

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().

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().

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().

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().

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().

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().


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

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