LocalTests Class Reference
[Client]

#include <ClientTest.h>

Inheritance diagram for LocalTests:

Inheritance graph
[legend]
Collaboration diagram for LocalTests:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 LocalTests (const std::string &name, ClientTest &cl, int sourceParam, ClientTest::Config &co)
virtual void addTests ()
virtual std::string insert (CreateSource createSource, const char *data, bool relaxed=false)
virtual void update (CreateSource createSource, const char *data, bool check=true)
virtual void deleteAll (CreateSource createSource)
virtual void compareDatabases (const char *refFile, SyncSource &copy, bool raiseAssert=true)
virtual int insertManyItems (CreateSource createSource, int startIndex=1, int numItems=0, int size=-1)
virtual void testOpen ()
virtual void testIterateTwice ()
virtual void testSimpleInsert ()
virtual void testLocalDeleteAll ()
virtual void testComplexInsert ()
virtual void testLocalUpdate ()
virtual void testChanges ()
virtual void testImport ()
virtual void testImportDelete ()
virtual void testManyChanges ()
virtual void testLinkedItemsParent ()
virtual void testLinkedItemsChild ()
virtual void testLinkedItemsParentChild ()
virtual void testLinkedItemsChildParent ()
virtual void testLinkedItemsChildChangesParent ()
virtual void testLinkedItemsRemoveParentFirst ()
virtual void testLinkedItemsRemoveNormal ()
virtual void testLinkedItemsInsertParentTwice ()
virtual void testLinkedItemsInsertChildTwice ()
virtual void testLinkedItemsParentUpdate ()
virtual void testLinkedItemsUpdateChild ()
virtual void testLinkedItemsInsertBothUpdateChild ()
virtual void testLinkedItemsInsertBothUpdateParent ()
 LocalTests (const std::string &name, ClientTest &cl, int sourceParam, ClientTest::Config &co)
virtual void addTests ()
virtual std::string insert (CreateSource createSource, const char *data, bool relaxed=false)
virtual void update (CreateSource createSource, const char *data, bool check=true)
virtual void deleteAll (CreateSource createSource)
virtual void compareDatabases (const char *refFile, SyncSource &copy, bool raiseAssert=true)
virtual int insertManyItems (CreateSource createSource, int startIndex=1, int numItems=0, int size=-1)
virtual void testOpen ()
virtual void testIterateTwice ()
virtual void testSimpleInsert ()
virtual void testLocalDeleteAll ()
virtual void testComplexInsert ()
virtual void testLocalUpdate ()
virtual void testChanges ()
virtual void testImport ()
virtual void testImportDelete ()
virtual void testManyChanges ()
virtual void testLinkedItemsParent ()
virtual void testLinkedItemsChild ()
virtual void testLinkedItemsParentChild ()
virtual void testLinkedItemsChildParent ()
virtual void testLinkedItemsChildChangesParent ()
virtual void testLinkedItemsRemoveParentFirst ()
virtual void testLinkedItemsRemoveNormal ()
virtual void testLinkedItemsInsertParentTwice ()
virtual void testLinkedItemsInsertChildTwice ()
virtual void testLinkedItemsParentUpdate ()
virtual void testLinkedItemsUpdateChild ()
virtual void testLinkedItemsInsertBothUpdateChild ()
virtual void testLinkedItemsInsertBothUpdateParent ()

Public Attributes

ClientTestclient
const int source
const ClientTest::Config config
CreateSource createSourceA
CreateSource createSourceB


Detailed Description

local test of one sync source and utility functions also used by sync tests

Definition at line 550 of file ClientTest.h.


Constructor & Destructor Documentation

LocalTests::LocalTests ( const std::string &  name,
ClientTest cl,
int  sourceParam,
ClientTest::Config co 
) [inline]

Definition at line 564 of file ClientTest.h.

LocalTests::LocalTests ( const std::string &  name,
ClientTest cl,
int  sourceParam,
ClientTest::Config co 
) [inline]

Definition at line 548 of file ClientTest.h.


Member Function Documentation

virtual void LocalTests::addTests (  )  [virtual]

adds the supported tests to the instance itself; this is the function that a derived class can override to add additional tests

Reimplemented in EvolutionLocalTests.

virtual void LocalTests::compareDatabases ( const char *  refFile,
SyncSource copy,
bool  raiseAssert = true 
) [virtual]

takes two databases, exports them, then compares them using synccompare

Parameters:
refFile existing file with source reference items, NULL uses a dump of sync source A instead
copy a sync source which contains the copied items, begin/endSync will be called
raiseAssert raise assertion if comparison yields differences (defaults to true)

virtual void LocalTests::deleteAll ( CreateSource  createSource  )  [virtual]

deletes all items locally via sync source

virtual std::string LocalTests::insert ( CreateSource  createSource,
const char *  data,
bool  relaxed = false 
) [virtual]

opens source and inserts the given item; can be called regardless whether the data source already contains items or not

The type of the item is unset; it is assumed that the source can handle that.

Parameters:
relaxed if true, then disable some of the additional checks after adding the item
Returns:
the UID of the inserted item

virtual int LocalTests::insertManyItems ( CreateSource  createSource,
int  startIndex = 1,
int  numItems = 0,
int  size = -1 
) [virtual]

insert artificial items, number of them determined by TEST_EVOLUTION_NUM_ITEMS unless passed explicitly

Parameters:
createSource a factory for the sync source that is to be used
startIndex IDs are generated starting with this value
numItems number of items to be inserted if non-null, otherwise TEST_EVOLUTION_NUM_ITEMS is used
size minimum size for new items
Returns:
number of items inserted

virtual void LocalTests::testChanges (  )  [virtual]

virtual void LocalTests::testComplexInsert (  )  [virtual]

virtual void LocalTests::testImport (  )  [virtual]

virtual void LocalTests::testImportDelete (  )  [virtual]

virtual void LocalTests::testIterateTwice (  )  [virtual]

virtual void LocalTests::testLinkedItemsChild (  )  [virtual]

virtual void LocalTests::testLinkedItemsChildChangesParent (  )  [virtual]

virtual void LocalTests::testLinkedItemsChildParent (  )  [virtual]

virtual void LocalTests::testLinkedItemsInsertBothUpdateChild (  )  [virtual]

virtual void LocalTests::testLinkedItemsInsertBothUpdateParent (  )  [virtual]

virtual void LocalTests::testLinkedItemsInsertChildTwice (  )  [virtual]

virtual void LocalTests::testLinkedItemsInsertParentTwice (  )  [virtual]

virtual void LocalTests::testLinkedItemsParent (  )  [virtual]

virtual void LocalTests::testLinkedItemsParentChild (  )  [virtual]

virtual void LocalTests::testLinkedItemsParentUpdate (  )  [virtual]

virtual void LocalTests::testLinkedItemsRemoveNormal (  )  [virtual]

virtual void LocalTests::testLinkedItemsRemoveParentFirst (  )  [virtual]

virtual void LocalTests::testLinkedItemsUpdateChild (  )  [virtual]

virtual void LocalTests::testLocalDeleteAll (  )  [virtual]

virtual void LocalTests::testLocalUpdate (  )  [virtual]

virtual void LocalTests::testManyChanges (  )  [virtual]

virtual void LocalTests::testOpen (  )  [virtual]

virtual void LocalTests::testSimpleInsert (  )  [virtual]

virtual void LocalTests::update ( CreateSource  createSource,
const char *  data,
bool  check = true 
) [virtual]

assumes that exactly one element is currently inserted and updates it with the given item

The type of the item is cleared, as in insert() above.

Parameters:
check if true, then reopen the source and verify that the reported items are as expected


Member Data Documentation

the client we are testing

Definition at line 553 of file ClientTest.h.

Referenced by compareDatabases(), and testImport().

const int LocalTests::source

number of the source we are testing in that client

Definition at line 556 of file ClientTest.h.

Referenced by deleteAll(), insert(), testIterateTwice(), testOpen(), and update().


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