installationservices/swtransactionservices/test/inc/tststestsuitestepcommon.h
branchRCL_3
changeset 25 7333d7932ef7
equal deleted inserted replaced
24:5cc91383ab1e 25:7333d7932ef7
       
     1 /*
       
     2 * Copyright (c) 2008-2009 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: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 /**
       
    20  @file
       
    21  @test
       
    22  @internalComponent
       
    23 */
       
    24 
       
    25 #ifndef __TSTSTESTSUITESTEPCOMMON_H__
       
    26 #define __TSTSTESTSUITESTEPCOMMON_H__
       
    27 #include <e32cmn.h>
       
    28 #include <e32def.h>
       
    29 #include <f32file.h>
       
    30 
       
    31 //ini item names
       
    32 /**
       
    33  Name of the item that defines which transaction slot is to be used in CStsTestServer
       
    34  Value can range from 0 to CStsTestServer::maxNumberOfTransactions-1
       
    35  Usage: <KTransactionSlot>=<slot>   e.g: TrSlot=0 or TrSlot=1 etc...
       
    36  */
       
    37 _LIT(KTransactionSlot,	"trslot");
       
    38 
       
    39 /**
       
    40  Name of the item that defines the fully qualified name of the target file
       
    41  Usage: <KTargetFile>=<path>   e.g: target=c:\sys\bin\sts\server\config.ini
       
    42  Can be used with the all commands that require a file path as input. 
       
    43  */
       
    44 _LIT(KTargetFile,	"target");
       
    45 
       
    46 /**
       
    47  This item has the followin role:
       
    48  a) Name of the item that defines which transaction id is to be reused (from which slot) when issuing an open transaction command
       
    49     Usage: <KTransactionSlotID>=<slot>   e.g: TrSlotID=0 or TrSlot=1 etc...
       
    50  
       
    51  Usage:
       
    52     [testopentransactionsection]
       
    53     TrSlot=1
       
    54     TrSlotID=0  ==> reuses transaction ID of transaction in slot 0            
       
    55 
       
    56  Important note: a section that is intended to be used with open transaction command should contain either 
       
    57                  KTransactionSlotID or KTransactionID out of which KTransactionSlotID is searched for first.
       
    58                  (That's if an ini section conatins both then KTransactionID is simply ignored)
       
    59  */
       
    60 _LIT(KTransactionSlotID,	"trslotid");
       
    61 
       
    62 /**
       
    63  An arbitrary transaction ID (4byte) can be defined in the ini file that is used when opening a transaction. 
       
    64 
       
    65  Usage:
       
    66     [testopentransactionsection]
       
    67     trslot=1
       
    68     trid=0xABCDEF  ==> this vvalue is used when openeing a transaction
       
    69  Important note: a section that is intended to be used with open transaction command should contain either 
       
    70                  KTransactionSlotID or KTransactionID out of which KTransactionSlotID is searched for first.
       
    71                  (That's if an ini section conatins both then KTransactionID is simply ignored)
       
    72  */
       
    73 _LIT(KTransactionID,	"trid");
       
    74 
       
    75 /**
       
    76  This item is for CheckFilesStep.
       
    77  It's used to show how many subsequent file name/path items in the ini file are to be extracted 
       
    78  for checking wheter the corresponding files exist or not.
       
    79  Usage:
       
    80    numexist=xx eg: numexist=2
       
    81 */
       
    82 _LIT(KNumExist, "numexist"); 
       
    83 
       
    84 /**
       
    85  This item is for CheckFilesStep.
       
    86  It's used to define a particular file's name/path that is to be checked for.
       
    87  Usage:
       
    88    exist<x>=<path> where x starts from 0. eg: exist0=d:\myfolder\mysubfolder\myfile.txt
       
    89 */
       
    90 _LIT(KExistBase, "exist"); // + number (0-based) = file to check for
       
    91 
       
    92 /**
       
    93  This item is for CheckFilesStep.
       
    94  It's used to show how many subsequent file name/path items in the ini file are to be extracted 
       
    95  for checking wheter the corresponding files don't exist.
       
    96  Usage:
       
    97    numnonexist=xx eg: numnonexist=2
       
    98 */
       
    99 _LIT(KNumNonExist, "numnonexist"); // this specifies how many files to check for
       
   100 
       
   101 /**
       
   102  This item is for CheckFilesStep.
       
   103  It's used to define a particular file's name/path that is to be checked for.
       
   104  Usage:
       
   105    nonexist<x>=<path> where x starts from 0. eg: nonexist0=d:\myfolder\mysubfolder\myfile.txt
       
   106 */
       
   107 _LIT(KNonExistBase, "nonexist"); // + number (0-based) = file to check for
       
   108 
       
   109 /**
       
   110  This item is for FileOperationsStep.
       
   111  It's used to specify the number of subsequent file operations in the ini file.
       
   112  Usage:
       
   113    operations=xx eg: operations=2
       
   114 */
       
   115 _LIT(KNumOfOperations, "operations"); // this specifies how many fileoperations are to be executed
       
   116 
       
   117 _LIT(KOpNameBase, 	   "operation"); 
       
   118 
       
   119 /**
       
   120  This item is for CreateLargeFileNameStep.
       
   121  It's used to specify the base directory.
       
   122  Usage:
       
   123    basedir=xx 
       
   124 */
       
   125 _LIT(KBaseDir, 	   "basedir");
       
   126 
       
   127 /**
       
   128  This item is for CreateLargeFileNameStep.
       
   129  It's used to specify the base directory 
       
   130  buffer size.
       
   131 */
       
   132 const TInt KBufSize = 30; 
       
   133 
       
   134 /**
       
   135  Thess items are for FileOperationsStep.
       
   136  They denote file commands accepted by FileOperationsStep.
       
   137  Usage:
       
   138    operationxx=<command> <switch> <source> <destination>
       
   139  eg: 
       
   140    operation0=mkdirall -i c:\sys\bin\dummydir\    //-i suppresses all errors during the operation
       
   141    operation1=copy z:\sys\bin\dummydir\dummyfile.txt z:\sys\bin\dummydir\dummyfileoncdrive.txt
       
   142 */
       
   143 _LIT(KMkDirAllOp, 	   "mkdirall"); 
       
   144 _LIT(KRmDirOp, 	   	   "rmdir"); 
       
   145 _LIT(KCopyOp, 	   	   "copy"); 
       
   146 _LIT(KDeleteOp,	   	   "delete"); 
       
   147 _LIT(KAttribOp,		   "attrib"); 
       
   148 _LIT(KIgnoreErrorsSwitch, "-i"); 
       
   149 
       
   150 //test step names
       
   151 _LIT(KCreateTransactionStep,	"CreateTransactionStep");
       
   152 _LIT(KOpenTransactionStep,		"OpenTransactionStep");
       
   153 _LIT(KCloseTransactionStep,		"CloseTransactionStep");
       
   154 _LIT(KRegisterNewFileStep,		"RegisterNewFileStep");
       
   155 _LIT(KCreateNewFileStep,		"CreateNewFileStep");
       
   156 _LIT(KRemoveStep,				"RemoveStep");
       
   157 _LIT(KRegisterTemporaryStep,	"RegisterTemporaryStep");
       
   158 _LIT(KCreateTemporaryStep,		"CreateTemporaryStep");
       
   159 _LIT(KOverwriteStep,			"OverwriteStep");
       
   160 _LIT(KCommitStep,				"CommitStep");
       
   161 _LIT(KRollbackStep,				"RollbackStep");
       
   162 _LIT(KRollbackAllPendingStep,	"RollbackAllPendingStep");
       
   163 _LIT(KCheckFilesStep,			"CheckFilesStep");
       
   164 _LIT(KNegativeTestsStep,		"NegativeTestsStep");
       
   165 _LIT(KCheckFileModeChangeStep,	"CheckFileModeChangeStep");
       
   166 _LIT(KJournalFileUnitTest,	    "JournalFileUnitTest");
       
   167 _LIT(KJournalFileUnitTestAdd,  	"JournalFileUnitTestAdd");
       
   168 _LIT(KJournalFileUnitTestTemp,  	"JournalFileUnitTestTemp");
       
   169 _LIT(KJournalFileUnitTestRemove, "JournalFileUnitTestRemove");
       
   170 _LIT(KJournalFileUnitTestRead,  	"JournalFileUnitTestRead");
       
   171 _LIT(KJournalFileUnitTestEvent,  "JournalFileUnitTestEvent");
       
   172 _LIT(KJournalUnitTest,	    		"JournalUnitTest");
       
   173 _LIT(KJournalUnitTestInstall,	"JournalUnitTestInstall");
       
   174 _LIT(KJournalUnitTestRollback,	"JournalUnitTestRollback");
       
   175 _LIT(KIntegrityservicesUnitTestInstall,	"IntegrityservicesUnitTestInstall");
       
   176 _LIT(KIntegrityservicesUnitTestRollback,	"IntegrityservicesUnitTestRollback");
       
   177 _LIT(KFileOperationsStep,					"FileOperationsStep");
       
   178 _LIT(KFileModeTestStep,					"FileModeTestStep");
       
   179 _LIT(KCreateLongFileNameTestStep,			"CreateLongFileNameTestStep");
       
   180 
       
   181 //test step names for legacy integrityservices testcode (see ../tintegrityservices/source/tintegrityservicesstep.cpp)
       
   182 _LIT(KInstall, 					"Install");
       
   183 _LIT(KRecover, 					"Recover");
       
   184 _LIT(KCleanup, 					"Cleanup");
       
   185 _LIT(KCheck, 					"Check");
       
   186 
       
   187 
       
   188 const TInt KDefaultFileCreationMode = EFileShareExclusive|EFileWrite;
       
   189 
       
   190 enum TNewFileType
       
   191 	{
       
   192 	ENewTemporaryFile,
       
   193 	ENewPermanentFile
       
   194 	};
       
   195 	
       
   196 //predefined elements used to create file content when creating new files	
       
   197 _LIT(KFileData1, "This ");
       
   198 _LIT(KFileData2, "temporary ");
       
   199 _LIT(KFileData3, "permanent ");
       
   200 _LIT(KFileData4, "unknown type ");
       
   201 _LIT(KFileData5, "file was created by ");
       
   202 _LIT(KFileData6, " command");
       
   203 _LIT(KFileData7, "the STS server when instructed by ");
       
   204 _LIT(KFileData8, " @ ");
       
   205 _LIT(KTimeFormatString, "%H%:%T%:%S%.%C  %D%/%M%/%Y");
       
   206 
       
   207 
       
   208 //script and ini file item used by legacy integrityservices testcode (see ../tintegrityservices/source/tintegrityservicesstep.cpp)
       
   209 _LIT(KRemoveFile,	 	"removefile");
       
   210 _LIT(KTempFile, 		"temporaryfile");
       
   211 _LIT(KAddFile, 			"addfile");
       
   212 _LIT(KFailType, 		"failtype");
       
   213 _LIT(KFailPosition, 	"failposition");
       
   214 _LIT(KFailFileName, 	"failfilename");
       
   215 _LIT(KPresent, 			"present");
       
   216 _LIT(KAbsent, 			"absent");
       
   217 _LIT(KCleanupFile, 		"cleanupfile");
       
   218 _LIT(KCleanupDirectory, "cleanupdirectory");
       
   219 _LIT(KArbitraryOpFile, 	"arbitraryopfile");
       
   220 _LIT(KOperation, 		"operation");
       
   221 #endif
       
   222