LocalTests Class Reference
[Client Testing Framework]

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

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)
void addTests ()
 adds the supported tests to the instance itself
void insert (CreateSource createSource, const char *data)
 opens source and inserts the given item; can be called regardless whether the data source already contains items or not
void update (CreateSource createSource, const char *data)
 assumes that exactly one element is currently inserted and updates it with the given item
void deleteAll (CreateSource createSource)
 deletes all items locally via sync source
void compareDatabases (const char *refFile, SyncSource &copy, bool raiseAssert=true)
 takes two databases, exports them, then compares them using synccompare
int insertManyItems (CreateSource createSource, int startIndex=1, int numItems=0, int size=-1)
 insert artificial items, number of them determined by TEST_EVOLUTION_NUM_ITEMS unless passed explicitly
void testOpen ()
void testIterateTwice ()
void testSimpleInsert ()
void testLocalDeleteAll ()
void testComplexInsert ()
void testLocalUpdate ()
void testChanges ()
void testImport ()
void testImportDelete ()
void testManyChanges ()

Public Attributes

ClientTestclient
 the client we are testing
const int source
 number of the source we are testing in that client
const ClientTest::Config config
 configuration that corresponds to source
CreateSource createSourceA
 helper funclets to create sources
CreateSource createSourceB

Detailed Description

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


Member Function Documentation

void LocalTests::insert ( CreateSource  createSource,
const char *  data 
) [inline]

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.

void LocalTests::update ( CreateSource  createSource,
const char *  data 
) [inline]

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.

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

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)

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

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


The documentation for this class was generated from the following file:
Generated on Fri Apr 27 12:29:22 2007 for Funambol C++ Client Library by  doxygen 1.5.2