adaptationlayer/tsy/simatktsy_dll/internal/test/simatktsy_testtool/simatk/inc/simatk.h
changeset 4 510c70acdbf6
parent 3 1972d8c2e329
child 5 8ccc39f9d787
equal deleted inserted replaced
3:1972d8c2e329 4:510c70acdbf6
     1 /*
       
     2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Specific class for SIM ATK TSY tests
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef SIMATK_H
       
    22 #define SIMATK_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include "core.h"
       
    26 #include "satsimsessionend.h"
       
    27 
       
    28 #include <etelsat.h>
       
    29 #include <risctestcontrol.h>
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CSatBase;
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38 *  CSimAtk test class for STIF Test Framework TestScripter.
       
    39 *  @lib SimAtk.dll
       
    40 */
       
    41 NONSHARABLE_CLASS( CSimAtk ) : public CSimAtkCore
       
    42     {
       
    43     public:  // Constructors and destructor
       
    44         
       
    45         /**
       
    46         * Two-phased constructor.
       
    47         */
       
    48         static CSimAtk* NewL( CTestModuleIf& aTestModuleIf );
       
    49         
       
    50         /**
       
    51         * Destructor.
       
    52         */
       
    53         virtual ~CSimAtk();
       
    54         
       
    55 
       
    56 	public: // New functions
       
    57         
       
    58         /**
       
    59         * Creates proper test class based on the received IPC and notifies SAT
       
    60         * @param aReqStatus async call status
       
    61         * @param aNotifyIpc IPC of notify to be notified
       
    62         * @return:Symbian OS error Code
       
    63         */
       
    64         virtual TInt NotifySimAtkL( TRequestStatus& aReqStatus,
       
    65             const TSatIpc& aNotifyIpc );
       
    66         
       
    67         /**
       
    68         * Cancels Notify
       
    69         * @param aSatIpc IPC of the notify to be cancelled
       
    70         * @return:Symbian OS error Code
       
    71         */                 
       
    72         virtual TInt NotifySimAtkCancel( const TSatIpc& aNotify );
       
    73         
       
    74 
       
    75     public: // Functions from base classes
       
    76     
       
    77         /**
       
    78         * From CScriptBase Runs a script line.
       
    79         * @param aItem Script line containing method name and parameters
       
    80         * @return Symbian OS error code
       
    81         */
       
    82         TInt RunMethodL( CStifItemParser& aItem );
       
    83 
       
    84       
       
    85     private:
       
    86 
       
    87         /**
       
    88         * C++ default constructor.
       
    89         */
       
    90         CSimAtk( CTestModuleIf& aTestModuleIf );
       
    91         
       
    92         /**
       
    93         * By default Symbian 2nd phase constructor is private.
       
    94         */
       
    95         void ConstructL();
       
    96 
       
    97         /**
       
    98         * Frees all resources allocated from test methods.
       
    99         */
       
   100         void Delete();
       
   101 
       
   102         /**
       
   103         * Open function for Sim Atk specific services. If parameter is 
       
   104         * unidentified, base classes Open-method is called.
       
   105         * @param aItem Script line containing method name and parameters
       
   106         * @return Symbian OS error code
       
   107         */
       
   108         TInt Open( CStifItemParser& aItem );
       
   109         
       
   110         /**
       
   111         * Specific Close for SIM class.
       
   112         * If not found Core close called
       
   113         * @param aItem Script line containing method name and parameters
       
   114         * @return Symbian OS error code
       
   115         */
       
   116         TInt Close( CStifItemParser& aItem );
       
   117 
       
   118         /**
       
   119         * Loads XML file which contains ISC simulating test cases
       
   120         * If not found Core open called
       
   121         * @param aItem Script line containing method name and parameters
       
   122         * @return Symbian OS error code
       
   123         */
       
   124         TInt LoadIscTests( CStifItemParser& aItem );
       
   125         
       
   126         /**
       
   127         * Runs a test case from ISC XML file. Usually this is used for
       
   128         * simulating ISI messages.
       
   129         * If not found Core open called
       
   130         * @param aItem Script line containing method name and parameters
       
   131         * @return Symbian OS error code
       
   132         */
       
   133         TInt RunIscTestCase( CStifItemParser& aItem );
       
   134         
       
   135         /**
       
   136         * Syncs a test case from ISC XML file. 
       
   137         * If not found Core open called
       
   138         * @param aItem Script line containing method name and parameters
       
   139         * @return Symbian OS error code
       
   140         */
       
   141         TInt SyncIscTestCase( CStifItemParser& aItem );
       
   142         
       
   143         /**
       
   144         * Cancel on-going test case from test client. 
       
   145         * If not found Core open called
       
   146         * @param aReason Symbien error code that cased the cancellation
       
   147         * @return Symbian OS error code
       
   148         */
       
   149         TInt CancelTestCase( const TInt aReason );
       
   150         
       
   151         /**
       
   152         * Cancel on-going test case from ISC XML file. 
       
   153         * If not found Core open called
       
   154         * @param aItem Script line containing method name and parameters
       
   155         * @return Symbian OS error code
       
   156         */
       
   157         TInt CancelTestCase( CStifItemParser& aItem );
       
   158         
       
   159         /**
       
   160         * Analyzes a content of Etel packet
       
   161         * If not found Core open called
       
   162         * @param aItem Script line containing method name and parameters
       
   163         * @return Symbian OS error code
       
   164         */
       
   165         TInt CheckData( CStifItemParser& aItem );
       
   166         
       
   167         /**
       
   168         * Sends a data packet to the ETel. Packet can be for example a
       
   169         * terminal response or an envelope.
       
   170         * If not found Core open called
       
   171         * @param aItem Script line containing method name and parameters
       
   172         * @return Symbian OS error code
       
   173         */
       
   174         TInt SendResponse( CStifItemParser& aItem );
       
   175         
       
   176         /**
       
   177         * Verifies the functionality of icon loading procedure
       
   178         * If not found Core open called
       
   179         * @param aItem Script line containing method name and parameters
       
   180         * @return Symbian OS error code
       
   181         */
       
   182         TInt CheckIcon( CStifItemParser& aItem );
       
   183 
       
   184         /**
       
   185         * Halts the execution until an async request is completed. Once request
       
   186         * has been completed, command array is cleared and Sat notifications 
       
   187         * cancelled.
       
   188         * If not found Core open called
       
   189         * @param aItem Script line containing method name and parameters
       
   190         * @return Symbian OS error code or Error code from ISC controller
       
   191         */
       
   192         TInt WaitForRequest( CStifItemParser& aItem  );
       
   193         
       
   194         /**
       
   195         * Delay
       
   196         * If not found Core open called
       
   197         * @param aItem Script line containing method name and parameters
       
   198         * @return Symbian OS error code or Error code from ISC controller
       
   199         */
       
   200         TInt Delay( CStifItemParser& aItem  );
       
   201         
       
   202         /**
       
   203         * Finds the index of requested item in notify array based on
       
   204         * the string provided by a test script
       
   205         * @param aItem Script line containing requested sat item.
       
   206         * @param aIndex Index of requested command in array if found
       
   207         * @return Symbian OS error code KErrNone or KErrNotFound
       
   208         */
       
   209         TInt FindIndex( CStifItemParser& aItem, TInt& aIndex);
       
   210         
       
   211         /**
       
   212         * Finds the index of requested item in notify array based on
       
   213         * the ipc of item.
       
   214         * @param aRequestedIpc Ipc of requested sat item.
       
   215         * @param aIndex Index of requested command in array if found
       
   216         * @return Symbian OS error code KErrNone or KErrNotFound
       
   217         */
       
   218         TInt FindIndex( const TSatIpc& aRequestedIpc, TInt& aIndex);
       
   219         
       
   220         /**
       
   221         * Helper function that maps an error code to corresponding string
       
   222         * presentation
       
   223         * @return Descriptor to a string presentatation of error
       
   224         */
       
   225         const TPtrC MapErrorCodeToString( const TInt& aErrorCode );
       
   226         
       
   227         
       
   228     private:    // Data
       
   229             
       
   230         /**
       
   231         * ISC control async call status
       
   232         */
       
   233         TRequestStatus                    	iIscStatus;
       
   234         
       
   235         /**
       
   236         * Used for simulating ISI messages
       
   237         */
       
   238         RIscTestControl                     iRIscTestControl;
       
   239       
       
   240         /**
       
   241         * RSat object
       
   242         */
       
   243         RSat                                iSat;
       
   244         
       
   245         /**
       
   246         * RMobileSmsMessaging object
       
   247         */
       
   248         RMobileSmsMessaging                 iSmsMessaging;
       
   249         
       
   250         /**
       
   251         * Proactive commands to be tested
       
   252         */
       
   253         CArrayPtrFlat<CSatBase>*            iArray;
       
   254         
       
   255         /**        
       
   256         * SimSession end class
       
   257         */   
       
   258         CSatSimSessionEnd                   iSessionEnd;
       
   259 
       
   260         /**
       
   261         * Flag to keep track wether the SessionEnd is required or not
       
   262         */
       
   263         TBool                               iNeedSessionEnd;
       
   264         
       
   265         /**
       
   266         * Pointer to stif parser
       
   267         */
       
   268         CStifItemParser*                    iParser;
       
   269         
       
   270         /**
       
   271         * Pointer of CallControl class
       
   272         */
       
   273         CSatBase*                           iCallControl;
       
   274     };
       
   275 
       
   276 #endif      // SIMATK_H
       
   277             
       
   278 // End of File