messagingfw/msgtestfw/TestActions/Sms/src/CMtfTestActionClass0SmsNotifier.cpp
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     1 // Copyright (c) 2007-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 // Class0Notifier
       
    17 // [Action Parameters]
       
    18 // [Action Description]
       
    19 // Notify the class 0 sms message
       
    20 // __ACTION_INFO_END__
       
    21 // 
       
    22 //
       
    23 
       
    24 #include "CMtfTestActionClass0SmsNotifier.h"
       
    25 #include "CMtfTestCase.h"
       
    26 #include "CMtfTestActionParameters.h"
       
    27 
       
    28 
       
    29 _LIT(KTestClas0Sms, "\\logs\\testexecute\\class0sms.txt");
       
    30 const TInt KTestStringLength = 200;
       
    31 
       
    32 CMtfTestAction* CMtfTestActionClass0SmsNotifier::NewL(CMtfTestCase& aTestCase,CMtfTestActionParameters* aActionParameters)
       
    33 	{
       
    34 	CMtfTestActionClass0SmsNotifier* self = new (ELeave) CMtfTestActionClass0SmsNotifier(aTestCase);
       
    35 	CleanupStack::PushL(self);
       
    36 	self->ConstructL(aActionParameters);
       
    37 	CleanupStack::Pop();
       
    38 	return self;
       
    39 	}
       
    40 
       
    41 
       
    42 CMtfTestActionClass0SmsNotifier::CMtfTestActionClass0SmsNotifier(CMtfTestCase& aTestCase)
       
    43 	: CMtfSynchronousTestAction(aTestCase)
       
    44 	{
       
    45 	}
       
    46 
       
    47 
       
    48 CMtfTestActionClass0SmsNotifier::~CMtfTestActionClass0SmsNotifier()
       
    49 	{
       
    50 	}
       
    51 
       
    52 
       
    53 void CMtfTestActionClass0SmsNotifier::ExecuteActionL()
       
    54 	{
       
    55 	TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionClass0SmsNotifier);
       
    56 	
       
    57 	RFs fs;
       
    58 	User::LeaveIfError(fs.Connect());
       
    59 	CleanupClosePushL(fs);
       
    60 	
       
    61 	
       
    62 	RFile file;
       
    63 	file.Open(fs, KTestClas0Sms, EFileRead);
       
    64 		
       
    65 	TBuf8 <KTestStringLength> smsData;
       
    66 	file.Read(smsData); 
       
    67 		
       
    68 	fs.Close();
       
    69 	
       
    70 	CleanupStack::PopAndDestroy(&fs);
       
    71 	
       
    72 	TestCase().INFO_PRINTF2(_L("Test Action %S Passed..."), &KTestActionClass0SmsNotifier);	
       
    73 	TestCase().ActionCompletedL(*this);
       
    74 	}
       
    75 	
       
    76 
       
    77 
       
    78