void TestExtHintFieldCreationL(RFs& theFS)
	{
	test.Start(_L("Ext Hint field creation"));


    serv.CopyFileL(KSrcDatabaseFileName, KDatabaseFileName);
	serv.CopyFileL(KSrcDatabaseFileName, KDatabaseSecurePhysicalName);
		
	test.Printf(_L("Checking ExtHintField before loading cntmodel\n"));
	TestTrue(!ExtHintFieldExistsL(theFS)); //The field shouldn't exist in original table

	//Contact model must open and upgrade database
	test.Printf(_L("Loading cntmodel\n"));
	CContactDatabase* theDatabase = NULL; 
	
	TestTrap(theDatabase = CContactDatabase::OpenL(KDatabaseSecureName));
	delete theDatabase;
	theDatabase = NULL;

	//Copy the file to the C drive, where it can be checked by the test code through DBMS
	serv.CopyFileL(KDatabaseSecurePhysicalName, KDatabaseFileName);

	test.Printf(_L("Checking ExtHintField after opening with cntmodel\n"));
	TestTrue(ExtHintFieldExistsL(theFS)); //Contacts model must have created the ExtHintField
	test.End();
	}
Example #2
0
void CTestConductor::CopyCdbFileL(const TDesC& aFileName, const TDesC& aToFileName)
	{
	RPIMTestServer serv;
	User::LeaveIfError(serv.Connect());
	serv.CopyFileL(aFileName, aToFileName);
	serv.Close();
	}	
void CopyOldCdbFileToCDriveL(const TDesC& aFileName)
    {
    //Will probably need more additions to sos to do this
    RPIMTestServer serv;
    User::LeaveIfError(serv.Connect());
    serv.CopyFileL(aFileName, KOldDatabaseCDriveFullPath);
    serv.Close();
    }
LOCAL_C void CopyFileL(const TDesC& aCopyFromFile, const TDesC& aCopyToFile)
	{
	RPIMTestServer serv;	
	CleanupClosePushL(serv);
	User::LeaveIfError(serv.Connect());
	serv.CopyFileL(aCopyFromFile, aCopyToFile);
	CleanupStack::PopAndDestroy(&serv);
	}
LOCAL_C void CopyFileL(const TDesC& aFile1, const TDesC& aFile2)
	{
    RPIMTestServer serv;
    User::LeaveIfError(serv.Connect());
    serv.DeleteFileL(aFile2);
    serv.CopyFileL(aFile1, aFile2);
    serv.Close();
	}
Example #6
0
//as the porting on SQLite database allows the thorough DC break and
//doesn't support the feature of database update from old database on
//Symbian DBMS.
void TestDbUpdateL()
{

    RPIMTestServer serv;
    User::LeaveIfError(serv.Connect());
    serv.CopyFileL(KSrcDatabaseName, KDatabaseName);

    serv.Close();

    // Contact model must open and upgrade database
    test.Printf(_L("Opening and upgrading database\n"));
    CContactDatabase* db = NULL;
    db = CContactDatabase::OpenL(KDatabaseOpenName);

    // Add a contact with a 15 digit phone number and match the same number
    _LIT(K15DigitTestNumber,"0086 207 3453 1212");
    _LIT(K15DigitMatch,"0086 207 3453 1212");
    CreateContactL(KCntName,KCntSurname,K15DigitTestNumber,KNullDesC);
    CheckPhoneMatchL(K15DigitMatch,KMatch15Digits,1);

    delete db;
    db = NULL;
}
/**
Second phase constructor for CDbDbmsDumper

@param  aDbName name of the database to be dumped.
@param	aOutputDir directory where html file will be generated		
*/	
void CDbDbmsDumper::ConstructL(const TDesC& aDbName, const TDesC& aOutputDir)
	{
	// Output File Name	
	_LIT(KOutputFile,"DbDump.html");
	TBuf<KMaxPathLength> path(aOutputDir);
	path.Append(KOutputFile);
	
	User::LeaveIfError(iFsSession.Connect());
	User::LeaveIfError(iDbsSession.Connect());

	// Copy the Contacts database from the contacts server private directory to 
	// the DBMS private directory
	RPIMTestServer serv;
	User::LeaveIfError(serv.Connect());
	
	_LIT(KDBContactsPrivFile, "?:\\private\\10003a73\\Contacts.cdb");
	_LIT(KDBDBMsPrivFile, "?:\\private\\100012a5\\DBS_100065FF_Contacts.cdb");
	
	TBuf<sizeof(KDBContactsPrivFile)> contactsDBPrivFilePath(KDBContactsPrivFile);
	TBuf<sizeof(KDBDBMsPrivFile)> dBMsPrivFilePath(KDBDBMsPrivFile);
	
	contactsDBPrivFilePath[0] = (TUint8) RFs::GetSystemDriveChar();
	dBMsPrivFilePath[0] = (TUint8) RFs::GetSystemDriveChar();
	
	serv.CopyFileL(contactsDBPrivFilePath, dBMsPrivFilePath);
	serv.Close();

	_LIT(KCntDbSecureFormat,"secure[100065FF]");

	// Contact databases are in DBMS private directory
	User::LeaveIfError(iDatabase.Open(iDbsSession, aDbName, KCntDbSecureFormat));
	User::LeaveIfError(iFile.Replace(iFsSession, path, EFileWrite) );

	iBuffer = HBufC8::NewL(KBufferLength);
	iTableNames = iDatabase.TableNamesL();
	}