appfw/apparchitecture/tef/T_ServicesStep.cpp
branchRCL_3
changeset 62 924385140d98
parent 0 2e3d3ce01487
child 63 c2c61fdca848
equal deleted inserted replaced
58:0818dd463d41 62:924385140d98
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 */
    19 */
    20 
    20 
    21 
    21 
    22 #include <barsread.h>
    22 #include <barsread.h>
    23 #include "T_ServicesStep.h"
    23 #include "T_ServicesStep.h"
       
    24 #include "T_SisFileInstaller.h" 
       
    25 
    24 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    26 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    25 #include <apaidpartner.h>
    27 #include <apaidpartner.h>
    26 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
    28 #endif //SYMBIAN_ENABLE_SPLIT_HEADERS
    27 
    29 
    28 _LIT(KCompleted, "Completed.");
    30 _LIT(KCompleted, "Completed.");
    29 _LIT8(KLitPlainText,"text/plain");
    31 _LIT8(KLitPlainText,"text/plain");
    30 _LIT8(KLitPriorityText,"text/priority");
    32 _LIT8(KLitPriorityText,"text/priority");
    31 _LIT8(KLitCustom1Text, "text/custom1");
    33 _LIT8(KLitCustom1Text, "text/custom1");
    32 
    34 
       
    35 
       
    36 _LIT(KServerApp2SisFile, "z:\\apparctest\\apparctestsisfiles\\serverapp2.sis");
       
    37 _LIT(KServerApp2Component, "serverapp2");
       
    38 
       
    39 _LIT(KServerApp4SisFile, "z:\\apparctest\\apparctestsisfiles\\serverapp4.sis");
       
    40 _LIT(KServerApp4Component, "serverapp4");
       
    41 
       
    42 _LIT(KServerApp6SisFile, "z:\\apparctest\\apparctestsisfiles\\serverapp6.sis");
       
    43 _LIT(KServerApp6Component, "serverapp6");
       
    44 
       
    45 _LIT(KServerApp7SisFile, "z:\\apparctest\\apparctestsisfiles\\serverapp7.sis");
       
    46 _LIT(KServerApp7Component, "serverapp7");
       
    47 
       
    48 _LIT(KOpenServiceApp1SisFile, "z:\\apparctest\\apparctestsisfiles\\openservice1app.sis");
       
    49 _LIT(KOpenServiceApp1Component, "openservice1app");
       
    50 
       
    51 _LIT(KOpenServiceApp2SisFile, "z:\\apparctest\\apparctestsisfiles\\openservice2app.sis");
       
    52 _LIT(KOpenServiceApp2Component, "openservice2app");
       
    53 
       
    54 _LIT(KCtrlPanelAppSisFile, "z:\\apparctest\\apparctestsisfiles\\TCtrlPnlApp.sis");
       
    55 _LIT(KCtrlPanelAppComponent, "TCtrlPnlApp");
       
    56 
       
    57 _LIT(KDataPrioritySystem1SisFile, "z:\\apparctest\\apparctestsisfiles\\T_DataPrioritySystem1.sis");
       
    58 _LIT(KDataPrioritySystem1Component, "T_DataPrioritySystem1");
       
    59 
       
    60 _LIT(KDataPrioritySystem2SisFile, "z:\\apparctest\\apparctestsisfiles\\T_DataPrioritySystem2.sis");
       
    61 _LIT(KDataPrioritySystem2Component, "T_DataPrioritySystem2");
       
    62 
       
    63 _LIT(KDataPrioritySystem3SisFile, "z:\\apparctest\\apparctestsisfiles\\T_DataPrioritySystem3.sis");
       
    64 _LIT(KDataPrioritySystem3Component, "T_DataPrioritySystem3");
       
    65 
    33 /**
    66 /**
    34    Constructor
    67    Constructor
    35  */	
    68  */	
    36 CT_ServicesTestStep::CT_ServicesTestStep()
    69 CT_ServicesTestStep::CT_ServicesTestStep()
    37 	{
    70 	{
    51    @return - TVerdict code
    84    @return - TVerdict code
    52    Override of base class virtual
    85    Override of base class virtual
    53  */	
    86  */	
    54 TVerdict CT_ServicesTestStep::doTestStepPreambleL()
    87 TVerdict CT_ServicesTestStep::doTestStepPreambleL()
    55 	{
    88 	{
       
    89     CSisFileInstaller sisInstaller;
       
    90     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KServerApp2SisFile);
       
    91     sisInstaller.InstallSisL(KServerApp2SisFile);
       
    92     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KServerApp4SisFile);
       
    93     sisInstaller.InstallSisL(KServerApp4SisFile);
       
    94     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KServerApp6SisFile);
       
    95     sisInstaller.InstallSisL(KServerApp6SisFile);   
       
    96     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KOpenServiceApp1SisFile);
       
    97     sisInstaller.InstallSisL(KOpenServiceApp1SisFile);
       
    98     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KOpenServiceApp2SisFile);
       
    99     sisInstaller.InstallSisL(KOpenServiceApp2SisFile);
       
   100     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KCtrlPanelAppSisFile);
       
   101     sisInstaller.InstallSisL(KCtrlPanelAppSisFile);
       
   102     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KDataPrioritySystem1SisFile);
       
   103     sisInstaller.InstallSisL(KDataPrioritySystem1SisFile);
       
   104     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KDataPrioritySystem2SisFile);
       
   105     sisInstaller.InstallSisL(KDataPrioritySystem2SisFile);
       
   106     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KDataPrioritySystem3SisFile);
       
   107     sisInstaller.InstallSisL(KDataPrioritySystem3SisFile);
       
   108     INFO_PRINTF2(_L("Installing sis file from -> %S"), &KServerApp7SisFile);
       
   109     sisInstaller.InstallSisAndWaitForAppListUpdateL(KServerApp7SisFile);
       
   110     
    56 	SetTestStepResult(EPass);
   111 	SetTestStepResult(EPass);
    57 	TInt error = iApaLsSession.Connect();
   112 	TInt error = iApaLsSession.Connect();
    58 	TEST(error==KErrNone);
   113 	TEST(error==KErrNone);
    59 	return TestStepResult();
   114 	return TestStepResult();
    60 	}
   115 	}
    63    @return - TVerdict code
   118    @return - TVerdict code
    64    Override of base class virtual
   119    Override of base class virtual
    65  */
   120  */
    66 TVerdict CT_ServicesTestStep::doTestStepPostambleL()
   121 TVerdict CT_ServicesTestStep::doTestStepPostambleL()
    67 	{
   122 	{
       
   123     CSisFileInstaller sisInstaller;
       
   124     sisInstaller.UninstallSisL(KServerApp2Component);
       
   125     sisInstaller.UninstallSisL(KServerApp4Component);
       
   126     sisInstaller.UninstallSisL(KServerApp6Component);
       
   127     sisInstaller.UninstallSisL(KServerApp7Component);
       
   128     sisInstaller.UninstallSisL(KOpenServiceApp1Component);
       
   129     sisInstaller.UninstallSisL(KOpenServiceApp2Component); 
       
   130     sisInstaller.UninstallSisL(KCtrlPanelAppComponent); 
       
   131     sisInstaller.UninstallSisL(KDataPrioritySystem1Component); 
       
   132     sisInstaller.UninstallSisL(KDataPrioritySystem2Component); 
       
   133     sisInstaller.UninstallSisL(KDataPrioritySystem3Component);     
    68 	return TestStepResult();
   134 	return TestStepResult();
    69 	}
   135 	}
    70 
   136 
    71 
   137 
    72 TVerdict CT_ServicesTestStep::doTestStepL()
   138 TVerdict CT_ServicesTestStep::doTestStepL()
    83 	}
   149 	}
    84 
   150 
    85 TInt CT_ServicesTestStep::RunTestCasesL()
   151 TInt CT_ServicesTestStep::RunTestCasesL()
    86 	{
   152 	{
    87 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery1L(), iApaLsSession.ClearAppInfoArray() );
   153 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery1L(), iApaLsSession.ClearAppInfoArray() );
       
   154 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK	
    88 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery2L(), iApaLsSession.ClearAppInfoArray() );
   155 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery2L(), iApaLsSession.ClearAppInfoArray() );
    89 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery3L(), NO_CLEANUP);
   156 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery3L(), NO_CLEANUP);
    90 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery4L(), NO_CLEANUP);
   157 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery4L(), NO_CLEANUP);
    91 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery5L(), NO_CLEANUP);
   158 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery5L(), NO_CLEANUP);
    92 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery6(), NO_CLEANUP);
   159 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery6(), NO_CLEANUP);
    93 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery7L(), NO_CLEANUP);
   160 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery7L(), NO_CLEANUP);
    94 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery8L(), NO_CLEANUP);
   161 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery8L(), NO_CLEANUP);
       
   162 #endif	
    95 	// The following two APIs InsertDataMappingL() & DeleteDataMappingL(), update the type store on the server side.
   163 	// The following two APIs InsertDataMappingL() & DeleteDataMappingL(), update the type store on the server side.
    96 	// This update takes place on the server side while the test case is still running, which causes the heap check to fail.
   164 	// This update takes place on the server side while the test case is still running, which causes the heap check to fail.
    97 	// To avoid the heap check on the server side, DONT_CHECK macro is used.
   165 	// To avoid the heap check on the server side, DONT_CHECK macro is used.
       
   166 #ifndef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK	
    98 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, DONT_CHECK, TestServiceDiscovery9(), NO_CLEANUP );
   167 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, DONT_CHECK, TestServiceDiscovery9(), NO_CLEANUP );
       
   168 #endif	
    99 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery10L(), NO_CLEANUP);
   169 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery10L(), NO_CLEANUP);
   100 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery11L(), NO_CLEANUP);
   170 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery11L(), NO_CLEANUP);
   101 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery12L(), NO_CLEANUP);
   171 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery12L(), NO_CLEANUP);
   102 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery13L(), NO_CLEANUP);
   172 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery13L(), NO_CLEANUP);
   103 
   173 
   133 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery22(), iApaLsSession.FlushRecognitionCache() );
   203 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery22(), iApaLsSession.FlushRecognitionCache() );
   134 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery23(), iApaLsSession.FlushRecognitionCache() );
   204 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery23(), iApaLsSession.FlushRecognitionCache() );
   135 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery24(), NO_CLEANUP);
   205 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery24(), NO_CLEANUP);
   136 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery25(), iApaLsSession.FlushRecognitionCache() );
   206 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery25(), iApaLsSession.FlushRecognitionCache() );
   137 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery27(), iApaLsSession.FlushRecognitionCache() );
   207 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery27(), iApaLsSession.FlushRecognitionCache() );
   138 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery28L(), NO_CLEANUP);
   208 	//HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestServiceDiscovery28L(), NO_CLEANUP);
   139 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestOpenService1L(), NO_CLEANUP);
   209 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestOpenService1L(), NO_CLEANUP);
   140 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestCtrlPnlAppL(), NO_CLEANUP);
   210 	HEAP_TEST_LS_SESSION(iApaLsSession, 0, 0, TestCtrlPnlAppL(), NO_CLEANUP);
   141 	// The following two APIs InsertDataMappingL() & DeleteDataMappingL(), update the type store on the server side.
   211 	// The following two APIs InsertDataMappingL() & DeleteDataMappingL(), update the type store on the server side.
   142 	// This update takes place on the server side while the test case is still running, which causes the heap check to fail.
   212 	// This update takes place on the server side while the test case is still running, which causes the heap check to fail.
   143 	// To avoid the heap check on the server side, DONT_CHECK macro is used.
   213 	// To avoid the heap check on the server side, DONT_CHECK macro is used.