systemhealthmanagement/systemhealthmgr/test/tsysmon/src/sysmontesthelper.h
changeset 0 4e1aa6a622a0
child 21 ccb4f6b3db21
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @test
       
    19  @internalComponent - Internal Symbian test code   
       
    20 */
       
    21 
       
    22 #ifndef __SYSMONTESTHELPER_H__
       
    23 #define __SYSMONTESTHELPER_H__
       
    24 
       
    25 #include <bacline.h> 		// Command line arguments parser
       
    26 #include <sysmonclisess.h>	//SysMon Client
       
    27 #include <startup.hrh>
       
    28 #include <startupproperties.h>
       
    29 #include <e32std.h>
       
    30 #include <e32err.h>
       
    31 #include <e32base.h>
       
    32 
       
    33 #include <e32debug.h> 		// Debug output
       
    34 
       
    35 
       
    36 _LIT(KFilenameDeregTimeout, "tsysmon_app_deregister.exe");
       
    37 _LIT(KFilenameRegisterTwice1, "tsysmon_app_registertwice1proc.exe");
       
    38 _LIT(KFilenameRegisterTwice2, "tsysmon_app_registertwice2procs.exe");
       
    39 _LIT(KFilenameDoNothing, "tsysmon_app_donothing.exe");
       
    40 
       
    41 _LIT(KResultsRoot, "C:\\testdata\\results\\");
       
    42 _LIT(KResultsRootDereg, "C:\\testdata\\results\\dereg_");
       
    43 _LIT(KRunCountsRoot, "C:\\testdata\\runcounts\\");
       
    44 _LIT(KTxtExtension, ".txt");
       
    45 
       
    46 _LIT(KRegisterCountFile, "C:\\Register_ResultFile.txt");
       
    47 _LIT(KRestartCountFile, "C:\\Restart_ResultFile.txt");
       
    48 
       
    49 const TInt KMaxTestIdLength = 20; // TestId is of the format APPFWK-SYSMON-00xx
       
    50 
       
    51 class CSysMonTestHelper : public CBase
       
    52 	{
       
    53 public:
       
    54 	IMPORT_C static TRecoveryMethod StringToRecoveryMethodL(const TDesC& aRecoveryMethodString);
       
    55 	IMPORT_C static void GetResultIntL(const TDesC& aTestId, TInt& aResult);
       
    56 	IMPORT_C static void GetDeregResultIntL(const TDesC& aTestId, TInt& aResult);
       
    57 	IMPORT_C static TInt ReadRunCountL(const TDesC& aProcessFilename);
       
    58 	IMPORT_C static void IncrementRunCountL(const TDesC& aProcessFilename);
       
    59 	IMPORT_C static TInt GetRestartCountL();
       
    60 	IMPORT_C static TInt GetRegisterCountL();
       
    61 	
       
    62 	IMPORT_C static CSysMonTestHelper* NewLC();
       
    63 	IMPORT_C static CSysMonTestHelper* NewL();
       
    64 	IMPORT_C ~CSysMonTestHelper();
       
    65 	
       
    66 	IMPORT_C void GetRecoveryMethodArgsL(TRecoveryMethod& aRecoveryMethod, TInt& aRecoveryMode);
       
    67 	IMPORT_C void GetTimeoutArgL(TInt& aTimeout);
       
    68 	IMPORT_C void WriteResultL(const TInt& aResult);
       
    69 	IMPORT_C void WriteDeregResultL(const TInt& aResult);
       
    70 	IMPORT_C void GetTestId(TDes& aTestId);
       
    71 	
       
    72 	IMPORT_C void TestErrorcodeL(TInt& aErrorcode);
       
    73 	
       
    74 private:
       
    75 	void ConstructL();
       
    76 	CSysMonTestHelper();
       
    77 
       
    78 private:
       
    79 	TBufC<KMaxTestIdLength> iTestId; 
       
    80 	CCommandLineArguments* iArgs;
       
    81 	
       
    82 	};
       
    83 	
       
    84 #endif  // __SYSMONTESTHELPER_H__