locationsystemui/locationsysui/tsrc/src/posnotificationtest.cpp
changeset 35 1a92308afc46
equal deleted inserted replaced
33:834e27cad510 35:1a92308afc46
       
     1 /*
       
     2  * Copyright (c) 2010 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 "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: Implementation of the notification related test cases.
       
    15  *
       
    16  */
       
    17 #include "posnotificationtest.h"
       
    18 #include <lbs/epos_cposnetworkprivacy.h>
       
    19 #include <EPos_CPosGSMPrivacyRequestInfo.h> 
       
    20 #include <EPos_CPosSUPLPrivacyRequestInfo.h>
       
    21 #include <EPos_CPosNetworkPrivacyRequestInfo.h> 
       
    22 #include <QDebug>
       
    23 // constants
       
    24 _LIT( KTxtRequestorName, "TestNotificationRequestor" );
       
    25 _LIT( KTxtLongRequestorName, "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
       
    26 _LIT( KTxtRequestorURL, "www.nokia.com" );
       
    27 _LIT( KTxtRequestorPhone, "0501231231" );
       
    28 _LIT( KTxtRequestorEmail, "abcd" );
       
    29 _LIT( KTxtRequestorSIPURL, "James@Hill.se" );
       
    30 _LIT(KTxtRequestorIMSPublicIdentity, "abcde123");
       
    31 _LIT( KTxtRequestorIMS, "5665656656" );
       
    32 _LIT( KTxtRequestorMIN, "9999999999" );
       
    33 _LIT( KTxtRequestorMDN, "5665656656" );
       
    34 
       
    35 const TInt KWaitPeriod1 = 20000000;
       
    36 const TInt KWaitPeriod2 = 40000000;
       
    37 
       
    38 //---------------------------------------------------------------------
       
    39 // PosNotificationTest::HandleVerifyComplete()
       
    40 // 
       
    41 //---------------------------------------------------------------------
       
    42 
       
    43 void PosNotificationTest::HandleVerifyComplete(TInt /*aRequestId*/,
       
    44         TInt /*aCompletionCode*/)
       
    45     {
       
    46     mEventLoop.exit();
       
    47     }
       
    48 
       
    49 //---------------------------------------------------------------------
       
    50 // PosNotificationTest::IssueNotificationRequest1()
       
    51 // 
       
    52 //---------------------------------------------------------------------
       
    53 void PosNotificationTest::IssueNotificationRequest1()
       
    54     {
       
    55     TRAPD(error,IssueNotificationRequest1L());
       
    56     QVERIFY( error == KErrNone );
       
    57     }
       
    58 
       
    59 //---------------------------------------------------------------------
       
    60 // PosNotificationTest::IssueNotificationRequest2()
       
    61 // 
       
    62 //---------------------------------------------------------------------
       
    63 void PosNotificationTest::IssueNotificationRequest2()
       
    64     {
       
    65     TRAPD(error,IssueNotificationRequest2L());
       
    66     QVERIFY( error == KErrNone );
       
    67     }
       
    68 
       
    69 //---------------------------------------------------------------------
       
    70 // PosNotificationTest::IssueNotificationRequest3()
       
    71 // 
       
    72 //---------------------------------------------------------------------
       
    73 void PosNotificationTest::IssueNotificationRequest3()
       
    74     {
       
    75     TRAPD(error,IssueNotificationRequest3L());
       
    76     QVERIFY( error == KErrNone );
       
    77     }
       
    78 
       
    79 //---------------------------------------------------------------------
       
    80 // PosNotificationTest::IssueNotificationRequest4()
       
    81 // 
       
    82 //---------------------------------------------------------------------
       
    83 void PosNotificationTest::IssueNotificationRequest4()
       
    84     {
       
    85     TRAPD(error,IssueNotificationRequest4L());
       
    86     QVERIFY( error == KErrNone );
       
    87     }
       
    88 
       
    89 //---------------------------------------------------------------------
       
    90 // PosNotificationTest::IssueNotificationRequest5()
       
    91 // 
       
    92 //---------------------------------------------------------------------
       
    93 void PosNotificationTest::IssueNotificationRequest5()
       
    94     {
       
    95     TRAPD(error,IssueNotificationRequest5L());
       
    96     QVERIFY( error == KErrNone );
       
    97     }
       
    98 
       
    99 //---------------------------------------------------------------------
       
   100 // PosNotificationTest::IssueNotificationRequest6()
       
   101 // 
       
   102 //---------------------------------------------------------------------
       
   103 void PosNotificationTest::IssueNotificationRequest6()
       
   104     {
       
   105     TRAPD(error,IssueNotificationRequest6L());
       
   106     QVERIFY( error == KErrNone );
       
   107     }
       
   108 
       
   109 //---------------------------------------------------------------------
       
   110 // PosNotificationTest::IssueNotificationRequest7()
       
   111 // 
       
   112 //---------------------------------------------------------------------
       
   113 void PosNotificationTest::IssueNotificationRequest7()
       
   114     {
       
   115     TRAPD(error,IssueNotificationRequest7L());
       
   116     QVERIFY( error == KErrNone );
       
   117     }
       
   118 
       
   119 //---------------------------------------------------------------------
       
   120 // PosNotificationTest::IssueNotificationRequest8()
       
   121 // 
       
   122 //---------------------------------------------------------------------
       
   123 void PosNotificationTest::IssueNotificationRequest8()
       
   124     {
       
   125     TRAPD(error,IssueNotificationRequest8L());
       
   126     QVERIFY( error == KErrNone );
       
   127     }
       
   128 
       
   129 //---------------------------------------------------------------------
       
   130 // PosNotificationTest::IssueNotificationRequest9()
       
   131 // 
       
   132 //---------------------------------------------------------------------
       
   133 void PosNotificationTest::IssueNotificationRequest9()
       
   134     {
       
   135     TRAPD(error,IssueNotificationRequest9L());
       
   136     QVERIFY( error == KErrNone );
       
   137     }
       
   138 
       
   139 //---------------------------------------------------------------------
       
   140 // PosNotificationTest::IssueNotificationRequest10()
       
   141 // 
       
   142 //---------------------------------------------------------------------
       
   143 void PosNotificationTest::IssueNotificationRequest10()
       
   144     {
       
   145     TRAPD(error,IssueNotificationRequest10L());
       
   146     QVERIFY( error == KErrNone );
       
   147     }
       
   148 
       
   149 //---------------------------------------------------------------------
       
   150 // PosNotificationTest::IssueNotificationRequest11()
       
   151 // 
       
   152 //---------------------------------------------------------------------
       
   153 void PosNotificationTest::IssueNotificationRequest11()
       
   154     {
       
   155     TRAPD(error,IssueNotificationRequest11L());
       
   156     QVERIFY( error == KErrNone );
       
   157     }
       
   158 
       
   159 //---------------------------------------------------------------------
       
   160 // PosNotificationTest::IssueNotificationRequest12()
       
   161 // 
       
   162 //---------------------------------------------------------------------
       
   163 void PosNotificationTest::IssueNotificationRequest12()
       
   164     {
       
   165     TRAPD(error,IssueNotificationRequest12L());
       
   166     QVERIFY( error == KErrNone );
       
   167     }
       
   168 
       
   169 //---------------------------------------------------------------------
       
   170 // PosNotificationTest::IssueNotificationRequest13()
       
   171 // 
       
   172 //---------------------------------------------------------------------
       
   173 void PosNotificationTest::IssueNotificationRequest13()
       
   174     {
       
   175     TRAPD(error,IssueNotificationRequest13L());
       
   176     QVERIFY( error == KErrNone );
       
   177     }
       
   178 
       
   179 //---------------------------------------------------------------------
       
   180 // PosNotificationTest::IssueNotificationRequest14()
       
   181 // 
       
   182 //---------------------------------------------------------------------
       
   183 void PosNotificationTest::IssueNotificationRequest14()
       
   184     {
       
   185     TRAPD(error,IssueNotificationRequest14L());
       
   186     QVERIFY( error == KErrNone );
       
   187     }
       
   188 
       
   189 //---------------------------------------------------------------------
       
   190 // PosNotificationTest::IssueNotificationRequest15()
       
   191 // 
       
   192 //---------------------------------------------------------------------
       
   193 void PosNotificationTest::IssueNotificationRequest15()
       
   194     {
       
   195     TRAPD(error,IssueNotificationRequest15L());
       
   196     QVERIFY( error == KErrNone );
       
   197     }
       
   198 
       
   199 //---------------------------------------------------------------------
       
   200 // PosNotificationTest::IssueNotificationRequest16()
       
   201 // 
       
   202 //---------------------------------------------------------------------
       
   203 void PosNotificationTest::IssueNotificationRequest16()
       
   204     {
       
   205     TRAPD(error,IssueNotificationRequest16L());
       
   206     QVERIFY( error == KErrNone );
       
   207     }
       
   208 
       
   209 //---------------------------------------------------------------------
       
   210 // PosNotificationTest::IssueNotificationRequest17()
       
   211 // 
       
   212 //---------------------------------------------------------------------
       
   213 void PosNotificationTest::IssueNotificationRequest17()
       
   214     {
       
   215     TRAPD(error,IssueNotificationRequest17L());
       
   216     QVERIFY( error == KErrNone );
       
   217     }
       
   218 
       
   219 //---------------------------------------------------------------------
       
   220 // PosNotificationTest::IssueNotificationRequest18()
       
   221 // 
       
   222 //---------------------------------------------------------------------
       
   223 void PosNotificationTest::IssueNotificationRequest18()
       
   224     {
       
   225     TRAPD(error,IssueNotificationRequest18L());
       
   226     QVERIFY( error == KErrNone );
       
   227     }
       
   228 
       
   229 //---------------------------------------------------------------------
       
   230 // PosNotificationTest::IssueNotifyVerificationTimeOut1()
       
   231 // 
       
   232 //---------------------------------------------------------------------
       
   233 void PosNotificationTest::IssueNotifyVerificationTimeOut1()
       
   234     {
       
   235     TRAPD(error,IssueNotifyVerificationTimeOut1L());
       
   236     QVERIFY( error == KErrNone );
       
   237     }
       
   238 
       
   239 //---------------------------------------------------------------------
       
   240 // PosNotificationTest::IssueNotifyVerificationTimeOut2()
       
   241 // 
       
   242 //---------------------------------------------------------------------
       
   243 void PosNotificationTest::IssueNotifyVerificationTimeOut2()
       
   244     {
       
   245     TRAPD(error,IssueNotifyVerificationTimeOut2L());
       
   246     QVERIFY( error == KErrNone );
       
   247     }
       
   248 
       
   249 //---------------------------------------------------------------------
       
   250 // PosNotificationTest::IssueNotifyVerificationTimeOut3()
       
   251 // 
       
   252 //---------------------------------------------------------------------
       
   253 void PosNotificationTest::IssueNotifyVerificationTimeOut3()
       
   254     {
       
   255     TRAPD(error,IssueNotifyVerificationTimeOut3L());
       
   256     QVERIFY( error == KErrNone );
       
   257     }
       
   258 
       
   259 //---------------------------------------------------------------------
       
   260 // PosNotificationTest::IssueNotifyVerificationTimeOut4()
       
   261 // 
       
   262 //---------------------------------------------------------------------
       
   263 void PosNotificationTest::IssueNotifyVerificationTimeOut4()
       
   264     {
       
   265     TRAPD(error,IssueNotifyVerificationTimeOut4L());
       
   266     QVERIFY( error == KErrNone );
       
   267     }
       
   268 
       
   269 //---------------------------------------------------------------------
       
   270 // PosNotificationTest::IssueMultipleRequests1()
       
   271 // 
       
   272 //---------------------------------------------------------------------
       
   273 void PosNotificationTest::IssueMultipleRequests1()
       
   274     {
       
   275     TRAPD(error,IssueMultipleRequests1L());
       
   276     QVERIFY( error == KErrNone );
       
   277     }
       
   278 
       
   279 //---------------------------------------------------------------------
       
   280 // PosNotificationTest::IssueMultipleRequests2()
       
   281 // 
       
   282 //---------------------------------------------------------------------
       
   283 void PosNotificationTest::IssueMultipleRequests2()
       
   284     {
       
   285     TRAPD(error,IssueMultipleRequests2L());
       
   286     QVERIFY( error == KErrNone );
       
   287     }
       
   288 
       
   289 //---------------------------------------------------------------------
       
   290 // PosNotificationTest::IssueNotificationRequest1L()
       
   291 // 
       
   292 //---------------------------------------------------------------------
       
   293 void PosNotificationTest::IssueNotificationRequest1L()
       
   294     {
       
   295     qDebug() << "IssueNotificationRequest1L - In";
       
   296     TInt result = KErrNone;
       
   297     // Create a new CPosGSMPrivacyRequestInfo object    
       
   298     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
   299     // Set Lcs client identified by phone number
       
   300     info->SetLCSClientL(KTxtRequestorPhone,
       
   301             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
   302     // set the requestor identified by phone number
       
   303     info->SetRequestorL(KTxtRequestorPhone,
       
   304             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
   305     // set request type to be single shot
       
   306     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   307 
       
   308     TInt requestId = -1;
       
   309     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   310     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   311     CleanupStack::PushL(privacy);
       
   312     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   313     qDebug() << "After call to NotifyLocationRequestL,error =" << error;
       
   314     if (error == KErrNone)
       
   315         {
       
   316         if (requestId < 0)
       
   317             {
       
   318             User::Leave(KErrGeneral);
       
   319             }
       
   320         }
       
   321     else
       
   322         {
       
   323         User::Leave(KErrGeneral);
       
   324         }
       
   325     CleanupStack::PopAndDestroy(privacy);
       
   326     CleanupStack::PopAndDestroy(info);
       
   327     }
       
   328 
       
   329 //---------------------------------------------------------------------
       
   330 // PosNotificationTest::IssueNotificationRequest2L()
       
   331 // 
       
   332 //---------------------------------------------------------------------
       
   333 void PosNotificationTest::IssueNotificationRequest2L()
       
   334     {
       
   335     TInt result = KErrNone;
       
   336     // Create a new CPosGSMPrivacyRequestInfo object    
       
   337     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
   338     // Set Lcs client identified by phone number
       
   339     info->SetLCSClientL(KTxtRequestorPhone,
       
   340             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
   341     // set the requestor identified by phone number
       
   342     info->SetRequestorL(KTxtRequestorPhone,
       
   343             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
   344     // set request type to be periodic
       
   345     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestPeriodic);
       
   346 
       
   347     TInt requestId = -1;
       
   348     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   349     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   350     CleanupStack::PushL(privacy);
       
   351     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   352     if (error == KErrNone)
       
   353         {
       
   354         if (requestId < 0)
       
   355             {
       
   356             User::Leave(KErrGeneral);
       
   357             }
       
   358         }
       
   359     else
       
   360         {
       
   361         User::Leave(KErrGeneral);
       
   362         }
       
   363     CleanupStack::PopAndDestroy(privacy);
       
   364     CleanupStack::PopAndDestroy(info);
       
   365     }
       
   366 
       
   367 //---------------------------------------------------------------------
       
   368 // PosNotificationTest::IssueNotificationRequest3L()
       
   369 // 
       
   370 //---------------------------------------------------------------------
       
   371 void PosNotificationTest::IssueNotificationRequest3L()
       
   372     {
       
   373     TInt result = KErrNone;
       
   374     // Create a new CPosGSMPrivacyRequestInfo object    
       
   375     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
   376     // Set Lcs client identified by name
       
   377     info->SetLCSClientL(KTxtRequestorName,
       
   378             CPosGSMPrivacyRequestInfo::EIdTypeLogicalName);
       
   379     // set the requestor identified by name
       
   380     info->SetRequestorL(KTxtRequestorName,
       
   381             CPosGSMPrivacyRequestInfo::EIdTypeLogicalName);
       
   382     // set request type to be single shot
       
   383     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   384 
       
   385     TInt requestId = -1;
       
   386     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   387     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   388     CleanupStack::PushL(privacy);
       
   389     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   390     if (error == KErrNone)
       
   391         {
       
   392         if (requestId < 0)
       
   393             {
       
   394             User::Leave(KErrGeneral);
       
   395             }
       
   396         }
       
   397     else
       
   398         {
       
   399         User::Leave(KErrGeneral);
       
   400         }
       
   401     CleanupStack::PopAndDestroy(privacy);
       
   402     CleanupStack::PopAndDestroy(info);
       
   403     }
       
   404 
       
   405 //---------------------------------------------------------------------
       
   406 // PosNotificationTest::IssueNotificationRequest4L()
       
   407 // 
       
   408 //---------------------------------------------------------------------
       
   409 void PosNotificationTest::IssueNotificationRequest4L()
       
   410     {
       
   411     	
       
   412     TInt result = KErrNone;
       
   413     // Create a new CPosGSMPrivacyRequestInfo object    
       
   414     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
   415     // Set Lcs client identified by email
       
   416     info->SetLCSClientL(KTxtRequestorEmail,
       
   417             CPosGSMPrivacyRequestInfo::EIdTypeEmailAddress);
       
   418     // set the requestor identified by email
       
   419     info->SetRequestorL(KTxtRequestorEmail,
       
   420             CPosGSMPrivacyRequestInfo::EIdTypeEmailAddress);
       
   421     // set request type to be single shot
       
   422     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   423 
       
   424     TInt requestId = -1;
       
   425     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   426     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   427     CleanupStack::PushL(privacy);
       
   428     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   429     qDebug()<<"error code  is  "<<error << " in testcase4";
       
   430     if (error == KErrNone)
       
   431         {
       
   432         if (requestId < 0)
       
   433             {
       
   434             User::Leave(KErrGeneral);
       
   435             }
       
   436         }
       
   437     else
       
   438         {
       
   439         User::Leave(KErrGeneral);
       
   440         }
       
   441     CleanupStack::PopAndDestroy(privacy);
       
   442     CleanupStack::PopAndDestroy(info);
       
   443     }
       
   444 
       
   445 //---------------------------------------------------------------------
       
   446 // PosNotificationTest::IssueNotificationRequest5L()
       
   447 // 
       
   448 //---------------------------------------------------------------------
       
   449 void PosNotificationTest::IssueNotificationRequest5L()
       
   450     {
       
   451     TInt result = KErrNone;
       
   452     // Create a new CPosGSMPrivacyRequestInfo object    
       
   453     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
   454     // Set Lcs client identified by url
       
   455     info->SetLCSClientL(KTxtRequestorURL,
       
   456             CPosGSMPrivacyRequestInfo::EIdTypeURL);
       
   457     // set the requestor identified by url
       
   458     info->SetRequestorL(KTxtRequestorURL,
       
   459             CPosGSMPrivacyRequestInfo::EIdTypeURL);
       
   460     // set request type to be single shot
       
   461     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   462 
       
   463     TInt requestId = -1;
       
   464     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   465     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   466     CleanupStack::PushL(privacy);
       
   467     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   468     if (error == KErrNone)
       
   469         {
       
   470         if (requestId < 0)
       
   471             {
       
   472             User::Leave(KErrGeneral);
       
   473             }
       
   474         }
       
   475     else
       
   476         {
       
   477         User::Leave(KErrGeneral);
       
   478         }
       
   479     CleanupStack::PopAndDestroy(privacy);
       
   480     CleanupStack::PopAndDestroy(info);
       
   481     }
       
   482 
       
   483 //---------------------------------------------------------------------
       
   484 // PosNotificationTest::IssueNotificationRequest6L()
       
   485 // 
       
   486 //---------------------------------------------------------------------
       
   487 void PosNotificationTest::IssueNotificationRequest6L()
       
   488     {
       
   489     TInt result = KErrNone;
       
   490     // Create a new CPosGSMPrivacyRequestInfo object    
       
   491     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
   492     // Set Lcs client identified by URL of user in a SIP session
       
   493     info->SetLCSClientL(KTxtRequestorSIPURL,
       
   494             CPosGSMPrivacyRequestInfo::EIdTypeSIPURL);
       
   495     // set the requestor identified by URL of user in a SIP session
       
   496     info->SetRequestorL(KTxtRequestorSIPURL,
       
   497             CPosGSMPrivacyRequestInfo::EIdTypeSIPURL);
       
   498     // set request type to be single shot
       
   499     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   500 
       
   501     TInt requestId = -1;
       
   502     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   503     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   504     CleanupStack::PushL(privacy);
       
   505     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   506     if (error == KErrNone)
       
   507         {
       
   508         if (requestId < 0)
       
   509             {
       
   510             User::Leave(KErrGeneral);
       
   511             }
       
   512         }
       
   513     else
       
   514         {
       
   515         User::Leave(KErrGeneral);
       
   516         }
       
   517     CleanupStack::PopAndDestroy(privacy);
       
   518     CleanupStack::PopAndDestroy(info);
       
   519     }
       
   520 
       
   521 //---------------------------------------------------------------------
       
   522 // PosNotificationTest::IssueNotificationRequest7L()
       
   523 // 
       
   524 //---------------------------------------------------------------------
       
   525 void PosNotificationTest::IssueNotificationRequest7L()
       
   526     {
       
   527     TInt result = KErrNone;
       
   528     // Create a new CPosGSMPrivacyRequestInfo object    
       
   529     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
   530     // Set Lcs client identified by user Identifier in an IP Multimedia Service session.
       
   531     info->SetLCSClientL(KTxtRequestorIMSPublicIdentity,
       
   532             CPosGSMPrivacyRequestInfo::EIdTypeIMSPublicIdentity);
       
   533     // set the requestor identified by Mobile Identification Number
       
   534     info->SetRequestorL(KTxtRequestorIMSPublicIdentity,
       
   535             CPosGSMPrivacyRequestInfo::EIdTypeIMSPublicIdentity);
       
   536     // set request type to be single shot
       
   537     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   538 
       
   539     TInt requestId = -1;
       
   540     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   541     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   542     CleanupStack::PushL(privacy);
       
   543     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   544     if (error == KErrNone)
       
   545         {
       
   546         if (requestId < 0)
       
   547             {
       
   548             User::Leave(KErrGeneral);
       
   549             }
       
   550         }
       
   551     else
       
   552         {
       
   553         User::Leave(KErrGeneral);
       
   554         }
       
   555     CleanupStack::PopAndDestroy(privacy);
       
   556     CleanupStack::PopAndDestroy(info);
       
   557     }
       
   558 //---------------------------------------------------------------------
       
   559 // PosNotificationTest::IssueNotificationRequest8L()
       
   560 // 
       
   561 //---------------------------------------------------------------------
       
   562 void PosNotificationTest::IssueNotificationRequest8L()
       
   563     {
       
   564     TInt result = KErrNone;
       
   565     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   566     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   567     // Set Lcs client identified by phone number
       
   568     info->SetLCSClientL(KTxtRequestorPhone,
       
   569             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
   570     // set the requestor identified by phone number
       
   571     info->SetRequestorL(KTxtRequestorPhone,
       
   572             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
   573     // set request type to be single shot
       
   574     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   575 
       
   576     TInt requestId = -1;
       
   577     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   578     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   579     CleanupStack::PushL(privacy);
       
   580     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   581     if (error == KErrNone)
       
   582         {
       
   583         if (requestId < 0)
       
   584             {
       
   585             User::Leave(KErrGeneral);
       
   586             }
       
   587         }
       
   588     else
       
   589         {
       
   590         User::Leave(KErrGeneral);
       
   591         }
       
   592     CleanupStack::PopAndDestroy(privacy);
       
   593     CleanupStack::PopAndDestroy(info);
       
   594     }
       
   595 
       
   596 //---------------------------------------------------------------------
       
   597 // PosNotificationTest::IssueNotificationRequest9L()
       
   598 // 
       
   599 //---------------------------------------------------------------------
       
   600 void PosNotificationTest::IssueNotificationRequest9L()
       
   601     {
       
   602     TInt result = KErrNone;
       
   603     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   604     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   605     // Set Lcs client identified by phone number
       
   606     info->SetLCSClientL(KTxtRequestorPhone,
       
   607             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
   608     // set the requestor identified by phone number
       
   609     info->SetRequestorL(KTxtRequestorPhone,
       
   610             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
   611     // set request type to be periodic
       
   612     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestPeriodic);
       
   613 
       
   614     TInt requestId = -1;
       
   615     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   616     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   617     CleanupStack::PushL(privacy);
       
   618     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   619     if (error == KErrNone)
       
   620         {
       
   621         if (requestId < 0)
       
   622             {
       
   623             User::Leave(KErrGeneral);
       
   624             }
       
   625         }
       
   626     else
       
   627         {
       
   628         User::Leave(KErrGeneral);
       
   629         }
       
   630 
       
   631     CleanupStack::PopAndDestroy(privacy);
       
   632     CleanupStack::PopAndDestroy(info);
       
   633     }
       
   634 
       
   635 //---------------------------------------------------------------------
       
   636 // PosNotificationTest::IssueNotificationRequest10L()
       
   637 // 
       
   638 //---------------------------------------------------------------------
       
   639 void PosNotificationTest::IssueNotificationRequest10L()
       
   640     {
       
   641     TInt result = KErrNone;
       
   642     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   643     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   644     // Set Lcs client identified by Logical name
       
   645     info->SetLCSClientL(KTxtRequestorName,
       
   646             CPosSUPLPrivacyRequestInfo::EIdTypeLogicalName);
       
   647     // set the requestor identified by Logical name
       
   648     info->SetRequestorL(KTxtRequestorName,
       
   649             CPosSUPLPrivacyRequestInfo::EIdTypeLogicalName);
       
   650     // set request type to be single shot
       
   651     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   652 
       
   653     TInt requestId = -1;
       
   654     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   655     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   656     CleanupStack::PushL(privacy);
       
   657     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   658     if (error == KErrNone)
       
   659         {
       
   660         if (requestId < 0)
       
   661             {
       
   662             User::Leave(KErrGeneral);
       
   663             }
       
   664         }
       
   665     else
       
   666         {
       
   667         User::Leave(KErrGeneral);
       
   668         }
       
   669     CleanupStack::PopAndDestroy(privacy);
       
   670     CleanupStack::PopAndDestroy(info);
       
   671     }
       
   672 
       
   673 //---------------------------------------------------------------------
       
   674 // PosNotificationTest::IssueNotificationRequest11L()
       
   675 // 
       
   676 //---------------------------------------------------------------------
       
   677 void PosNotificationTest::IssueNotificationRequest11L()
       
   678     {
       
   679     TInt result = KErrNone;
       
   680     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   681     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   682     // Set Lcs client identified by email
       
   683     info->SetLCSClientL(KTxtRequestorEmail,
       
   684             CPosSUPLPrivacyRequestInfo::EIdTypeEmailAddress);
       
   685     // set the requestor identified by email
       
   686     info->SetRequestorL(KTxtRequestorEmail,
       
   687             CPosSUPLPrivacyRequestInfo::EIdTypeEmailAddress);
       
   688     // set request type to be single shot
       
   689     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   690 
       
   691     TInt requestId = -1;
       
   692     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   693     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   694     CleanupStack::PushL(privacy);
       
   695     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   696     if (error == KErrNone)
       
   697         {
       
   698         if (requestId < 0)
       
   699             {
       
   700             User::Leave(KErrGeneral);
       
   701             }
       
   702         }
       
   703     else
       
   704         {
       
   705         User::Leave(KErrGeneral);
       
   706         }
       
   707 
       
   708     CleanupStack::PopAndDestroy(privacy);
       
   709     CleanupStack::PopAndDestroy(info);
       
   710     }
       
   711 
       
   712 //---------------------------------------------------------------------
       
   713 // PosNotificationTest::IssueNotificationRequest12L()
       
   714 // 
       
   715 //---------------------------------------------------------------------
       
   716 void PosNotificationTest::IssueNotificationRequest12L()
       
   717     {
       
   718     TInt result = KErrNone;
       
   719     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   720     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   721     // Set Lcs client identified by url
       
   722     info->SetLCSClientL(KTxtRequestorURL,
       
   723             CPosSUPLPrivacyRequestInfo::EIdTypeURL);
       
   724     // set the requestor identified by url
       
   725     info->SetRequestorL(KTxtRequestorURL,
       
   726             CPosSUPLPrivacyRequestInfo::EIdTypeURL);
       
   727     // set request type to be single shot
       
   728     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   729 
       
   730     TInt requestId = -1;
       
   731     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   732     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   733     CleanupStack::PushL(privacy);
       
   734     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   735     if (error == KErrNone)
       
   736         {
       
   737         if (requestId < 0)
       
   738             {
       
   739             User::Leave(KErrGeneral);
       
   740             }
       
   741         }
       
   742     else
       
   743         {
       
   744         User::Leave(KErrGeneral);
       
   745         }
       
   746     CleanupStack::PopAndDestroy(privacy);
       
   747     CleanupStack::PopAndDestroy(info);
       
   748     }
       
   749 
       
   750 //---------------------------------------------------------------------
       
   751 // PosNotificationTest::IssueNotificationRequest13L()
       
   752 // 
       
   753 //---------------------------------------------------------------------
       
   754 void PosNotificationTest::IssueNotificationRequest13L()
       
   755     {
       
   756     TInt result = KErrNone;
       
   757     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   758     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   759     // Set Lcs client identified by URL of user in a SIP session
       
   760     info->SetLCSClientL(KTxtRequestorSIPURL,
       
   761             CPosSUPLPrivacyRequestInfo::EIdTypeSIPURL);
       
   762     // set the requestor identified by URL of user in a SIP session
       
   763     info->SetRequestorL(KTxtRequestorSIPURL,
       
   764             CPosSUPLPrivacyRequestInfo::EIdTypeSIPURL);
       
   765     // set request type to be single shot
       
   766     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   767 
       
   768     TInt requestId = -1;
       
   769     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   770     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   771     CleanupStack::PushL(privacy);
       
   772     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   773     if (error == KErrNone)
       
   774         {
       
   775         if (requestId < 0)
       
   776             {
       
   777             User::Leave(KErrGeneral);
       
   778             }
       
   779         }
       
   780     else
       
   781         {
       
   782         User::Leave(KErrGeneral);
       
   783         }
       
   784     CleanupStack::PopAndDestroy(privacy);
       
   785     CleanupStack::PopAndDestroy(info);
       
   786     }
       
   787 
       
   788 //---------------------------------------------------------------------
       
   789 // PosNotificationTest::IssueNotificationRequest14L()
       
   790 // 
       
   791 //---------------------------------------------------------------------
       
   792 void PosNotificationTest::IssueNotificationRequest14L()
       
   793     {
       
   794     TInt result = KErrNone;
       
   795     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   796     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   797     // Set Lcs client identified by Mobile Identification Number
       
   798     info->SetLCSClientL(KTxtRequestorMIN,
       
   799             CPosSUPLPrivacyRequestInfo::EIdTypeMIN);
       
   800     // set the requestor identified by Mobile Identification Number
       
   801     info->SetRequestorL(KTxtRequestorMIN,
       
   802             CPosSUPLPrivacyRequestInfo::EIdTypeMIN);
       
   803     // set request type to be single shot
       
   804     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   805 
       
   806     TInt requestId = -1;
       
   807     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   808     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   809     CleanupStack::PushL(privacy);
       
   810     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   811     if (error == KErrNone)
       
   812         {
       
   813         if (requestId < 0)
       
   814             {
       
   815             User::Leave(KErrGeneral);
       
   816             }
       
   817         }
       
   818     else
       
   819         {
       
   820         User::Leave(KErrGeneral);
       
   821         }
       
   822     CleanupStack::PopAndDestroy(privacy);
       
   823     CleanupStack::PopAndDestroy(info);
       
   824     }
       
   825 
       
   826 //---------------------------------------------------------------------
       
   827 // PosNotificationTest::IssueNotificationRequest15L()
       
   828 // 
       
   829 //---------------------------------------------------------------------
       
   830 void PosNotificationTest::IssueNotificationRequest15L()
       
   831     {
       
   832     TInt result = KErrNone;
       
   833     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   834     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   835     // Set Lcs client identified by Mobile Directory Number
       
   836     info->SetLCSClientL(KTxtRequestorMDN,
       
   837             CPosSUPLPrivacyRequestInfo::EIdTypeMDN);
       
   838     // set the requestor identified by Mobile Directory Number
       
   839     info->SetRequestorL(KTxtRequestorMDN,
       
   840             CPosSUPLPrivacyRequestInfo::EIdTypeMDN);
       
   841     // set request type to be single shot
       
   842     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   843 
       
   844     TInt requestId = -1;
       
   845     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   846     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   847     CleanupStack::PushL(privacy);
       
   848     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   849     if (error == KErrNone)
       
   850         {
       
   851         if (requestId < 0)
       
   852             {
       
   853             User::Leave(KErrGeneral);
       
   854             }
       
   855         }
       
   856     else
       
   857         {
       
   858         User::Leave(KErrGeneral);
       
   859         }
       
   860     CleanupStack::PopAndDestroy(privacy);
       
   861     CleanupStack::PopAndDestroy(info);
       
   862     }
       
   863 
       
   864 //---------------------------------------------------------------------
       
   865 // PosNotificationTest::IssueNotificationRequest16L()
       
   866 // 
       
   867 //---------------------------------------------------------------------
       
   868 void PosNotificationTest::IssueNotificationRequest16L()
       
   869     {
       
   870     TInt result = KErrNone;
       
   871     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   872     CPosSUPLPrivacyRequestInfo* info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   873     // Set Lcs client identified by user Identifier in an IP Multimedia Service session.
       
   874     info->SetLCSClientL(KTxtRequestorIMSPublicIdentity,
       
   875             CPosSUPLPrivacyRequestInfo::EIdTypeIMSPublicIdentity);
       
   876     // set the requestor identified by Mobile Identification Number
       
   877     info->SetRequestorL(KTxtRequestorIMSPublicIdentity,
       
   878             CPosSUPLPrivacyRequestInfo::EIdTypeIMSPublicIdentity);
       
   879     // set request type to be single shot
       
   880     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   881 
       
   882     TInt requestId = -1;
       
   883     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   884     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   885     CleanupStack::PushL(privacy);
       
   886     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   887     if (error == KErrNone)
       
   888         {
       
   889         if (requestId < 0)
       
   890             {
       
   891             User::Leave(KErrGeneral);
       
   892             }
       
   893         }
       
   894     else
       
   895         {
       
   896         User::Leave(KErrGeneral);
       
   897         }
       
   898     CleanupStack::PopAndDestroy(privacy);
       
   899     CleanupStack::PopAndDestroy(info);
       
   900     }
       
   901 
       
   902 //---------------------------------------------------------------------
       
   903 // PosNotificationTest::IssueNotificationRequest17L()
       
   904 // 
       
   905 //---------------------------------------------------------------------
       
   906 void PosNotificationTest::IssueNotificationRequest17L()
       
   907     {
       
   908     TInt result = KErrNone;
       
   909     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   910     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   911     // set request type to be single shot
       
   912     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   913 
       
   914     TInt requestId = -1;
       
   915     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   916     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   917     CleanupStack::PushL(privacy);
       
   918     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   919     if (error == KErrNone)
       
   920         {
       
   921         if (requestId < 0)
       
   922             {
       
   923             User::Leave(KErrGeneral);
       
   924             }
       
   925         }
       
   926     else
       
   927         {
       
   928         User::Leave(KErrGeneral);
       
   929         }
       
   930     CleanupStack::PopAndDestroy(privacy);
       
   931     CleanupStack::PopAndDestroy(info);
       
   932     }
       
   933 
       
   934 //---------------------------------------------------------------------
       
   935 // PosNotificationTest::IssueNotificationRequest18L()
       
   936 // 
       
   937 //---------------------------------------------------------------------
       
   938 void PosNotificationTest::IssueNotificationRequest18L()
       
   939     {
       
   940     TInt result = KErrNone;
       
   941     // Create a new CPosSUPLPrivacyRequestInfo object    
       
   942     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
   943     // Set Lcs client identified by phone number
       
   944     info->SetLCSClientL(KTxtLongRequestorName,
       
   945             CPosSUPLPrivacyRequestInfo::EIdTypeLogicalName);
       
   946     // set the requestor identified by phone number
       
   947     info->SetRequestorL(KTxtLongRequestorName,
       
   948             CPosSUPLPrivacyRequestInfo::EIdTypeLogicalName);
       
   949     // set request type to be single shot
       
   950     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   951 
       
   952     TInt requestId = -1;
       
   953     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
   954     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   955     CleanupStack::PushL(privacy);
       
   956     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
   957     if (error == KErrNone)
       
   958         {
       
   959         if (requestId < 0)
       
   960             {
       
   961             User::Leave(KErrGeneral);
       
   962             }
       
   963         }
       
   964     else
       
   965         {
       
   966         User::Leave(KErrGeneral);
       
   967         }
       
   968     CleanupStack::PopAndDestroy(privacy);
       
   969     CleanupStack::PopAndDestroy(info);
       
   970     }
       
   971 
       
   972 //---------------------------------------------------------------------
       
   973 // PosNotificationTest::IssueNotifyVerificationTimeOut1L()
       
   974 // 
       
   975 //---------------------------------------------------------------------
       
   976 void PosNotificationTest::IssueNotifyVerificationTimeOut1L()
       
   977     {
       
   978     qDebug() << "IssueNotifyVerificationTimeOut1L - IN";
       
   979     TInt result = KErrNone;
       
   980     // Create a new CPosGSMPrivacyRequestInfo object    
       
   981     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
   982     // Set Lcs client identified by phone number
       
   983     info->SetLCSClientL(KTxtRequestorPhone,
       
   984             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
   985     // set the requestor identified by phone number
       
   986     info->SetRequestorL(KTxtRequestorPhone,
       
   987             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
   988     // set request type to be single shot
       
   989     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
   990 
       
   991     TInt requestId = 123;
       
   992     // create an instance of CPosNetworkPrivacy used to issue the notify verifiaiton timeout
       
   993     // with default decision as accepted
       
   994     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
   995     CleanupStack::PushL(privacy);
       
   996     // issue a verify location request
       
   997   //  TRAPD( err,privacy->VerifyLocationRequestL(*info,requestId,*this,CPosNetworkPrivacy::EDecisionAccepted));
       
   998     
       
   999     TRAPD(error,privacy->NotifyVerificationTimeoutL(*info, requestId,CPosNetworkPrivacy::EDecisionAccepted));
       
  1000 
       
  1001  //   if( err == KErrNone )
       
  1002  //       {
       
  1003  //       mEventLoop.exec();
       
  1004  //       }
       
  1005     qDebug() << " After NotifyVerificationTimeoutL error = " << error;
       
  1006     if (error == KErrNone)
       
  1007         {
       
  1008         if (requestId < 0)
       
  1009             {
       
  1010             User::Leave(KErrGeneral);
       
  1011             }
       
  1012         }
       
  1013     else
       
  1014         {
       
  1015         User::Leave(KErrGeneral);
       
  1016         }
       
  1017     CleanupStack::PopAndDestroy(privacy);
       
  1018     CleanupStack::PopAndDestroy(info);
       
  1019     }
       
  1020 
       
  1021 //---------------------------------------------------------------------
       
  1022 // PosNotificationTest::IssueNotifyVerificationTimeOut2L()
       
  1023 // 
       
  1024 //---------------------------------------------------------------------
       
  1025 void PosNotificationTest::IssueNotifyVerificationTimeOut2L()
       
  1026     {
       
  1027     TInt result = KErrNone;
       
  1028     // Create a new CPosGSMPrivacyRequestInfo object    
       
  1029     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
  1030     // Set Lcs client identified by phone number
       
  1031     info->SetLCSClientL(KTxtRequestorPhone,
       
  1032             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
  1033     // set the requestor identified by phone number
       
  1034     info->SetRequestorL(KTxtRequestorPhone,
       
  1035             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
  1036     // set request type to be single shot
       
  1037     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
  1038 
       
  1039     TInt requestId = 123;
       
  1040     // create an instance of CPosNetworkPrivacy used to issue the notify verifiaiton timeout
       
  1041     // with default decision as rejected
       
  1042     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
  1043     CleanupStack::PushL(privacy);
       
  1044     // issue a verify location request
       
  1045   //  TRAPD( err,privacy->VerifyLocationRequestL(*info,requestId,*this,CPosNetworkPrivacy::EDecisionRejected));
       
  1046 
       
  1047     TRAPD(error,privacy->NotifyVerificationTimeoutL(*info, requestId,CPosNetworkPrivacy::EDecisionRejected));
       
  1048 
       
  1049   //  if( err == KErrNone )
       
  1050   //      {
       
  1051   //      mEventLoop.exec();
       
  1052   //      }
       
  1053 
       
  1054     if (error == KErrNone)
       
  1055         {
       
  1056         if (requestId < 0)
       
  1057             {
       
  1058             User::Leave(KErrGeneral);
       
  1059             }
       
  1060         }
       
  1061     else
       
  1062         {
       
  1063         User::Leave(KErrGeneral);
       
  1064         }
       
  1065     CleanupStack::PopAndDestroy(privacy);
       
  1066     CleanupStack::PopAndDestroy(info);
       
  1067     }
       
  1068 
       
  1069 //---------------------------------------------------------------------
       
  1070 // PosNotificationTest::IssueNotifyVerificationTimeOut3L()
       
  1071 // 
       
  1072 //---------------------------------------------------------------------
       
  1073 void PosNotificationTest::IssueNotifyVerificationTimeOut3L()
       
  1074     {
       
  1075     TInt result = KErrNone;
       
  1076     // Create a new CPosSUPLPrivacyRequestInfo object    
       
  1077     CPosSUPLPrivacyRequestInfo* info = CPosSUPLPrivacyRequestInfo::NewLC();
       
  1078     // Set Lcs client identified by phone number
       
  1079     info->SetLCSClientL(KTxtRequestorPhone,
       
  1080             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
  1081     // set the requestor identified by phone number
       
  1082     info->SetRequestorL(KTxtRequestorPhone,
       
  1083             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
  1084     // set request type to be single shot
       
  1085     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
  1086 
       
  1087     TInt requestId = 123 ;
       
  1088     // create an instance of CPosNetworkPrivacy used to issue the notify verifiaiton timeout
       
  1089     // with default decision as accepted
       
  1090     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
  1091     CleanupStack::PushL(privacy);
       
  1092     // issue a verify location request
       
  1093  //   TRAPD( err,privacy->VerifyLocationRequestL(*info,requestId,*this,CPosNetworkPrivacy::EDecisionAccepted));
       
  1094 
       
  1095     TRAPD(error,privacy->NotifyVerificationTimeoutL(*info, requestId,CPosNetworkPrivacy::EDecisionAccepted));
       
  1096   //  if( err == KErrNone )
       
  1097    //     {
       
  1098    //     mEventLoop.exec();
       
  1099    //     }
       
  1100 
       
  1101     if (error == KErrNone)
       
  1102         {
       
  1103         if (requestId < 0)
       
  1104             {
       
  1105             User::Leave(KErrGeneral);
       
  1106             }
       
  1107         }
       
  1108     else
       
  1109         {
       
  1110         User::Leave(KErrGeneral);
       
  1111         }
       
  1112     CleanupStack::PopAndDestroy(privacy);
       
  1113     CleanupStack::PopAndDestroy(info);
       
  1114     }
       
  1115 
       
  1116 //---------------------------------------------------------------------
       
  1117 // PosNotificationTest::IssueNotifyVerificationTimeOut4L()
       
  1118 // 
       
  1119 //---------------------------------------------------------------------
       
  1120 void PosNotificationTest::IssueNotifyVerificationTimeOut4L()
       
  1121     {
       
  1122     TInt result = KErrNone;
       
  1123     // Create a new CPosSUPLPrivacyRequestInfo object    
       
  1124     CPosSUPLPrivacyRequestInfo* info = CPosSUPLPrivacyRequestInfo::NewLC();
       
  1125     // Set Lcs client identified by phone number
       
  1126     info->SetLCSClientL(KTxtRequestorPhone,
       
  1127             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
  1128     // set the requestor identified by phone number
       
  1129     info->SetRequestorL(KTxtRequestorPhone,
       
  1130             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
  1131     // set request type to be single shot
       
  1132     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
  1133 
       
  1134     TInt requestId = 123;
       
  1135     // create an instance of CPosNetworkPrivacy used to issue the notify verifiaiton timeout
       
  1136     // with default decision as rejected
       
  1137     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
  1138     CleanupStack::PushL(privacy);
       
  1139     // issue a verify location request
       
  1140   //  TRAPD( err,privacy->VerifyLocationRequestL(*info,requestId,*this,CPosNetworkPrivacy::EDecisionRejected));
       
  1141 
       
  1142     TRAPD(error,privacy->NotifyVerificationTimeoutL(*info, requestId,CPosNetworkPrivacy::EDecisionRejected));
       
  1143  //   if( err == KErrNone )
       
  1144  //       {
       
  1145  //       mEventLoop.exec();
       
  1146  //       }
       
  1147 
       
  1148     if (error == KErrNone)
       
  1149         {
       
  1150         if (requestId < 0)
       
  1151             {
       
  1152             User::Leave(KErrGeneral);
       
  1153             }
       
  1154         }
       
  1155     else
       
  1156         {
       
  1157         User::Leave(KErrGeneral);
       
  1158         }
       
  1159     CleanupStack::PopAndDestroy(privacy);
       
  1160     CleanupStack::PopAndDestroy(info);
       
  1161     }
       
  1162 
       
  1163 //---------------------------------------------------------------------
       
  1164 // PosNotificationTest::IssueMultipleRequests1L()
       
  1165 // 
       
  1166 //---------------------------------------------------------------------
       
  1167 void PosNotificationTest::IssueMultipleRequests1L()
       
  1168     {
       
  1169     TInt result = KErrNone;
       
  1170     // Create a new CPosSUPLPrivacyRequestInfo object    
       
  1171     CPosSUPLPrivacyRequestInfo * info = CPosSUPLPrivacyRequestInfo::NewLC();
       
  1172     // Set Lcs client identified by phone number
       
  1173     info->SetLCSClientL(KTxtRequestorPhone,
       
  1174             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
  1175     // set the requestor identified by phone number
       
  1176     info->SetRequestorL(KTxtRequestorPhone,
       
  1177             CPosSUPLPrivacyRequestInfo::EIdTypeMSISDN);
       
  1178     // set request type to be single shot
       
  1179     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
  1180 
       
  1181     // Create another new CPosSUPLPrivacyRequestInfo object    
       
  1182     CPosSUPLPrivacyRequestInfo * info1 = CPosSUPLPrivacyRequestInfo::NewLC();
       
  1183     // Set Lcs client identified by phone number
       
  1184     info1->SetLCSClientL(KTxtRequestorName,
       
  1185             CPosSUPLPrivacyRequestInfo::EIdTypeLogicalName);
       
  1186     // set the requestor identified by phone number
       
  1187     info1->SetRequestorL(KTxtRequestorName,
       
  1188             CPosSUPLPrivacyRequestInfo::EIdTypeLogicalName);
       
  1189     // set request type to be single shot
       
  1190     info1->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
  1191 
       
  1192     TInt requestId = -1;
       
  1193     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
  1194     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
  1195     CleanupStack::PushL(privacy);
       
  1196     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
  1197     if (error == KErrNone)
       
  1198         {
       
  1199         if (requestId > 0)
       
  1200             {
       
  1201             // issue the same request again
       
  1202             TRAPD(error1,privacy->NotifyLocationRequestL(*info1, requestId));
       
  1203             if (error1 == KErrNone)
       
  1204                 {
       
  1205                 if (requestId > 0)
       
  1206                     {
       
  1207                     result = KErrNone;
       
  1208                     }
       
  1209                 else
       
  1210                     {
       
  1211                     result = KErrGeneral;
       
  1212                     }
       
  1213                 }
       
  1214             else
       
  1215                 {
       
  1216                 result = error1;
       
  1217                 }
       
  1218             }
       
  1219         else
       
  1220             {
       
  1221             result = KErrGeneral;
       
  1222             }
       
  1223         }
       
  1224     else
       
  1225         {
       
  1226         result = error;
       
  1227         }
       
  1228     CleanupStack::PopAndDestroy(privacy);
       
  1229     CleanupStack::PopAndDestroy(info1);
       
  1230     CleanupStack::PopAndDestroy(info);
       
  1231     User::Leave(result);
       
  1232     }
       
  1233 
       
  1234 //---------------------------------------------------------------------
       
  1235 // PosNotificationTest::IssueMultipleRequests2L()
       
  1236 // 
       
  1237 //---------------------------------------------------------------------
       
  1238 void PosNotificationTest::IssueMultipleRequests2L()
       
  1239     {
       
  1240     TInt result = KErrNone;
       
  1241     // Create a new CPosGSMPrivacyRequestInfo object    
       
  1242     CPosGSMPrivacyRequestInfo* info = CPosGSMPrivacyRequestInfo::NewLC();
       
  1243     // Set Lcs client identified by phone number
       
  1244     info->SetLCSClientL(KTxtRequestorPhone,
       
  1245             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
  1246     // set the requestor identified by phone number
       
  1247     info->SetRequestorL(KTxtRequestorPhone,
       
  1248             CPosGSMPrivacyRequestInfo::EIdTypeMSISDN);
       
  1249     // set request type to be single shot
       
  1250     info->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
  1251 
       
  1252     // Create another new CPosGSMPrivacyRequestInfo object    
       
  1253     CPosGSMPrivacyRequestInfo* info1 = CPosGSMPrivacyRequestInfo::NewLC();
       
  1254     // Set Lcs client identified by phone number
       
  1255     info1->SetLCSClientL(KTxtRequestorName,
       
  1256             CPosGSMPrivacyRequestInfo::EIdTypeLogicalName);
       
  1257     // set the requestor identified by phone number
       
  1258     info1->SetRequestorL(KTxtRequestorName,
       
  1259             CPosGSMPrivacyRequestInfo::EIdTypeLogicalName);
       
  1260     // set request type to be single shot
       
  1261     info1->SetRequestType(CPosNetworkPrivacyRequestInfo::ERequestSingleShot);
       
  1262 
       
  1263     TInt requestId = -1;
       
  1264     TInt requestId1 = -1;
       
  1265     // create an instance of CPosNetworkPrivacy used to issue the notification request
       
  1266     CPosNetworkPrivacy* privacy = CPosNetworkPrivacy::NewL();
       
  1267     CleanupStack::PushL(privacy);
       
  1268     // create another instance of CPosNetworkPrivacy used to issue the second notification request
       
  1269     CPosNetworkPrivacy* privacy1 = CPosNetworkPrivacy::NewL();
       
  1270     CleanupStack::PushL(privacy1);
       
  1271     TRAPD(error,privacy->NotifyLocationRequestL(*info, requestId));
       
  1272     TRAPD(error1,privacy1->NotifyLocationRequestL(*info1, requestId1));
       
  1273 
       
  1274     if (error == KErrNone && error1 == KErrNone)
       
  1275         {
       
  1276         if (requestId > 0 && requestId1 > 0)
       
  1277             {
       
  1278             result = KErrNone;
       
  1279             }
       
  1280         else
       
  1281             {
       
  1282             result = KErrGeneral;
       
  1283             }
       
  1284         }
       
  1285     else
       
  1286         {
       
  1287         result = KErrGeneral;
       
  1288         }
       
  1289     CleanupStack::PopAndDestroy(privacy1);
       
  1290     CleanupStack::PopAndDestroy(privacy);
       
  1291     CleanupStack::PopAndDestroy(info1);
       
  1292     CleanupStack::PopAndDestroy(info);
       
  1293     User::Leave(result);
       
  1294     }
       
  1295 
       
  1296 QTEST_MAIN_S60(PosNotificationTest)
       
  1297