messagingfw/msgtestfw/TestActions/Base/src/CMtfTestActionGetEntry.cpp
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // __ACTION_INFO_BEGIN__ 
       
    15 // [Action Name]
       
    16 // GetEntry
       
    17 // [Action Parameters]
       
    18 // Session			<input>: Reference to the session.
       
    19 // MsgId			<input>: Value of the message Id.
       
    20 // Entry			<output>: Value of the created entry.
       
    21 // [Action Description]
       
    22 // Provides the entry for message.
       
    23 // [APIs Used]
       
    24 // CMsvSession::GetEntryL
       
    25 // __ACTION_INFO_END__
       
    26 // 
       
    27 //
       
    28 
       
    29 
       
    30 #include "CMtfTestActionGetEntry.h"
       
    31 #include "CMtfTestCase.h"
       
    32 #include "CMtfTestActionParameters.h"
       
    33 #include "MtfTestActionUtilsUser.h"
       
    34 
       
    35 #include <miutset.h>
       
    36 
       
    37 CMtfTestAction* CMtfTestActionGetEntry::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    38 	{
       
    39 	CMtfTestActionGetEntry* self = new(ELeave) CMtfTestActionGetEntry(aTestCase);
       
    40 	CleanupStack::PushL(self);
       
    41 	self->ConstructL(aActionParameters);
       
    42 	CleanupStack::Pop();
       
    43 	return self;
       
    44 	}
       
    45 	
       
    46 
       
    47 CMtfTestActionGetEntry::CMtfTestActionGetEntry(CMtfTestCase& aTestCase)
       
    48 	: CMtfSynchronousTestAction(aTestCase)
       
    49 	{
       
    50 	}
       
    51 
       
    52 
       
    53 CMtfTestActionGetEntry::~CMtfTestActionGetEntry()
       
    54 	{
       
    55 	}
       
    56 
       
    57 void CMtfTestActionGetEntry::ExecuteActionL()
       
    58 	{
       
    59 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionAddGetEntry);
       
    60 	if(TestCase().TestStepResult() == EPass)
       
    61 		{
       
    62 		CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
       
    63 		TMsvId messageEntry = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
       
    64 		
       
    65 		CMsvEntry* entry = paramSession->GetEntryL(messageEntry);
       
    66 		CleanupStack::PushL(entry);
       
    67 
       
    68 		entry->SetEntryL(messageEntry);
       
    69 		
       
    70 		StoreParameterL<CMsvEntry>(TestCase(),*entry,ActionParameters().Parameter(2));
       
    71 		CleanupStack::Pop(entry);
       
    72 
       
    73 		TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionAddGetEntry);
       
    74 		}
       
    75 	TestCase().ActionCompletedL(*this);
       
    76 	}
       
    77 
       
    78 
       
    79