lowlevellibsandfws/pluginfw/Framework/RegistrarTest/RegistrarUnitTests.inl
changeset 0 e4d67989cc36
equal deleted inserted replaced
-1:000000000000 0:e4d67989cc36
       
     1 // Copyright (c) 1997-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 // The implementation of the unit test classes for the CRegistrar.
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "RegistrarTransitions.h"
       
    19 #include "RegistrarStateAccessor.h"
       
    20 
       
    21 _LIT(KRegistrarNotificationMsg,"Notification %d recieved from CRegistrar!");
       
    22 
       
    23 // ______________________________________________________________________________
       
    24 //
       
    25 _LIT(KRegistrarCreateAndDestroyUnitTest,"CRegistrar_CreateAndDestroy_UnitTest");
       
    26 
       
    27 CRegistrar_CreateAndDestroy_UnitTest* CRegistrar_CreateAndDestroy_UnitTest::NewL(
       
    28 															CDataLogger& aDataLogger,
       
    29 															MUnitTestObserver& aObserver)
       
    30 	{
       
    31 	CRegistrar_CreateAndDestroy_UnitTest* self = 
       
    32 				new(ELeave) CRegistrar_CreateAndDestroy_UnitTest(aDataLogger, aObserver);
       
    33 	CleanupStack::PushL(self);
       
    34 	self->ConstructL();
       
    35 	CleanupStack::Pop();
       
    36 	return self; 
       
    37 	}
       
    38 
       
    39 inline TInt CRegistrar_CreateAndDestroy_UnitTest::RunError(TInt aError)
       
    40 	{
       
    41 	// The RunL left so chain to the base first and then cleanup
       
    42 	TInt error = CUnitTest::RunError(aError);	// Chain to base
       
    43 	delete iUTContext;
       
    44 	delete iStateAccessor;
       
    45 	// delete any validators used
       
    46 	delete iCtorValidator;
       
    47 	delete iDtorValidator;
       
    48 
       
    49 	return error;
       
    50 	}
       
    51 
       
    52 inline CRegistrar_CreateAndDestroy_UnitTest::~CRegistrar_CreateAndDestroy_UnitTest()
       
    53 	{
       
    54 	// Simply delete our test class instance
       
    55 	delete iUTContext;
       
    56 	delete iStateAccessor;
       
    57 
       
    58 	delete iRegistryData;
       
    59 
       
    60 	// delete any validators used
       
    61 	delete iCtorValidator;
       
    62 	delete iDtorValidator;
       
    63 	}
       
    64 
       
    65 inline CRegistrar_CreateAndDestroy_UnitTest::CRegistrar_CreateAndDestroy_UnitTest(
       
    66 															CDataLogger& aDataLogger,
       
    67 															MUnitTestObserver& aObserver)
       
    68 : CUnitTest(KRegistrarCreateAndDestroyUnitTest, aDataLogger, aObserver)
       
    69 	{
       
    70 	//Do nothing
       
    71 	}
       
    72 
       
    73 // Now the Individual transitions need to be added.
       
    74 inline void CRegistrar_CreateAndDestroy_UnitTest::ConstructL()
       
    75 	{
       
    76 	// Perform the base class initialization
       
    77 	UnitTestConstructL();
       
    78 
       
    79 	// Create the Unit test state accessor
       
    80 	iStateAccessor = new(ELeave) TRegistrar_StateAccessor;
       
    81 	// Construct the Unit test context.
       
    82 	iUTContext = new(ELeave) CRegistrar_UnitTestContext(iDataLogger, 
       
    83 														*iStateAccessor, 
       
    84 														*this,
       
    85 														*iRegistryData,
       
    86 														*this,
       
    87 														iFs);
       
    88 	// Add the Transitions in the order they are to run
       
    89 	// C'tor first, D'tor last...
       
    90 	iCtorValidator = new(ELeave) TRegistrar_Ctor_TransitionValidator(*iUTContext);
       
    91 	AddTransitionL(new(ELeave)CRegistrar_NewL_Transition(*iUTContext,*iCtorValidator));
       
    92 	iDtorValidator = new(ELeave) TRegistrar_Dtor_TransitionValidator(*iUTContext);
       
    93 	AddTransitionL(new(ELeave)CRegistrar_Dtor_Transition(*iUTContext,*iDtorValidator));
       
    94 	}
       
    95 
       
    96 void CRegistrar_CreateAndDestroy_UnitTest::PrepareUnitTestL()
       
    97 	{
       
    98 	iRegistryData = CRegistryData::NewL(iFs);
       
    99 	}
       
   100 
       
   101 void CRegistrar_CreateAndDestroy_UnitTest::Notification(TInt aNotificationCode)
       
   102 	{
       
   103 	iDataLogger.LogInformationWithParameters(KRegistrarNotificationMsg, aNotificationCode);
       
   104 	}
       
   105 
       
   106 // ______________________________________________________________________________
       
   107 //
       
   108 _LIT(KRegistrarBeginCompleteUnitTest,"CRegistrar_BeginComplete_UnitTest");
       
   109 
       
   110 CRegistrar_BeginComplete_UnitTest* CRegistrar_BeginComplete_UnitTest::NewL(CDataLogger& aDataLogger,
       
   111 											MUnitTestObserver& aObserver)
       
   112 	{
       
   113 	CRegistrar_BeginComplete_UnitTest* self = 
       
   114 					new(ELeave) CRegistrar_BeginComplete_UnitTest(aDataLogger,
       
   115 																aObserver);
       
   116 	CleanupStack::PushL(self);
       
   117 	self->ConstructL();
       
   118 	CleanupStack::Pop();
       
   119 	return self; 
       
   120 	}
       
   121 
       
   122 inline TInt CRegistrar_BeginComplete_UnitTest::RunError(TInt aError)
       
   123 	{
       
   124 	// The RunL left so chain to the base first and then cleanup
       
   125 	TInt error = CUnitTest::RunError(aError);	// Chain to base
       
   126 	delete iUTContext;
       
   127 	delete iStateAccessor;
       
   128 
       
   129 	delete iRegistryData;
       
   130 
       
   131 	delete iCtorValidator;
       
   132 	delete iDefaultValidator;
       
   133 	delete iDtorValidator;
       
   134 
       
   135 	return error;
       
   136 	}
       
   137 
       
   138 inline CRegistrar_BeginComplete_UnitTest::~CRegistrar_BeginComplete_UnitTest()
       
   139 	{
       
   140 	// Simply delete our test class instance
       
   141 	delete iUTContext;
       
   142 	delete iStateAccessor;
       
   143 
       
   144 	delete iRegistryData;
       
   145 
       
   146 	delete iCtorValidator;
       
   147 	delete iDefaultValidator;
       
   148 	delete iDtorValidator;
       
   149 	}
       
   150 
       
   151 inline CRegistrar_BeginComplete_UnitTest::CRegistrar_BeginComplete_UnitTest(CDataLogger& aDataLogger,
       
   152 																	MUnitTestObserver& aObserver)
       
   153 : CUnitTest(KRegistrarBeginCompleteUnitTest, aDataLogger, aObserver)
       
   154 	{
       
   155 	//Do nothing
       
   156 	}
       
   157 
       
   158 // Now the Individual transitions need to be added.
       
   159 inline void CRegistrar_BeginComplete_UnitTest::ConstructL()
       
   160 	{
       
   161 	// Perform the base class initialization
       
   162 	UnitTestConstructL();
       
   163 
       
   164 	iRegistryData = CRegistryData::NewL(iFs);
       
   165 
       
   166 	// Create the Unit test state accessor
       
   167 	iStateAccessor = new(ELeave) TRegistrar_StateAccessor;
       
   168 	// Construct the Unit test context.
       
   169 	iUTContext = new(ELeave) CRegistrar_UnitTestContext(iDataLogger, 
       
   170 														*iStateAccessor, 
       
   171 														*this,
       
   172 														*iRegistryData,
       
   173 														*this,
       
   174 														iFs);
       
   175 	iUTContext->iDllData = CRegistryData::CDllData::NewLC();
       
   176 	CleanupStack::Pop();	//iDllData
       
   177 
       
   178 	// Create the validators which are used by the transitions
       
   179 	iCtorValidator	  = new(ELeave) TRegistrar_Ctor_TransitionValidator(*iUTContext);
       
   180 	iDefaultValidator = new(ELeave) TRegistrar_Default_TransitionValidator(*iUTContext);
       
   181 	iDtorValidator	  = new(ELeave) TRegistrar_Dtor_TransitionValidator(*iUTContext);
       
   182 
       
   183 	// Add the Transitions in the order they are to run
       
   184 	// C'tor, Begin, Complete, D'tor
       
   185 	AddTransitionL(new(ELeave)CRegistrar_NewL_Transition(*iUTContext,*iCtorValidator));
       
   186 	AddTransitionL(new(ELeave)CRegistrar_DiscoveriesBegin_Transition(*iUTContext,*iDefaultValidator));
       
   187 //	AddTransitionL(new(ELeave)CRegistrar_ParseL_Transition(*iUTContext,*iDefaultValidator));
       
   188 	AddTransitionL(new(ELeave)CRegistrar_DiscoveriesComplete_Transition(*iUTContext,*iDefaultValidator));
       
   189 	AddTransitionL(new(ELeave)CRegistrar_Dtor_Transition(*iUTContext,*iDtorValidator));
       
   190 	}
       
   191 
       
   192 void CRegistrar_BeginComplete_UnitTest::Notification(TInt aNotificationCode)
       
   193 	{
       
   194 	iDataLogger.LogInformationWithParameters(KRegistrarNotificationMsg, aNotificationCode);
       
   195 	}
       
   196 
       
   197 // ______________________________________________________________________________
       
   198 //
       
   199 _LIT(KRegistrarRegisterDiscoveryUnitTest,"CRegistrar_RegisterDiscovery_UnitTest");
       
   200 
       
   201 CRegistrar_RegisterDiscovery_UnitTest* CRegistrar_RegisterDiscovery_UnitTest::NewL(CDataLogger& aDataLogger,
       
   202 											MUnitTestObserver& aObserver)
       
   203 	{
       
   204 	CRegistrar_RegisterDiscovery_UnitTest* self = 
       
   205 					new(ELeave) CRegistrar_RegisterDiscovery_UnitTest(aDataLogger,
       
   206 																aObserver);
       
   207 	CleanupStack::PushL(self);
       
   208 	self->ConstructL();
       
   209 	CleanupStack::Pop();
       
   210 	return self; 
       
   211 	}
       
   212 
       
   213 inline TInt CRegistrar_RegisterDiscovery_UnitTest::RunError(TInt aError)
       
   214 	{
       
   215 	// The RunL left so chain to the base first and then cleanup
       
   216 	TInt error = CUnitTest::RunError(aError);	// Chain to base
       
   217 	delete iUTContext;
       
   218 	delete iStateAccessor;
       
   219 
       
   220 	delete iRegistryData;
       
   221 
       
   222 	// delete any validators used
       
   223 	delete iCtorValidator;
       
   224 	delete iRegisterDiscoveryValidator;
       
   225 	delete iDtorValidator;
       
   226 
       
   227 	return error;
       
   228 	}
       
   229 
       
   230 inline CRegistrar_RegisterDiscovery_UnitTest::~CRegistrar_RegisterDiscovery_UnitTest()
       
   231 	{
       
   232 	// Simply delete our test class instance
       
   233 	delete iUTContext;
       
   234 	delete iStateAccessor;
       
   235 
       
   236 	delete iRegistryData;
       
   237 
       
   238 	// delete any validators used
       
   239 	delete iCtorValidator;
       
   240 	delete iRegisterDiscoveryValidator;
       
   241 	delete iDtorValidator;
       
   242 	}
       
   243 
       
   244 inline CRegistrar_RegisterDiscovery_UnitTest::CRegistrar_RegisterDiscovery_UnitTest(CDataLogger& aDataLogger,
       
   245 																	MUnitTestObserver& aObserver)
       
   246 : CUnitTest(KRegistrarRegisterDiscoveryUnitTest, aDataLogger, aObserver)
       
   247 	{
       
   248 	//Do nothing
       
   249 	}
       
   250 
       
   251 // Now the Individual transitions need to be added.
       
   252 inline void CRegistrar_RegisterDiscovery_UnitTest::ConstructL()
       
   253 	{
       
   254 	// Perform the base class initialization
       
   255 	UnitTestConstructL();
       
   256 
       
   257 	iRegistryData = CRegistryData::NewL(iFs);
       
   258 	TDriveUnit drive(EDriveZ);
       
   259 	iRegistryData->UndoTemporaryUninstallL(drive);
       
   260 
       
   261 	// Create the Unit test state accessor
       
   262 	iStateAccessor = new(ELeave) TRegistrar_StateAccessor;
       
   263 	// Construct the Unit test context.
       
   264 	iUTContext = new(ELeave) CRegistrar_UnitTestContext(iDataLogger, 
       
   265 														*iStateAccessor, 
       
   266 														*this,
       
   267 														*iRegistryData,
       
   268 														*this,
       
   269 														iFs);
       
   270 	iUTContext->iDllData = CRegistryData::CDllData::NewLC();
       
   271 	CleanupStack::Pop();	//iDllData
       
   272 
       
   273 	// Artificially set up the TEntry info on the dll
       
   274 	TPtr dllName = iUTContext->iDllEntry.iName.Des();
       
   275 	dllName = KExampleDllFileName();
       
   276 
       
   277 	// Only the third entry (unique dll id) matters in this case
       
   278 	TUid uid1, uid2, uid3;
       
   279 	uid1.iUid = 0;
       
   280 	uid2.iUid = 0;
       
   281 	uid3.iUid = 0x10009DB0;
       
   282 	iUTContext->iDllEntry.iType = TUidType(uid1, uid2, uid3);
       
   283 
       
   284 	// Set the modified time to an unrealistic time to ensure it is reloaded
       
   285 	iUTContext->iDllEntry.iModified = 5;
       
   286 	iUTContext->iUpdate = EFalse;
       
   287 	iUTContext->iIndex = KErrNotFound;
       
   288 
       
   289 	iCtorValidator = new(ELeave) TRegistrar_Ctor_TransitionValidator(*iUTContext);
       
   290 	iRegisterDiscoveryValidator = new(ELeave) TRegistrar_RegisterDiscoveryL_TransitionValidator(*iUTContext);
       
   291 	iDtorValidator = new(ELeave) TRegistrar_Dtor_TransitionValidator(*iUTContext);
       
   292 
       
   293 	AddTransitionL(new(ELeave)CRegistrar_NewL_Transition(*iUTContext,*iCtorValidator));
       
   294 	AddTransitionL(new(ELeave)CRegistrar_ParseL_Transition(*iUTContext,*iRegisterDiscoveryValidator));
       
   295 	AddTransitionL(new(ELeave)CRegistrar_ParseRegistrationDataL_Transition(*iUTContext,*iRegisterDiscoveryValidator));
       
   296 	AddTransitionL(new(ELeave)CRegistrar_RegisterDiscoveryL_Transition(*iUTContext,*iRegisterDiscoveryValidator));
       
   297 	AddTransitionL(new(ELeave)CRegistrar_Dtor_Transition(*iUTContext,*iDtorValidator));
       
   298 	}
       
   299 
       
   300 void CRegistrar_RegisterDiscovery_UnitTest::Notification(TInt aNotificationCode)
       
   301 	{
       
   302 	iDataLogger.LogInformationWithParameters(KRegistrarNotificationMsg, aNotificationCode);
       
   303 	}
       
   304 
       
   305 // ______________________________________________________________________________
       
   306 //
       
   307 _LIT(KRegistrarRegisterTwiceUnitTest,"CRegistrar_RegisterTwice_UnitTest");
       
   308 
       
   309 CRegistrar_RegisterTwice_UnitTest* CRegistrar_RegisterTwice_UnitTest::NewL(CDataLogger& aDataLogger,
       
   310 											MUnitTestObserver& aObserver)
       
   311 	{
       
   312 	CRegistrar_RegisterTwice_UnitTest* self = 
       
   313 					new(ELeave) CRegistrar_RegisterTwice_UnitTest(aDataLogger,
       
   314 																aObserver);
       
   315 	CleanupStack::PushL(self);
       
   316 	self->ConstructL();
       
   317 	CleanupStack::Pop();
       
   318 	return self; 
       
   319 	}
       
   320 
       
   321 inline TInt CRegistrar_RegisterTwice_UnitTest::RunError(TInt aError)
       
   322 	{
       
   323 	// The RunL left so chain to the base first and then cleanup
       
   324 	TInt error = CUnitTest::RunError(aError);	// Chain to base
       
   325 	delete iUTContext;
       
   326 	delete iStateAccessor;
       
   327 
       
   328 	delete iRegistryData;
       
   329 
       
   330 	// delete any validators used
       
   331 	delete iCtorValidator;
       
   332 	delete iRegisterDiscoveryValidator;
       
   333 	delete iDefaultValidator;
       
   334 	delete iDtorValidator;
       
   335 
       
   336 	return error;
       
   337 	}
       
   338 
       
   339 inline CRegistrar_RegisterTwice_UnitTest::~CRegistrar_RegisterTwice_UnitTest()
       
   340 	{
       
   341 	// Simply delete our test class instance
       
   342 	delete iUTContext;
       
   343 	delete iStateAccessor;
       
   344 
       
   345 	delete iRegistryData;
       
   346 
       
   347 	// delete any validators used
       
   348 	delete iCtorValidator;
       
   349 	delete iRegisterDiscoveryValidator;
       
   350 	delete iDefaultValidator;
       
   351 	delete iDtorValidator;
       
   352 	}
       
   353 
       
   354 inline CRegistrar_RegisterTwice_UnitTest::CRegistrar_RegisterTwice_UnitTest(CDataLogger& aDataLogger,
       
   355 																	MUnitTestObserver& aObserver)
       
   356 : CUnitTest(KRegistrarRegisterTwiceUnitTest, aDataLogger, aObserver)
       
   357 	{
       
   358 	//Do nothing
       
   359 	}
       
   360 
       
   361 // Now the Individual transitions need to be added.
       
   362 inline void CRegistrar_RegisterTwice_UnitTest::ConstructL()
       
   363 	{
       
   364 	// Perform the base class initialization
       
   365 	UnitTestConstructL();
       
   366 
       
   367 	iRegistryData = CRegistryData::NewL(iFs);
       
   368 	TDriveUnit drive(EDriveZ);
       
   369 	iRegistryData->UndoTemporaryUninstallL(drive);
       
   370 
       
   371 	// Create the Unit test state accessor
       
   372 	iStateAccessor = new(ELeave) TRegistrar_StateAccessor;
       
   373 	// Construct the Unit test context.
       
   374 	iUTContext = new(ELeave) CRegistrar_UnitTestContext(iDataLogger, 
       
   375 														*iStateAccessor, 
       
   376 														*this,
       
   377 														*iRegistryData,
       
   378 														*this,
       
   379 														iFs);
       
   380 	iUTContext->iDllData = CRegistryData::CDllData::NewLC();
       
   381 	CleanupStack::Pop();	//iDllData
       
   382 
       
   383 	// Artificially set up the TEntry info on the dll
       
   384 	TPtr dllName = iUTContext->iDllEntry.iName.Des();
       
   385 	dllName = KExampleDllFileName();
       
   386 
       
   387 	// Only the third entry (unique dll id) matters in this case
       
   388 	TUid uid1, uid2, uid3;
       
   389 	uid1.iUid = 0;
       
   390 	uid2.iUid = 0;
       
   391 	uid3.iUid = 0x10009DB1;
       
   392 	iUTContext->iDllEntry.iType = TUidType(uid1, uid2, uid3);
       
   393 
       
   394 	// Set the modified time to an unrealistic time to ensure it is reloaded
       
   395 	iUTContext->iDllEntry.iModified = 5;
       
   396 	iUTContext->iUpdate = EFalse;
       
   397 	iUTContext->iIndex = KErrNotFound;
       
   398 
       
   399 	iCtorValidator = new(ELeave) TRegistrar_Ctor_TransitionValidator(*iUTContext);
       
   400 	iRegisterDiscoveryValidator = new(ELeave) TRegistrar_RegisterDiscoveryL_TransitionValidator(*iUTContext);
       
   401 	iDefaultValidator = new(ELeave) TRegistrar_Default_TransitionValidator(*iUTContext);
       
   402 	iDtorValidator = new(ELeave) TRegistrar_Dtor_TransitionValidator(*iUTContext);
       
   403 
       
   404 	AddTransitionL(new(ELeave)CRegistrar_NewL_Transition(*iUTContext,*iCtorValidator));
       
   405 	AddTransitionL(new(ELeave)CRegistrar_RegisterDiscoveryL_Transition(*iUTContext,*iRegisterDiscoveryValidator));
       
   406 	AddTransitionL(new(ELeave)CRegistrar_DiscoveriesComplete_Transition(*iUTContext,*iDefaultValidator));
       
   407 	AddTransitionL(new(ELeave)CRegistrar_RegisterDiscoveryL_Transition(*iUTContext,*iRegisterDiscoveryValidator));
       
   408 	AddTransitionL(new(ELeave)CRegistrar_DiscoveriesComplete_Transition(*iUTContext,*iDefaultValidator));
       
   409 	AddTransitionL(new(ELeave)CRegistrar_Dtor_Transition(*iUTContext,*iDtorValidator));
       
   410 	}
       
   411 
       
   412 void CRegistrar_RegisterTwice_UnitTest::Notification(TInt aNotificationCode)
       
   413 	{
       
   414 	iDataLogger.LogInformationWithParameters(KRegistrarNotificationMsg, aNotificationCode);
       
   415 	}
       
   416 
       
   417 // ______________________________________________________________________________
       
   418 //
       
   419 _LIT(KRegistrarUseWhileDiscoveringUnitTest,"CRegistrar_UseWhileDiscovering_UnitTest");
       
   420 
       
   421 CRegistrar_UseWhileDiscovering_UnitTest* CRegistrar_UseWhileDiscovering_UnitTest::NewL(CDataLogger& aDataLogger,
       
   422 											MUnitTestObserver& aObserver)
       
   423 	{
       
   424 	CRegistrar_UseWhileDiscovering_UnitTest* self = 
       
   425 					new(ELeave) CRegistrar_UseWhileDiscovering_UnitTest(aDataLogger,
       
   426 																aObserver);
       
   427 	CleanupStack::PushL(self);
       
   428 	self->ConstructL();
       
   429 	CleanupStack::Pop(self);
       
   430 	return self; 
       
   431 	}
       
   432 
       
   433 inline TInt CRegistrar_UseWhileDiscovering_UnitTest::RunError(TInt aError)
       
   434 	{
       
   435 	// The RunL left so chain to the base first and then cleanup
       
   436 	TInt error = CUnitTest::RunError(aError);	// Chain to base
       
   437 	delete iUTContext;
       
   438 	delete iStateAccessor;
       
   439 
       
   440 	delete iRegistryData;
       
   441 
       
   442 	// delete any validators used
       
   443 	delete iCtorValidator;
       
   444 	iCtorValidator = NULL;
       
   445 	delete iCheckRegValidator;
       
   446 	iCheckRegValidator = NULL;
       
   447 	delete iDtorValidator;
       
   448 	iDtorValidator = NULL;
       
   449 
       
   450 	return error;
       
   451 	}
       
   452 
       
   453 inline CRegistrar_UseWhileDiscovering_UnitTest::~CRegistrar_UseWhileDiscovering_UnitTest()
       
   454 	{
       
   455 	// Simply delete our test class instance
       
   456 	delete iUTContext;
       
   457 	delete iStateAccessor;
       
   458 
       
   459 	delete iRegistryData;
       
   460 
       
   461 	// delete any validators used
       
   462 	delete iCtorValidator;
       
   463 	delete iCheckRegValidator;
       
   464 	delete iDtorValidator;
       
   465 	}
       
   466 
       
   467 inline CRegistrar_UseWhileDiscovering_UnitTest::CRegistrar_UseWhileDiscovering_UnitTest(CDataLogger& aDataLogger,
       
   468 																	MUnitTestObserver& aObserver)
       
   469 : CUnitTest(KRegistrarUseWhileDiscoveringUnitTest, aDataLogger, aObserver)
       
   470 	{
       
   471 	//Do nothing
       
   472 	}
       
   473 
       
   474 // Now the Individual transitions need to be added.
       
   475 inline void CRegistrar_UseWhileDiscovering_UnitTest::ConstructL()
       
   476 	{
       
   477 	// Perform the base class initialization
       
   478 	UnitTestConstructL();
       
   479 
       
   480 	iRegistryData = CRegistryData::NewL(iFs);
       
   481 
       
   482 	// Create the Unit test state accessor
       
   483 	iStateAccessor = new(ELeave) TRegistrar_StateAccessor;
       
   484 	// Construct the Unit test context.
       
   485 	iUTContext = new(ELeave) CRegistrar_UnitTestContext(iDataLogger, 
       
   486 														*iStateAccessor, 
       
   487 														*this,
       
   488 														*iRegistryData,
       
   489 														*this,
       
   490 														iFs);
       
   491 	iUTContext->iDllData = CRegistryData::CDllData::NewLC();
       
   492 	CleanupStack::Pop();	//iDllData
       
   493 
       
   494 	iUTContext->iInterfaceUid.iUid = 0x10009DC0;
       
   495 
       
   496 	// Artificially set up the TEntry info on the dll
       
   497 	TPtr dllName = iUTContext->iDllEntry.iName.Des();
       
   498 	dllName = KExampleDllFileName();
       
   499 
       
   500 	iUTContext->iIndex = KErrNotFound;
       
   501 #ifdef __WINS__
       
   502 	iUTContext->iDriveUnit = EDriveZ;
       
   503 #else
       
   504 	iUTContext->iDriveUnit = EDriveC;
       
   505 #endif
       
   506 
       
   507 	iCtorValidator = new(ELeave) TRegistrar_Ctor_TransitionValidator(*iUTContext);
       
   508 	iCheckRegValidator = new(ELeave) TRegistrar_CheckRegWhileDiscovering_TransitionValidator(*iUTContext);
       
   509 	iDtorValidator = new(ELeave) TRegistrar_Dtor_TransitionValidator(*iUTContext);
       
   510 
       
   511 	AddTransitionL(new(ELeave)CRegistrar_NewL_Transition(*iUTContext,*iCtorValidator));
       
   512 	AddTransitionL(new(ELeave)CRegistrar_DiscoveriesBegin_Transition(*iUTContext,*iCheckRegValidator));
       
   513 	AddTransitionL(new(ELeave)CRegistrar_Dtor_Transition(*iUTContext,*iDtorValidator));
       
   514 	}
       
   515 
       
   516 void CRegistrar_UseWhileDiscovering_UnitTest::Notification(TInt aNotificationCode)
       
   517 	{
       
   518 	iDataLogger.LogInformationWithParameters(KRegistrarNotificationMsg, aNotificationCode);
       
   519 	}
       
   520