telephonyserverplugins/common_tsy/test/component/src/cctsylbsfu.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     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 // The TEFUnit test suite for LBS in the Common TSY.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20 */
       
    21 
       
    22 #include "cctsylbsfu.h"
       
    23 #include <etel.h>
       
    24 #include <etelmm.h>
       
    25 #include <et_clsvr.h>
       
    26 #include <ctsy/mmtsy_names.h>
       
    27 #include <ctsy/serviceapi/mmtsy_ipcdefs.h>
       
    28 #include "tmockltsydata.h"
       
    29 #include <ctsy/serviceapi/gsmerror.h>
       
    30 
       
    31 CTestSuite* CCTsyLBSFU::CreateSuiteL(const TDesC& aName)
       
    32 	{
       
    33 	SUB_SUITE;
       
    34 
       
    35 	ADD_TEST_STEP_ISO_CPP(CCTsyLBSFU, TestNotifyMtlr0001L);
       
    36 	ADD_TEST_STEP_ISO_CPP(CCTsyLBSFU, TestSetLcsDomain0001L);
       
    37 	ADD_TEST_STEP_ISO_CPP(CCTsyLBSFU, TestSendMtlrResponse0001L);
       
    38 	ADD_TEST_STEP_ISO_CPP(CCTsyLBSFU, TestSendMtlrResponse0002L);
       
    39 	ADD_TEST_STEP_ISO_CPP(CCTsyLBSFU, TestSendMtlrResponse0003L);
       
    40 	ADD_TEST_STEP_ISO_CPP(CCTsyLBSFU, TestSendMeasurementReport0001L);
       
    41 	ADD_TEST_STEP_ISO_CPP(CCTsyLBSFU, TestSendMeasurementReport0002L);
       
    42 	ADD_TEST_STEP_ISO_CPP(CCTsyLBSFU, TestNotifyMeasurementControl0001L);
       
    43 	ADD_TEST_STEP_ISO_CPP(CCTsyLBSFU, TestSendMolr0001L);
       
    44 
       
    45 	END_SUITE;
       
    46 	}
       
    47 
       
    48 
       
    49 //
       
    50 // Actual test cases
       
    51 //
       
    52 
       
    53 
       
    54 /**
       
    55 @SYMTestCaseID BA-CTSY-LBS-LNM-0001
       
    56 @SYMComponent  telephony_ctsy
       
    57 @SYMTestCaseDesc Test support in CTSY for RMobileLocationServices::NotifyMtlr
       
    58 @SYMTestPriority High
       
    59 @SYMTestActions Invokes RMobileLocationServices::NotifyMtlr
       
    60 @SYMTestExpectedResults Pass
       
    61 @SYMTestType CT
       
    62 */
       
    63 void CCTsyLBSFU::TestNotifyMtlr0001L()
       
    64 	{
       
    65 
       
    66 	OpenEtelServerL(EUseExtendedError);
       
    67 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
    68 	OpenPhoneL();
       
    69 
       
    70 	RMobileLocationServices locationServices;
       
    71     CleanupClosePushL(locationServices);
       
    72 	TInt err = locationServices.Open(iPhone);
       
    73 	ASSERT_EQUALS(KErrNotSupported, err);
       
    74 
       
    75 	AssertMockLtsyStatusL();
       
    76 	CleanupStack::PopAndDestroy(2, this); // locationServices, this
       
    77 	
       
    78 	}
       
    79 
       
    80 
       
    81 /**
       
    82 @SYMTestCaseID BA-CTSY-LBS-LSLD-0001
       
    83 @SYMComponent  telephony_ctsy
       
    84 @SYMTestCaseDesc Test support in CTSY for RMobileLocationServices::SetLcsDomain
       
    85 @SYMTestPriority High
       
    86 @SYMTestActions Invokes RMobileLocationServices::SetLcsDomain
       
    87 @SYMTestExpectedResults Pass
       
    88 @SYMTestType CT
       
    89 */
       
    90 void CCTsyLBSFU::TestSetLcsDomain0001L()
       
    91 	{
       
    92 
       
    93 	OpenEtelServerL(EUseExtendedError);
       
    94 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
    95 	OpenPhoneL();
       
    96 
       
    97     RMobileLocationServices locationServices;
       
    98     CleanupClosePushL(locationServices);
       
    99     TInt err = locationServices.Open(iPhone);
       
   100     ASSERT_EQUALS(KErrNotSupported, err);
       
   101 	
       
   102 	AssertMockLtsyStatusL();
       
   103 	CleanupStack::PopAndDestroy(2, this); // locationServices, this
       
   104 	
       
   105 	}
       
   106 
       
   107 
       
   108 /**
       
   109 @SYMTestCaseID BA-CTSY-LBS-LSMTLRR-0001
       
   110 @SYMComponent  telephony_ctsy
       
   111 @SYMTestCaseDesc Test support in CTSY for RMobileLocationServices::SendMtlrResponse
       
   112 @SYMTestPriority High
       
   113 @SYMTestActions Invokes RMobileLocationServices::SendMtlrResponse
       
   114 @SYMTestExpectedResults Pass
       
   115 @SYMTestType CT
       
   116 */
       
   117 void CCTsyLBSFU::TestSendMtlrResponse0001L()
       
   118 	{
       
   119 
       
   120 	OpenEtelServerL(EUseExtendedError);
       
   121 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   122 	OpenPhoneL();
       
   123 
       
   124     RMobileLocationServices locationServices;
       
   125     CleanupClosePushL(locationServices);
       
   126     TInt err = locationServices.Open(iPhone);
       
   127     ASSERT_EQUALS(KErrNotSupported, err);
       
   128 	
       
   129 	AssertMockLtsyStatusL();
       
   130 	CleanupStack::PopAndDestroy(2, this); // locationServices, this
       
   131 	
       
   132 	}
       
   133 
       
   134 
       
   135 /**
       
   136 @SYMTestCaseID BA-CTSY-LBS-LSMTLRR-0002
       
   137 @SYMComponent  telephony_ctsy
       
   138 @SYMTestCaseDesc Test support in CTSY for RMobileLocationServices::SendMtlrResponse
       
   139 @SYMTestPriority High
       
   140 @SYMTestActions Invokes RMobileLocationServices::SendMtlrResponse
       
   141 @SYMTestExpectedResults Pass
       
   142 @SYMTestType CT
       
   143 */
       
   144 void CCTsyLBSFU::TestSendMtlrResponse0002L()
       
   145 	{
       
   146 
       
   147 	OpenEtelServerL(EUseExtendedError);
       
   148 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   149 	OpenPhoneL();
       
   150 
       
   151     RMobileLocationServices locationServices;
       
   152     CleanupClosePushL(locationServices);
       
   153     TInt err = locationServices.Open(iPhone);
       
   154     ASSERT_EQUALS(KErrNotSupported, err);
       
   155 
       
   156 	AssertMockLtsyStatusL();
       
   157 	CleanupStack::PopAndDestroy(2, this); // locationServices, this
       
   158 	
       
   159 	}
       
   160 
       
   161 
       
   162 /**
       
   163 @SYMTestCaseID BA-CTSY-LBS-LSMTLRR-0003
       
   164 @SYMComponent  telephony_ctsy
       
   165 @SYMTestCaseDesc Test support in CTSY for RMobileLocationServices::SendMtlrResponse
       
   166 @SYMTestPriority High
       
   167 @SYMTestActions Invokes RMobileLocationServices::SendMtlrResponse
       
   168 @SYMTestExpectedResults Pass
       
   169 @SYMTestType CT
       
   170 */
       
   171 void CCTsyLBSFU::TestSendMtlrResponse0003L()
       
   172 	{
       
   173 
       
   174 	OpenEtelServerL(EUseExtendedError);
       
   175 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   176 	OpenPhoneL();
       
   177 
       
   178     RMobileLocationServices locationServices;
       
   179     CleanupClosePushL(locationServices);
       
   180     TInt err = locationServices.Open(iPhone);
       
   181     ASSERT_EQUALS(KErrNotSupported, err);
       
   182 
       
   183     AssertMockLtsyStatusL();
       
   184 	CleanupStack::PopAndDestroy(2, this); // locationServices, this
       
   185 	
       
   186 	}
       
   187 
       
   188 
       
   189 /**
       
   190 @SYMTestCaseID BA-CTSY-LBS-LSMR-0001
       
   191 @SYMComponent  telephony_ctsy
       
   192 @SYMTestCaseDesc Test support in CTSY for RMobileLocationServices::SendMeasurementReport
       
   193 @SYMTestPriority High
       
   194 @SYMTestActions Invokes RMobileLocationServices::SendMeasurementReport
       
   195 @SYMTestExpectedResults Pass
       
   196 @SYMTestType CT
       
   197 */
       
   198 void CCTsyLBSFU::TestSendMeasurementReport0001L()
       
   199 	{
       
   200 
       
   201 	OpenEtelServerL(EUseExtendedError);
       
   202 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   203 	OpenPhoneL();
       
   204 
       
   205 	RMobileLocationServices locationServices;
       
   206     CleanupClosePushL(locationServices);
       
   207     TInt err = locationServices.Open(iPhone);
       
   208     ASSERT_EQUALS(KErrNotSupported, err);
       
   209 
       
   210 	AssertMockLtsyStatusL();
       
   211 	CleanupStack::PopAndDestroy(2, this); // locationServices, this
       
   212 	
       
   213 	}
       
   214 
       
   215 
       
   216 /**
       
   217 @SYMTestCaseID BA-CTSY-LBS-LSMR-0002
       
   218 @SYMComponent  telephony_ctsy
       
   219 @SYMTestCaseDesc Test support in CTSY for RMobileLocationServices::SendMeasurementReport
       
   220 @SYMTestPriority High
       
   221 @SYMTestActions Invokes RMobileLocationServices::SendMeasurementReport
       
   222 @SYMTestExpectedResults Pass
       
   223 @SYMTestType CT
       
   224 */
       
   225 void CCTsyLBSFU::TestSendMeasurementReport0002L()
       
   226 	{
       
   227 
       
   228 	OpenEtelServerL(EUseExtendedError);
       
   229 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   230 	OpenPhoneL();
       
   231 
       
   232     RMobileLocationServices locationServices;
       
   233     CleanupClosePushL(locationServices);
       
   234     TInt err = locationServices.Open(iPhone);
       
   235     ASSERT_EQUALS(KErrNotSupported, err);
       
   236 
       
   237 	AssertMockLtsyStatusL();
       
   238 	CleanupStack::PopAndDestroy(2, this); // locationServices, this
       
   239 	
       
   240 	}
       
   241 
       
   242 
       
   243 /**
       
   244 @SYMTestCaseID BA-CTSY-LBS-LMC-0001
       
   245 @SYMComponent  telephony_ctsy
       
   246 @SYMTestCaseDesc Test support in CTSY for RMobileLocationServices::NotifyMeasurementControl
       
   247 @SYMTestPriority High
       
   248 @SYMTestActions Invokes RMobileLocationServices::NotifyMeasurementControl
       
   249 @SYMTestExpectedResults Pass
       
   250 @SYMTestType CT
       
   251 */
       
   252 void CCTsyLBSFU::TestNotifyMeasurementControl0001L()
       
   253 	{
       
   254 
       
   255 	OpenEtelServerL(EUseExtendedError);
       
   256 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   257 	OpenPhoneL();
       
   258 
       
   259     RMobileLocationServices locationServices;
       
   260     CleanupClosePushL(locationServices);
       
   261     TInt err = locationServices.Open(iPhone);
       
   262     ASSERT_EQUALS(KErrNotSupported, err);
       
   263 
       
   264 	AssertMockLtsyStatusL();
       
   265 	CleanupStack::PopAndDestroy(2, this); // locationServices, this
       
   266 	
       
   267 	}
       
   268 
       
   269 
       
   270 /**
       
   271 @SYMTestCaseID BA-CTSY-LBS-LSM-0001
       
   272 @SYMComponent  telephony_ctsy
       
   273 @SYMTestCaseDesc Test support in CTSY for RMobileLocationServices::SendMolr
       
   274 @SYMTestPriority High
       
   275 @SYMTestActions Invokes RMobileLocationServices::SendMolr
       
   276 @SYMTestExpectedResults Pass
       
   277 @SYMTestType CT
       
   278 */
       
   279 void CCTsyLBSFU::TestSendMolr0001L()
       
   280 	{
       
   281 
       
   282 	OpenEtelServerL(EUseExtendedError);
       
   283 	CleanupStack::PushL(TCleanupItem(Cleanup,this));
       
   284 	OpenPhoneL();
       
   285 
       
   286     RMobileLocationServices locationServices;
       
   287     CleanupClosePushL(locationServices);
       
   288     TInt err = locationServices.Open(iPhone);
       
   289     ASSERT_EQUALS(KErrNotSupported, err);
       
   290 
       
   291 	AssertMockLtsyStatusL();
       
   292 	CleanupStack::PopAndDestroy(2, this); // locationServices, this
       
   293 	
       
   294 	}
       
   295 
       
   296 
       
   297