Test


Classes

class  CheckSyncReport
 This class encapsulates logging and checking of a SyncReport. More...
class  ClientTest
 This is the interface expected by the testing framework for sync clients. More...
class  CreateSource
 helper class to encapsulate ClientTest::Config::createsource_t pointer and the corresponding parameters More...
class  LocalTests
 local test of one sync source and utility functions also used by sync tests More...
class  SyncTests
 Tests synchronization with one or more sync sources enabled. More...

Typedefs

typedef std::list< std::string > UIDList

Enumerations

enum  itemType { NEW_ITEMS, UPDATED_ITEMS, DELETED_ITEMS, TOTAL_ITEMS }

Functions

int countItemsOfType (SyncSource *source, itemType type)
 utility function which counts items of a certain kind known to the sync source
UIDList listItemsOfType (SyncSource *source, itemType type)
 generates list of UIDs in the specified kind of items
const StringBuffer initAdapter (const char *testName)
 Initializes the PlatformAdapter for a given test.
SyncManagerConfiggetNewSyncManagerConfig (const char *testName, const bool setClientDefaults, ArrayList *defaultSources=NULL)
 Generates and returns a NEW ALLOCATED default configuration (SyncManagerConfig).
DMTClientConfiggetNewDMTClientConfig (const char *testName, const bool setClientDefaults, ArrayList *defaultSources=NULL)
 Generates and returns a NEW ALLOCATED default configuration (DMTClientConfig).
char * loadTestFile (const char *testName, const char *fileName, bool binary=false)
 Loads and returns (NEW ALLOCATED) the content of a test file.
StringBuffer getTestFileFullPath (const char *testName, const char *fileName)
 Returns the full path of a given test file (concat "testcases/testName/fileName").
StringBuffer getTestDirFullPath (const char *testName)
 Returns the full path of a given test file (concat "testcases/testName/") with the final slash at the end.

Function Documentation

int countItemsOfType ( SyncSource source,
itemType  type 
)

utility function which counts items of a certain kind known to the sync source

Parameters:
source valid source ready to iterate; NULL triggers an assert
itemType determines which iterator functions are used
Returns:
number of valid items iterated over

References listItemsOfType().

DMTClientConfig* getNewDMTClientConfig ( const char *  testName,
const bool  setClientDefaults,
ArrayList *  defaultSources = NULL 
)

Generates and returns a NEW ALLOCATED default configuration (DMTClientConfig).

Parameters:
testName the name of the test which called this method (for deviceID)
setClientDefaults if true, will set the default deviceConfig and accessConfig
defaultSources ArrayList of source names (StringBuffer), to create default SyncSourceConfig. If not specified, non is created. Default is NULL.
Returns:
the (new allocated) DMTClientConfig

References initAdapter(), and setDefaults().

SyncManagerConfig* getNewSyncManagerConfig ( const char *  testName,
const bool  setClientDefaults,
ArrayList *  defaultSources = NULL 
)

Generates and returns a NEW ALLOCATED default configuration (SyncManagerConfig).

Parameters:
testName the name of the test which called this method (for deviceID)
setClientDefaults if true, will set the default deviceConfig and accessConfig
defaultSources ArrayList of source names (StringBuffer), to create default SyncSourceConfig. If not specified, non is created. Default is NULL.
Returns:
the (new allocated) SyncManagerConfig

References initAdapter(), and setDefaults().

StringBuffer getTestDirFullPath ( const char *  testName  ) 

Returns the full path of a given test file (concat "testcases/testName/") with the final slash at the end.

Parameters:
testName the test name
Returns:
the full path of the test file

StringBuffer getTestFileFullPath ( const char *  testName,
const char *  fileName 
)

Returns the full path of a given test file (concat "testcases/testName/fileName").

Parameters:
testName the test name
fileName the file name
Returns:
the full path of the test file

Referenced by utilsTest::getFileModTimeTest(), and loadTestFile().

const StringBuffer initAdapter ( const char *  testName  ) 

Initializes the PlatformAdapter for a given test.

To avoid spamming the config folder, the root context is composed so that all the tests will work under "Funambol/client-test", then the test name.

Referenced by getNewDMTClientConfig(), getNewSyncManagerConfig(), and TestFileSource::TestFileSource().

char* loadTestFile ( const char *  testName,
const char *  fileName,
bool  binary = false 
)

Loads and returns (NEW ALLOCATED) the content of a test file.

The test files are located under the dir "testcases/<test name>".

Parameters:
testName the test name
fileName the file name
binary if true the file has to be opened in binary mode
Returns:
a new allocated buffer with the file content

References getTestFileFullPath().

Referenced by utilsTest::getFileModTimeTest().


Generated on Tue Apr 6 13:00:40 2010 for Funambol Outlook Plug-in Library by  doxygen 1.5.7.1