messagingfw/msgtestfw/TestCases/NonScriptedTestCases/src/CMtfTestCaseCreateSendReceiveMms.cpp
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     1 // Copyright (c) 2003-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #include "CMtfTestCaseCreateSendReceiveMms.h"
       
    21 #include "CMtfTestActionParameters.h"
       
    22 
       
    23 #include "CMtfTestActionGetBaseConstants.h"
       
    24 #include "CMtfTestActionCreateSession.h"
       
    25 #include "CMtfTestActionResetMessageStore.h"
       
    26 #include "CMtfTestActionCreateRegistry.h"
       
    27 #include "CMtfTestActionCopyEntry.h"
       
    28 #include "CMtfTestActionFindEntryByName.h"
       
    29 #include "CMtfTestActionDeleteChildren.h"
       
    30 #include "CMtfTestActionCheckChildrenCount.h"
       
    31 #include "CMtfTestActionCreateChildrenSelection.h"
       
    32 #include "CMtfTestActionCopySelection.h"
       
    33 
       
    34 #include "CMtfTestActionInitNtRas.h"
       
    35 #include "CMtftestActionSleep.h"
       
    36 
       
    37 #include "CMtfTestActionCreateMmsService.h"
       
    38 #include "CMtfTestActionCreateMmsMtm.h"
       
    39 #include "CMtfTestActionSetMmsServiceParameters.h"
       
    40 #include "CMtfTestActionCreateMmsMessageFromSmilFile.h"
       
    41 
       
    42 _LIT(KSession,"session");
       
    43 
       
    44 _LIT(KInboxFolderId,	"inboxFolderId");
       
    45 _LIT(KOutboxFolderId,	"outboxFolderId");
       
    46 _LIT(KDraftsFolderId,	"draftsFolderId");
       
    47 _LIT(KSentFolderId,		"sentFolderId");
       
    48 _LIT(KDeletedFolderId,	"deletedFolderId");
       
    49 
       
    50 _LIT(KClientMtmRegistry,"clientMtmRegistry");
       
    51 
       
    52 _LIT(KMmsMtm,	 			"MmsMtm");
       
    53 _LIT(KMmsServiceId,			"MmsServiceId");
       
    54 _LIT(KMmsMessageId,			"MmsMessageId");
       
    55 _LIT(KMmsDetails,			"\"MmsService\"");
       
    56 
       
    57 _LIT(KZero,		"0");
       
    58 
       
    59 
       
    60 CMtfTestCase* CMtfTestCaseCreateSendReceiveMms::NewL(const CMtfTestServer& aTestServer)
       
    61 	{
       
    62 	CMtfTestCaseCreateSendReceiveMms* self = new (ELeave) CMtfTestCaseCreateSendReceiveMms(aTestServer);
       
    63 	CleanupStack::PushL(self);
       
    64 	self->ConstructL();
       
    65 	CleanupStack::Pop();
       
    66 	return self;
       
    67 	}
       
    68 
       
    69 
       
    70 CMtfTestCaseCreateSendReceiveMms::CMtfTestCaseCreateSendReceiveMms(const CMtfTestServer& aTestServer)
       
    71 	: CMtfTestCase(aTestServer,EFalse,ETrue)
       
    72 	{
       
    73 	}
       
    74 
       
    75 
       
    76 void CMtfTestCaseCreateSendReceiveMms::ConstructL()
       
    77 	{
       
    78 	CMtfTestCase::ConstructL();
       
    79 	}
       
    80 
       
    81 
       
    82 void CMtfTestCaseCreateSendReceiveMms::SetupTestCaseL()
       
    83 	{
       
    84 	// Get constants and enums.
       
    85 	CMtfTestActionGetBaseConstants::NewL(*this,CMtfTestActionParameters::NewL(KInboxFolderId,KOutboxFolderId,KDraftsFolderId,KSentFolderId,KDeletedFolderId));
       
    86 
       
    87 	// Init NTRAS.
       
    88 	CMtfTestActionInitNtRas::NewL(*this,CMtfTestActionParameters::NewL());
       
    89 
       
    90 	// Create the session and reset the message store.
       
    91 	CMtfTestActionCreateSession::NewL(*this,CMtfTestActionParameters::NewL(KSession));
       
    92 	CMtfTestActionResetMessageStore::NewL(*this,CMtfTestActionParameters::NewL(KSession));
       
    93 
       
    94 	// Create the MMS service
       
    95 	CMtfTestActionCreateMmsService::NewL(*this,CMtfTestActionParameters::NewL(KSession,_,_,_,_,KMmsDetails,KMmsServiceId));
       
    96 
       
    97 	// Create MMS client MTM.
       
    98 	CMtfTestActionCreateRegistry::NewL(*this,CMtfTestActionParameters::NewL(KSession,KClientMtmRegistry));
       
    99 	CMtfTestActionCreateMmsMtm::NewL(*this,CMtfTestActionParameters::NewL(KSession,KMmsServiceId,KClientMtmRegistry,KMmsMtm));
       
   100 
       
   101 	// Set MMS service parameters.
       
   102 	CMtfTestActionSetMmsServiceParameters::NewL(*this,CMtfTestActionParameters::NewL(KSession,KMmsServiceId,_));
       
   103 
       
   104 	// Get Mms server Inbox id, delete all entries and verify that it has no entries.
       
   105 	CMtfTestActionDeleteChildren::NewL(*this,CMtfTestActionParameters::NewL(KSession,KMmsServiceId));
       
   106 	CMtfTestActionCheckChildrenCount::NewL(*this,CMtfTestActionParameters::NewL(KSession,KMmsServiceId,KZero));
       
   107 	}
       
   108 
       
   109 
       
   110 void CMtfTestCaseCreateSendReceiveMms::ExecuteTestCaseL()
       
   111 	{
       
   112 	// Create the message and send.
       
   113 	CMtfTestActionCreateMmsMessageFromSmilFile::NewL(*this,CMtfTestActionParameters::NewL(KSession,KMmsServiceId,KOutboxFolderId,_,_,KMmsMessageId));
       
   114 	CMtfTestActionCopyEntry::NewL(*this,CMtfTestActionParameters::NewL(KSession,KMmsMessageId,KMmsServiceId));
       
   115 
       
   116 	// Wait till message arrives back.
       
   117 //	CMtfTestActionSleep::NewL(*this,CMtfTestActionParameters::NewL(KSixty));
       
   118 
       
   119 	// Copy Mms service entries to local Inbox.
       
   120 //	CMtfTestActionCreateChildrenSelection::NewL(*this,CMtfTestActionParameters::NewL(KSession,KMmsServiceId,KSelection));
       
   121 //	CMtfTestActionCopySelection::NewL(*this,CMtfTestActionParameters::NewL(KSession,KSelection,KInboxFolderId));
       
   122 	}
       
   123 
       
   124 
       
   125 void CMtfTestCaseCreateSendReceiveMms::CheckPostConditionsL()
       
   126 	{
       
   127 	// Check if MMS service has 1 entry.
       
   128 //	CMtfTestActionCheckChildrenCount::NewL(*this,CMtfTestActionParameters::NewL(KSession,KMmsServiceId,KOne));
       
   129 
       
   130 	// Check if MMS service entry is the one we have sent.
       
   131 //	CMtfTestActionFindEntryByName::NewL(*this,CMtfTestActionParameters::NewL(KSession,KMmsServiceId,KMmsMessageDescription,KMmsMessageId));
       
   132 // COMPARE CONTENT OF THE MESSAGE
       
   133 
       
   134 	// Check if local Inbox has 1 entry.
       
   135 //	CMtfTestActionCheckChildrenCount::NewL(*this,CMtfTestActionParameters::NewL(KSession,KInboxFolderId,KOne));
       
   136 
       
   137 	// Check if local Inbox entry is the one we have sent.
       
   138 //	CMtfTestActionFindEntryByName::NewL(*this,CMtfTestActionParameters::NewL(KSession,KInboxFolderId,KMmsMessageDescription,KInboxMessageId));
       
   139 // COMPARE CONTENT OF THE MESSAGE
       
   140 
       
   141 	// Check if local Sent has 1 entry.
       
   142 //	CMtfTestActionCheckChildrenCount::NewL(*this,CMtfTestActionParameters::NewL(KSession,KSentFolderId,KOne));
       
   143 
       
   144 	// Check if local Sent entry is the one we have sent.
       
   145 //	CMtfTestActionFindEntryByName::NewL(*this,CMtfTestActionParameters::NewL(KSession,KSentFolderId,KMmsMessageDescription,KSentMessageId));
       
   146 // COMPARE CONTENT OF THE MESSAGE
       
   147 	}
       
   148 
       
   149