serviceproviders/sapi_calendar/tsrc/dev/tcalendartest/tcalendarimportiter1/src/tcalendarimporttestblocks.cpp
changeset 5 989d2f495d90
child 23 50974a8b132e
equal deleted inserted replaced
1:a36b1e19a461 5:989d2f495d90
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <e32svr.h>
       
    23 #include <StifParser.h>
       
    24 //#include <SAPI_TEST\testprg.h>
       
    25 #include <Stiftestinterface.h>
       
    26 #include "tcalendarimporttest.h"
       
    27 #include "calendarheader.h"
       
    28 #include "calendarservice.h"
       
    29 #include "calimptestcases.h"
       
    30 
       
    31 
       
    32 // ============================ MEMBER FUNCTIONS ===============================
       
    33 
       
    34 // -----------------------------------------------------------------------------
       
    35 // CTChangeStatusTest::Delete
       
    36 // Delete here all resources allocated and opened from test methods. 
       
    37 // Called from destructor. 
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 void CTCalendarImportTest::Delete() 
       
    41     {
       
    42 
       
    43     }
       
    44 
       
    45 // -----------------------------------------------------------------------------
       
    46 // CTChangeStatusTest::RunMethodL
       
    47 // Run specified method. Contains also table of test mothods and their names.
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 TInt CTCalendarImportTest::RunMethodL( 
       
    51     CStifItemParser& aItem ) 
       
    52     {
       
    53 
       
    54     static TStifFunctionInfo const KFunctions[] =
       
    55         {  
       
    56         // Copy this line for every implemented function.
       
    57         // First string is the function name used in TestScripter script file.
       
    58         // Second is the actual implementation member function. 
       
    59         //TRY( "SendMessage",    CTDeleteMessageTest::SendMessage ),
       
    60         
       
    61         ENTRY( "Import",    	 CTCalendarImportTest::Import ),
       
    62 		ENTRY( "ImportAsync",    CTCalendarImportTest::ImportAsync ),
       
    63 		ENTRY( "ICALImport",     CTCalendarImportTest::ICALImport ),
       
    64 		ENTRY( "ICALImportAsync",CTCalendarImportTest::ICALImportAsync ),
       
    65         };
       
    66 
       
    67     const TInt count = sizeof( KFunctions ) / 
       
    68                         sizeof( TStifFunctionInfo );
       
    69 
       
    70     return RunInternalL( KFunctions, count, aItem );
       
    71 
       
    72     }
       
    73 
       
    74 
       
    75 	
       
    76 // -----------------------------------------------------------------------------
       
    77 // CTCalendarImportTest::Import
       
    78 // Test Method to test the Import(Synchronous)
       
    79 // Functionality of CalenderService
       
    80 // -----------------------------------------------------------------------------
       
    81 //
       
    82 TInt  CTCalendarImportTest::Import(CStifItemParser& /*aItem*/)
       
    83 	{
       
    84 	__UHEAP_MARK;
       
    85 	
       
    86 	TInt result=KErrNone;
       
    87 	
       
    88 	CCalImpTestCases *calImpTest = CCalImpTestCases::NewL(result);
       
    89 
       
    90 	calImpTest->TestImportL();
       
    91 
       
    92 	delete calImpTest;
       
    93 	
       
    94 	__UHEAP_MARKEND;
       
    95 	
       
    96 	return result;
       
    97     }
       
    98 
       
    99 
       
   100 // -----------------------------------------------------------------------------
       
   101 // CTCalendarImportTest::ImportAsync
       
   102 // Test Method to test the ImportAsync(ASynchronous)
       
   103 // Functionality of CalenderService
       
   104 // -----------------------------------------------------------------------------
       
   105 //
       
   106 TInt  CTCalendarImportTest::ImportAsync(CStifItemParser& /*aItem*/)
       
   107 	{
       
   108 	__UHEAP_MARK;
       
   109 	
       
   110 	TInt result=KErrNone;
       
   111 	
       
   112 	CCalImpTestCases *calImpTest = CCalImpTestCases::NewL(result);
       
   113 
       
   114 	calImpTest->TestImportAsyncL();
       
   115 	
       
   116 	delete calImpTest;
       
   117 	
       
   118 	__UHEAP_MARKEND;
       
   119 	
       
   120 	return result;
       
   121     }
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // CTCalendarImportTest::ICALImport
       
   125 // Test Method to test the ICALImport(Synchronous)
       
   126 // Functionality of CalenderService
       
   127 // -----------------------------------------------------------------------------
       
   128 //
       
   129 TInt  CTCalendarImportTest::ICALImport(CStifItemParser& /*aItem*/)
       
   130 	{
       
   131 	__UHEAP_MARK;
       
   132 	
       
   133 	TInt result=KErrNone;
       
   134 	
       
   135 	CCalImpTestCases *calImpTest = CCalImpTestCases::NewL(result,2);
       
   136 	
       
   137 	calImpTest->TestImportL();
       
   138 
       
   139 	delete calImpTest;
       
   140 	
       
   141 	__UHEAP_MARKEND;
       
   142 	
       
   143 	return result;
       
   144     }
       
   145 
       
   146 
       
   147 // -----------------------------------------------------------------------------
       
   148 // CTCalendarImportTest::ICALImportAsync
       
   149 // Test Method to test the ICALImportAsync(ASynchronous)
       
   150 // Functionality of CalenderService
       
   151 // -----------------------------------------------------------------------------
       
   152 //
       
   153 TInt  CTCalendarImportTest::ICALImportAsync(CStifItemParser& /*aItem*/)
       
   154 	{
       
   155 	__UHEAP_MARK;
       
   156 	
       
   157 	TInt result=KErrNone;
       
   158 	
       
   159 	CCalImpTestCases *calImpTest = CCalImpTestCases::NewL(result,2);
       
   160 	
       
   161 	CleanupStack::PushL(calImpTest);
       
   162 	
       
   163 	calImpTest->TestImportAsyncL();
       
   164 	
       
   165 	CleanupStack::PopAndDestroy(calImpTest);
       
   166 			
       
   167 	__UHEAP_MARKEND;
       
   168 	
       
   169 	return result;
       
   170     }
       
   171 
       
   172