Esempio n. 1
0
/**
@SYMPREQ 1375
@SYMTestType UT
@SYMTestPriority Critical
@SYMTestCaseDesc Tests export of the Mandatory properties,populated and empty(N,FN
@SYMTestCaseDesc and TEL).Export of TEL is required by PBAP but client has to specify it explictly.

@SYMTestActions
1.Contact item having all populated supported fields present in database.
2.Export contact as vCard2.1 when filter has not included any of the mandatory properties.
3.Export contact as vCard3.0 when filter has not included any of the mandatory properties.
4.Import vCard which is not having any mandatory properties.
5.Export contact as vCard3.0 when filter has not included any of the mandatory properties.
6.Export contact as vCard2.1 when filter has not included any of the mandatory properties.
7.Export contact when export of TEL has been disabled by providing EFalse to aExportTEL.
8.Compare exported file with expected output.

@SYMTestExpectedResults 
1.Mandatory properties N,TEL should be exported.
2.Mandatory properties N,FN,TEL should be exported..
3.Contact created without mandatory properties.
4.Empty mandatory properties should be exported.
5.Empty mandatory properties should be exported.
6.All mandatory properties except TEL should be exported.
7.Comparison of expected vCard should pass.
8.No leaves or panics should occur

*/
void CCntPBAPSupport::TestMandatoryAndTELPropertiesL()
	{
	SetIntraExport(EFalse);
	//filter needs to be non-Zero,This field is not present, so only mandatory ones shall be exported
	TInt64 filter = EPropertySORTSTRING;
	ExportContactsL(filter,EPBAPVCard21,ETrue);
	CompareExportsL(KMandatoryPopulatedProperties21());
	test.Printf(_L("Expected export of populated mandatory properties for vCard2.1 verified\n"));
	/*
	RDesReadStream compareStream(KMandatoryPopulatedProperties21());
	CleanupClosePushL(compareStream);
	CompareFilesL(compareStream);
	CleanupStack::PopAndDestroy(&compareStream);
	*/
	//Test vCard3.0
	ExportContactsL(filter,EPBAPVCard30,ETrue);
	CompareExportsL(KMandatoryPopulatedProperties30());
	test.Printf(_L("Expected export of populated mandatory properties for vCard3.0 verified\n"));
	/*
	RDesReadStream compareStream2(KMandatoryPopulatedProperties30());
	CleanupClosePushL(compareStream2);
	CompareFilesL(compareStream2);
	test.Printf(_L("Expected export of populated mandatory properties for vCard3.0 verified\n"));
	CleanupStack::PopAndDestroy(&compareStream2);
	*/
	//Empty fields
	ImportContactsL(KvCardWithoutMandatoryProperties());
	ExportContactsL(filter,EPBAPVCard21,ETrue);
	CompareExportsL(KEmptyMandatoryProperties21());
	test.Printf(_L("Expected export of Empty mandatory properties for vCard2.1 verified\n"));
	/*
	RDesReadStream compareStream3(KEmptyMandatoryProperties21());
	CleanupClosePushL(compareStream3);
	CompareFilesL(compareStream3);
	test.Printf(_L("Expected export of Empty mandatory properties for vCard2.1 verified\n"));
	CleanupStack::PopAndDestroy(&compareStream3);
	*/
	//Test vCard3.0
	ExportContactsL(filter,EPBAPVCard30,ETrue);
	CompareExportsL(KEmptyMandatoryProperties30());
	test.Printf(_L("Expected export of Empty mandatory properties for vCard3.0 verified\n"));
	/*
	RDesReadStream compareStream4(KEmptyMandatoryProperties30());
	CleanupClosePushL(compareStream4);
	CompareFilesL(compareStream4);
	test.Printf(_L("Expected export of Empty mandatory properties for vCard3.0 verified\n"));
	CleanupStack::PopAndDestroy(&compareStream4);
	*/
	//Test for export of TEL property
	ExportContactsL(filter,EPBAPVCard30,EFalse);
	CompareExportsL(KTELPropertyDisabled30());
	test.Printf(_L("Disabling of TEL export verified\n"));
	/*
	RDesReadStream compareStream5(KTELPropertyDisabled30());
	CleanupClosePushL(compareStream5);
	CompareFilesL(compareStream5);
	test.Printf(_L("Disabling of TEL export verified\n"));
	CleanupStack::PopAndDestroy(&compareStream5);
	*/
	}
Esempio n. 2
0
/**
@SYMPREQ 1375
@SYMTestType UT
@SYMTestPriority Critical
@SYMTestCaseDesc Tests if properties mentioned in filter are exported.

@SYMTestActions
1.Import vCard to create contact with populated fields.
2.Create 3 filters, each one enabling export of few fields.
3.Enable export of TEL for last two test.
4.Export contact and compare the expected output.

@SYMTestExpectedResults For the above tests:
1.Resulting vCards should contain only mandatory + populated properties present in the filter.
2.Comparison of expected vCard should pass.
3.No leaves or panics should occur
*/
void CCntPBAPSupport::TestFilterL()
	{
	SetIntraExport(EFalse);
	ImportContactsL(KAllSupportedFields());
	//Try with three filters, each enable export of few fields.	
	//Filter1, export LABEL,TITLE,NOTE,ADR apart from mandatory + TEL
	TInt64 filter = EPropertyLABEL;
	filter |= EPropertyTITLE;
	filter |= EPropertyNOTE;
	filter |= EPropertyADR;
	ExportContactsL(filter, EPBAPVCard30, ETrue);
	CompareExportsL(KExpected1FilteredProp30());
	test.Printf(_L("First Filter for vCard3.0 verified\n"));
	/*
 	RDesReadStream compareStream(KExpected1FilteredProp30());
	CleanupClosePushL(compareStream);
	CompareFilesL(compareStream);
	test.Printf(_L("First Filter for vCard3.0 verified\n"));
	CleanupStack::PopAndDestroy(&compareStream);
	*/
	//Filter2, export EMAIL,ORG,ROLE,URL + mandatory and no TEL.
	filter = 0;
	filter |= EPropertyROLE;
	filter |= EPropertyEMAIL;
	filter |= EPropertyORG;
	filter |= EPropertyURL;
	ExportContactsL(filter, EPBAPVCard30, EFalse);
	CompareExportsL(KExpected2FilteredProp30());
	test.Printf(_L("Second Filter for vCard3.0 without TEL verified\n"));
	/*
 	RDesReadStream compareStream2(KExpected2FilteredProp30());
	CleanupClosePushL(compareStream2);
	CompareFilesL(compareStream2);
	test.Printf(_L("Second Filter for vCard3.0 without TEL verified\n"));
	CleanupStack::PopAndDestroy(&compareStream2);
	*/
	//Filter3, export PHOTO,LOGO,BDAY,MAILER,SOUND,KEY + mandatory and no TEL to 2.1
	filter = 0;
	filter |= EPropertyPHOTO;
	filter |= EPropertyLOGO;
	filter |= EPropertyBDAY;
	filter |= EPropertyMAILER;
	filter |= EPropertySOUND;
	filter |= EPropertyKEY;
	ExportContactsL(filter, EPBAPVCard21, EFalse);
	CompareExportsL(KExpected3FilteredProp21());
	test.Printf(_L("Third Filter on vCard2.1 without TEL verified\n"));
	/*
 	RDesReadStream compareStream3(KExpected3FilteredProp21());
	CleanupClosePushL(compareStream3);
	CompareFilesL(compareStream3);
	test.Printf(_L("Third Filter on vCard2.1 without TEL verified\n"));
	CleanupStack::PopAndDestroy(&compareStream3);
	*/
	}
Esempio n. 3
0
/**
@SYMTestCaseID PIM-AGENT-0005
@SYMDEF PDEF102693
@SYMTestType UT
@SYMTestPriority High
@SYMTestCaseDesc Multiple agents must be Exported properly.

@SYMTestActions
1.Create contact item with multiple agents.
2.Export contact items..
3.Import  contact items.
4.Check the agents.

@SYMTestExpectedResults For the above tests:
1. agents should be exported properly.
*/	
void CAgentTest::MultipleAgentExportL()
{
	CTestRegister* TempFiles = CTestRegister::NewLC();
	TempFiles->RegisterL(KAgentExported);

	iDb = iTest.CreateDatabaseL();
	ImportContactsFromDescriptorL(KMultipleAgentvCard());
	_LIT(KAgent1FirstName,"Oracle");
	_LIT(KAgent2FirstName,"Architect");

	//remove the other contact item as the imported vacrd contains two contact items.
	iIdArray->Remove(0);
	iIdArray->Remove(0);
	iIdArray->Remove(0);
	iIdArray->Remove(0);
	
	ExportContactsL(KAgentExported);

	//clean the database 
	iDb = iTest.CreateDatabaseL();
	//import contacts from the exported file.	
	ImportContactsL(KAgentExported);
	//check  the first names of the 
	CContactItem* mainItem = iDb->ReadContactLC((*iIdArray)[0]);
	test(FieldText(*mainItem, KUidContactFieldFamilyName) == KAgent1FirstName);


	mainItem = iDb->ReadContactLC((*iIdArray)[1]);
	test(FieldText(*mainItem, KUidContactFieldFamilyName) == KAgent2FirstName);
	CleanupStack::PopAndDestroy(3);

}
TVerdict CTestContactsPBAPExport::doTestStepL()
/**
 * @return - TVerdict code
 * Override of base class pure virtual
 */
	{
	ExportContactsL();
	return TestStepResult();
	}
Esempio n. 5
0
/**
@SYMTestCaseID PIM-AGENT-0002 
@SYMDEF DEF098709
@SYMTestType UT
@SYMTestPriority High
@SYMTestCaseDesc Check if Agent cards are merged with main contacts in database.

@SYMTestActions
1.Create contact items and add contact agents to them.
2.Export Main contact items.
3.Change properties of Agent contact items in database.
4.Import the exported vCard.

@SYMTestExpectedResults For the above tests:
1.vCard being imported should properly update the existing contact/Agent items
2.Updated contacts should be restored with old values.
3.No leaves or panics should occur
*/	
void CAgentTest::ImportAgentForMergeL()
	{
	iDb = iTest.CreateDatabaseL();
	//Adding 4 contacts (A,B,C,D)to database
	AddContactItemsL(4);
	//Make A an agent of B 
	MakeAgentL((*iIdArray)[1], (*iIdArray)[0]);

	//make C an Agent of D
	MakeAgentL((*iIdArray)[3], (*iIdArray)[2]);
	
	//storing Id's of agents A and C and removing them from array of Ids to be exported.
	TContactItemId idAgentA = (*iIdArray)[0];
	iIdArray->Remove(0);
	TContactItemId idAgentC = (*iIdArray)[1];
	iIdArray->Remove(1);

	//export Maincontacts B & D.
	ExportContactsL(KAgentTemp);
	
	_LIT(Kfn,"NewName");
	CContactItem* agentItem = NULL;

	//change familyname property of Agent contact A
	TBuf<20> agentAText;
	agentItem = iDb->OpenContactL(idAgentA);
	CleanupStack::PushL(agentItem);
	//storing name to cross check after import
	agentAText.Append(FieldText(*agentItem, KUidContactFieldFamilyName));
	TUid aid = {0};
	SetNameL(*agentItem, KUidContactFieldFamilyName, aid, Kfn, 0);
	iDb->CommitContactL(*agentItem);
	CleanupStack::PopAndDestroy();
	
	//change familyname property of Agent contact C
	TBuf<20> agentCText;
	agentItem = iDb->OpenContactL(idAgentC);
	CleanupStack::PushL(agentItem);
	//storing name to cross check after import
	agentCText.Append(FieldText(*agentItem, KUidContactFieldFamilyName));
	SetNameL(*agentItem, KUidContactFieldFamilyName, aid, Kfn, 0);
	iDb->CommitContactL(*agentItem);
	CleanupStack::PopAndDestroy();

	//All four contacts exist in database, 2 main and 2 agents so iIdArray will have only 2 Ids.
	ImportContactsL(KAgentTemp);
	
	//now check that names should have been restored to what it was before export
	agentItem = iDb->ReadContactLC(idAgentA);
	test(FieldText(*agentItem, KUidContactFieldFamilyName) == agentAText);
	CleanupStack::PopAndDestroy();

	agentItem = iDb->ReadContactLC(idAgentC);
	test(FieldText(*agentItem, KUidContactFieldFamilyName) == agentCText);
	CleanupStack::PopAndDestroy();	
	}
Esempio n. 6
0
/**
@SYMPREQ 1375
@SYMTestType UT
@SYMTestPriority Critical
@SYMTestCaseDesc Export all supported fields mentioned in PBAP spec.

@SYMTestActions
1.Import contact item having all supported fields
2.Export contact as vCard2.1, include TEL export, no addition of Intra-Contact properties
3.Export contact as vCard30, include TEL export, no addition of Intra-Contact properties
4.Compare exported file with expected output.

@SYMTestExpectedResults For the above tests:
1.Only supported fields should be exported.
2.Export of CLASS,NICKNAME,CATEGORIES,PRODID,SORT-STRING,AGENT is not supported.
4.Comparison of expected vCard should pass.
5.No leaves or panics should occur

*/
void CCntPBAPSupport::TestExportOfAllSupportedFieldsL()
	{
	ImportContactsL(KAllSupportedFields());
	SetIntraExport(EFalse);
	TInt64 filter = 0; //All supported fields should be exported
	//Test for vCard2.1
	ExportContactsL(filter,EPBAPVCard21,ETrue);
	//RDesReadStream compareStream(KAllExpectedExport21());
	//CleanupClosePushL(compareStream);
	//CompareFilesL(compareStream);
	CompareExportsL(KAllExpectedExport21());
	test.Printf(_L("Expected export of PBAP supported fields for vCard2.1 verified\n"));
	//CleanupStack::PopAndDestroy(&compareStream);
	//Test for vCard3.0
	ExportContactsL(filter,EPBAPVCard30,ETrue);
	CompareExportsL(KAllExpectedExport30());
	//RDesReadStream compareStream2(KAllExpectedExport30());
	//CleanupClosePushL(compareStream2);
	//CompareFilesL(compareStream2);
	test.Printf(_L("Expected export of PBAP supported fields for vCard3.0 verified\n"));
	//CleanupStack::PopAndDestroy(&compareStream2);
	}
Esempio n. 7
0
/**
@SYMPREQ 1375
@SYMTestType UT
@SYMTestPriority Critical
@SYMTestCaseDesc Tests if standard vCard2.1 support has been provided or not.

@SYMTestActions
1.Import vCard to create contact with populated fields.
2.Provide EVCard21 as format of export.
3.Export contact and compare the expected output.

@SYMTestExpectedResults For the above tests:
1.Resulting vCards should contain all populated properties supported by standard vCard2.1 export.
2.Comparison of expected vCard should pass.
3.No leaves or panics should occur
*/
void CCntPBAPSupport::TestVCard21SupportL()
	{
	ImportContactsL(KAllSupportedFields());
	TInt64 filter = 0;
	ExportContactsL(filter, EVCard21, ETrue);
	CompareExportsL(KExpectedStandard21vCard());
	test.Printf(_L("Expected export of standard vCard2.1 verified\n"));
	/*
	RDesReadStream compareStream(KExpectedStandard21vCard());
	CleanupClosePushL(compareStream);
	CompareFilesL(compareStream);
	test.Printf(_L("Expected export of standard vCard2.1 verified\n"));
	CleanupStack::PopAndDestroy(&compareStream);
	*/
	}
Esempio n. 8
0
/**
@SYMPREQ 1375
@SYMTestType UT
@SYMTestPriority Critical
@SYMTestCaseDesc Export contact item having unnamed parameters as vCard following vCard3.0 specification,
all such parameters should be prefixed with "TYPE=".

@SYMTestActions
1.Import contact item having fields with unnamed parameter values.
2.Create an empty filter.
3.Export contact as vCard30,export of TEL enabled.
4.Compare exported file with expected output.

@SYMTestExpectedResults For the above tests:
1.All supported and populated fields will be exported if empty filter is provided.
2.All unnamed parameters should be prefixed with "TYPE=".
4.Comparison of expected vCard should pass.
5.No leaves or panics should occur
*/
void CCntPBAPSupport::TestTypePrefixingL()
	{
	SetIntraExport(EFalse);
	ImportContactsL(KTestTypePrefix());
	TInt64 filter = 0;
	ExportContactsL(filter, EPBAPVCard30,ETrue);
	CompareExportsL(KExpectedTypePrefix30());
	test.Printf(_L("Type= prefix for vCard3.0 verified\n"));
	/*
	RDesReadStream compareStream(KExpectedTypePrefix30());
	CleanupClosePushL(compareStream);
	CompareFilesL(compareStream);
	test.Printf(_L("Type= prefix for vCard3.0 verified\n"));
	CleanupStack::PopAndDestroy(&compareStream);
	*/
	}
Esempio n. 9
0
void CAgentTest::AgentExportL()	
	{  
     test.Next(_L("First it Imports the contacts from the vcard"));

    
    ImportContactsL(KMyfile);
    
    test.Next(_L("It Exports the main contact which conatains the agent contact"));

    
    ExportContactsL(KAgentTemp);
    
    test.Next(_L("It compares the exported conatcts with expected vcf file"));

 	 		   
    CompareFilesL(KAgentTemp,KAgentexpected);
 
	}
Esempio n. 10
0
/**
@SYMPREQ 1375
@SYMTestType UT
@SYMTestPriority Critical
@SYMTestCaseDesc Test the functionality of adding intra-contact property by callback function.
This function is called by PBAP export Plug-in during export.

@SYMTestActions
1.Import contact item having all supported fields
2.Prepare filter to enable export of required populated contact fields.
3.Export contact as vCard30 and compare with expected vcard,include TEL export.
4.Add one Intra-contact property when callback function is called.
5.Compare exported file with expected output.

@SYMTestExpectedResults For the above tests:
1.Export should contain mandatory properties + TEL and properties mentioned in filter.
2.Exported vCard should contain Intra-Contact property provided by callback function.
3.Comparison of expected vCard should pass.
4.No leaves or panics should occur
*/
void CCntPBAPSupport::TestIntraContactPropertiesL()
	{
	SetIntraExport(ETrue);
	ImportContactsL(KAllSupportedFields());
	TInt64 filter = EPropertyLABEL;
	filter |= EPropertyTITLE;
	filter |= EPropertyNOTE;
	ExportContactsL(filter, EPBAPVCard30,ETrue);
	CompareExportsL(KIntraContactExport());
	test.Printf(_L("Expected export of IntraContact Property verified\n"));
	/*
	RDesReadStream compareStream(KIntraContactExport());
	CleanupClosePushL(compareStream);
	CompareFilesL(compareStream);
	test.Printf(_L("Expected export of IntraContact Property verified\n"));
	CleanupStack::PopAndDestroy(&compareStream);
	*/
	}
Esempio n. 11
0
/**
@SYMTestCaseID PIM-AGENT-0004
@SYMDEF DEF102255
@SYMTestType UT
@SYMTestPriority High
@SYMTestCaseDesc MainItems should be exported even if Agents are deleted.

@SYMTestActions
1.Create contact items and add contact agents to them.
2.Delete agent contacts.
3.Export Main contact items.

@SYMTestExpectedResults For the above tests:
1.Contact items and agents should be created.
2.Agent deletion should be successful.
3.Main contact items without agents should be exported.
4.No leaves or panics should occur.
*/	
void CAgentTest::ExportWithDeletedAgentL()
{
	iDb = iTest.CreateDatabaseL();
	//Adding 4 contacts (A,B,C,D)to database
	AddContactItemsL(4);
	
	//Make A an agent of B 
	MakeAgentL((*iIdArray)[1], (*iIdArray)[0]);
	
	//Make C an Agent of D
	MakeAgentL((*iIdArray)[3], (*iIdArray)[2]);
	
	//Delete agents A & C
	iDb->DeleteContactL((*iIdArray)[0]);
	iDb->DeleteContactL((*iIdArray)[2]);
	
	//Removing Id's of agents A & C from array of Ids to be exported
	iIdArray->Remove(0);
	iIdArray->Remove(1);	
	
	//Export main contacts B & D
	ExportContactsL(KAgentTemp);
}
Esempio n. 12
0
void CAgentTest::ImportAgentMiscL()
	{
	iDb = iTest.CreateDatabaseL();
	iIdArray->Reset();
	
	//Adding 4 contacts (A,B,C,D)to database
	AddContactItemsL(4);
	//Make A an agent of B 
	MakeAgentL((*iIdArray)[1], (*iIdArray)[0]);
	//make C an Agent of D
	MakeAgentL((*iIdArray)[3], (*iIdArray)[2]);

	//storing Id's of agents A and C and removing them from array of Ids to be exported.
	TContactItemId idAgentA = (*iIdArray)[0];
	iIdArray->Remove(0);
	TContactItemId idAgentC = (*iIdArray)[1];
	iIdArray->Remove(1);

	//export Maincontacts B & D.
	ExportContactsL(KAgentTemp);

	//remove Agent fields from main contact items B and D.
	RemoveFieldFromContactL((*iIdArray)[0], KUidContactFieldVCardMapAGENT);
	test(GetAgentCountL((*iIdArray)[0]) == 0);
	
	RemoveFieldFromContactL((*iIdArray)[1], KUidContactFieldVCardMapAGENT);	
	test(GetAgentCountL((*iIdArray)[1]) == 0);

	//All four contacts exist in database,Merge will be done for all of them.
	//2 main and 2 agents so iIdArray will have only 2 Ids.
	//and main contacts should have Agent fields.
	ImportContactsL(KAgentTemp);
	
	test(GetAgentCountL((*iIdArray)[0]) == 1);	
	test(GetAgentCountL((*iIdArray)[1]) == 1);	
			
	}