diff -r 000000000000 -r 8e480a14352b messagingfw/msgtestfw/TestActions/Email/Pop3/src/CMtfTestActionCreateExpPop3MailInfo.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/messagingfw/msgtestfw/TestActions/Email/Pop3/src/CMtfTestActionCreateExpPop3MailInfo.cpp Mon Jan 18 20:36:02 2010 +0200 @@ -0,0 +1,112 @@ +// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// __ACTION_INFO_BEGIN__ +// [Action Name] +// CreateExpPop3MailInfo +// [Action Parameters] +// Body Text Lines : Number of lines of body text to expect +// Footer present : whether to expect a footer message +// HTML lines : Number of lines of html to expect +// Description : Subject line of the email this will be used to check +// Attachments : Number of attachments to expect +// ExpPop3MailInto : Reference to the created CExpMailInfo object +// Footer size : Size of the amount left on the server that should be in the footer message +// [Action Description] +// Creates a object representing the expect results of a donwloaded email +// inlcuding the number of body text lines, number of html lines, number +// of attachments, presence or not of a partial download footer, and optionally +// the size mentioned in the partial download footer. +// This can be passed to the VerifyEmail test action which compares these +// objects with email messages in the mail store +// [APIs Used] +// None +// __ACTION_INFO_END__ +// +// + +/** + @file +*/ + + + + +#include +#include + +#include "CMtfTestActionCreateExpPop3MailInfo.h" +#include "CMtfTestCase.h" +#include "CMtfTestActionParameters.h" +#include "CExpMailInfo.h" + + +CMtfTestAction* CMtfTestActionCreateExpPop3MailInfo::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters) + { + CMtfTestActionCreateExpPop3MailInfo* self = new (ELeave) CMtfTestActionCreateExpPop3MailInfo(aTestCase); + CleanupStack::PushL(self); + self->ConstructL(aActionParameters); + CleanupStack::Pop(); + return self; + } + + +CMtfTestActionCreateExpPop3MailInfo::CMtfTestActionCreateExpPop3MailInfo(CMtfTestCase& aTestCase) + : CMtfSynchronousTestAction(aTestCase) + { + } + + +CMtfTestActionCreateExpPop3MailInfo::~CMtfTestActionCreateExpPop3MailInfo() + { + } + +void CMtfTestActionCreateExpPop3MailInfo::ExecuteActionL() + { + TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionCreateExpPop3MailInfo); + CExpPop3MailInfo* expMailInfo = new (ELeave) CExpPop3MailInfo; + CleanupStack::PushL( expMailInfo ); + expMailInfo->SetNumLinesBodyText( ObtainValueParameterL(TestCase(),ActionParameters().Parameter(0)) ); + expMailInfo->SetFooterExpected( ObtainValueParameterL(TestCase(),ActionParameters().Parameter(1)) ); + expMailInfo->SetNumLinesHtml( ObtainValueParameterL(TestCase(),ActionParameters().Parameter(2)) ); + + HBufC* paramDescription = ObtainParameterReferenceL(TestCase(), ActionParameters().Parameter(3)); + TPtr p = paramDescription->Des(); + expMailInfo->SetDescription( p ); + + TInt paramNAttachmentsExp = ObtainValueParameterL(TestCase(),ActionParameters().Parameter(4)); + expMailInfo->SetNumAttachments( paramNAttachmentsExp ); + + + if(ActionParameters().Count()==7) + { + expMailInfo->SetFooterSize( ObtainValueParameterL(TestCase(),ActionParameters().Parameter(6)) ); + } + else + { + expMailInfo->SetFooterSize( 0 ); + } + + StoreParameterL( TestCase(), *expMailInfo, ActionParameters().Parameter( 5 )); + + CleanupStack::Pop(1); // expMailInfo + TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionCreateExpPop3MailInfo); + TestCase().ActionCompletedL(*this); + } + + + + + + +