installationservices/swi/test/tsisregistrytest_legacy/sessionstep.cpp
changeset 25 98b66e4fb0be
parent 5 3eebb1e54d3a
child 42 d17dc5398051
equal deleted inserted replaced
24:84a16765cd86 25:98b66e4fb0be
     1 /*
     1 /*
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of the License "Eclipse Public License v1.0"
     5 * under the terms of the License "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    19 /**
    19 /**
    20  @file 
    20  @file 
    21  @test
    21  @test
    22  @internalTechnology
    22  @internalTechnology
    23 */
    23 */
    24  
    24 
       
    25 #include <e32svr.h>
    25 #include <test/testexecutelog.h>
    26 #include <test/testexecutelog.h>
    26 #include <test/testexecutestepbase.h>
    27 #include <test/testexecutestepbase.h>
    27 #include "sessionstep.h"
    28 #include "sessionstep.h"
    28 #include "sisregistrysession.h"
    29 #include "sisregistrysession.h"
    29 #include "sisregistryentry.h"
    30 #include "sisregistryentry.h"
    35 #include "arrayutils.h"
    36 #include "arrayutils.h"
    36 #include "sisregistrytoken.h"
    37 #include "sisregistrytoken.h"
    37 #include "sisregistrylog.h"
    38 #include "sisregistrylog.h"
    38 #include <s32file.h>
    39 #include <s32file.h>
    39 
    40 
       
    41 #include <centralrepository.h>
    40 
    42 
    41 /////////////////////////////////////////////////////////////////////
    43 /////////////////////////////////////////////////////////////////////
    42 // defs, Constants used by test steps
    44 // defs, Constants used by test steps
    43 /////////////////////////////////////////////////////////////////////
    45 /////////////////////////////////////////////////////////////////////
    44 
    46 
    45 _LIT(KNoUid, "nouid");
    47 _LIT(KNoUid, "nouid");
    46 _LIT(KUid, "uid");
    48 _LIT(KUid, "uid");
       
    49 _LIT(KCenRepKey, "cenrepkey");
       
    50 _LIT(KCenRepValue, "cenrepvalue");
    47 _LIT(KDrivebitmapcount, "drivebitmapcout");
    51 _LIT(KDrivebitmapcount, "drivebitmapcout");
    48 _LIT(KSid, "sid");
    52 _LIT(KSid, "sid");
    49 _LIT(KPackage, "package");
    53 _LIT(KPackage, "package");
    50 _LIT(KVendor, "vendor");
    54 _LIT(KVendor, "vendor");
    51 _LIT(KController, "ctl");
    55 _LIT(KController, "ctl");
   651 	CleanupStack::PopAndDestroy(&expectedUids);
   655 	CleanupStack::PopAndDestroy(&expectedUids);
   652 	
   656 	
   653 	return TestStepResult();
   657 	return TestStepResult();
   654 	}
   658 	}
   655 	
   659 	
       
   660 
       
   661 /////////////////////////////////////////////////////////////////////
       
   662 // CSetCenRepSettingStep - Set Central Reposatory Value
       
   663 /////////////////////////////////////////////////////////////////////
       
   664 CSetCenRepSettingStep::CSetCenRepSettingStep()
       
   665     {
       
   666     SetTestStepName(KSetCenRepSetting);
       
   667     }
       
   668 
       
   669 TVerdict CSetCenRepSettingStep::doTestStepL()
       
   670     {        
       
   671     SetTestStepResult(EPass);
       
   672     TUid repUid;
       
   673     if(!GetUidFromConfig(ConfigSection(), KUid, repUid))
       
   674         {
       
   675         ERR_PRINTF1(_L("Package UID is missing in the configuration file!"));
       
   676         SetTestStepResult(EFail);
       
   677         return TestStepResult();
       
   678         }
       
   679     
       
   680     TInt cenRepKey;
       
   681     if(!GetIntFromConfig(ConfigSection(), KCenRepKey, cenRepKey))
       
   682         {
       
   683         ERR_PRINTF1(_L("Central Reposatory Key is missing in the configuration file!"));
       
   684         SetTestStepResult(EFail);
       
   685         return TestStepResult();
       
   686         }
       
   687     
       
   688     TInt cenRepValue;
       
   689     if(!GetIntFromConfig(ConfigSection(), KCenRepValue, cenRepValue))
       
   690         {
       
   691         ERR_PRINTF1(_L("Central Reposatory Value is missing in the configuration file!"));
       
   692         SetTestStepResult(EFail);
       
   693         return TestStepResult();
       
   694         }
       
   695     
       
   696     CRepository* rep = CRepository::NewLC(repUid);
       
   697     TInt err = rep->Set(cenRepKey, cenRepValue);
       
   698         
       
   699     if( err == KErrNone )
       
   700     {
       
   701         INFO_PRINTF4(_L("Setting Central Reposatory  0x%08x  , key = %d, value = %d"),repUid,cenRepKey,cenRepValue);
       
   702     }
       
   703     else
       
   704     {
       
   705         SetTestStepResult(EFail);
       
   706         ERR_PRINTF4(_L("Failed Setting Central Reposatory  0x%08x  , key = %d, value = %d"),repUid,cenRepKey,cenRepValue);
       
   707     }
       
   708     
       
   709     CleanupStack::PopAndDestroy(rep); 
       
   710     return TestStepResult();
       
   711     }
       
   712 
       
   713 
   656 /////////////////////////////////////////////////////////////////////
   714 /////////////////////////////////////////////////////////////////////
   657 // CIsPackageInstalledStep - checks if packages are registered
   715 // CIsPackageInstalledStep - checks if packages are registered
   658 /////////////////////////////////////////////////////////////////////
   716 /////////////////////////////////////////////////////////////////////
   659 
   717 
   660 CIsPackageInstalledStep::CIsPackageInstalledStep()
   718 CIsPackageInstalledStep::CIsPackageInstalledStep()