lowlevellibsandfws/pluginfw/Framework/LoadManagerTest/LoadManagerTest.cpp
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 // Demonstrates a simple set of derived class implementations to
       
    15 // test the CLoadManager class using the test bed.
       
    16 // It may be used as a basis to develop a full test bed dll.
       
    17 // For support and comment please contact the authors.
       
    18 // 
       
    19 //
       
    20 
       
    21 #include "LoadManagerUnitTest.h"
       
    22 #include "ComponentTester.h"
       
    23 
       
    24 RTest test(_L("LoadManagerTest.cpp"));
       
    25 
       
    26 // ______________________________________________________________________________
       
    27 //
       
    28 /**
       
    29 	@internalComponent
       
    30 	Comments : Test the CLoadManager class.
       
    31  */
       
    32 class CLoadManager_ComponentTest : public CComponentTester
       
    33 	{
       
    34 public:
       
    35 	/**
       
    36 		@fn				NewLC(CDataLogger& aDataLogger,
       
    37 							 MComponentTestObserver& aObserver)
       
    38 		Intended Usage	: Standard two-phase construction which leaves nothing on the
       
    39 						cleanup stack.
       
    40 		Error Condition	: Leaves with the error code.
       
    41 		@leave  		KErrNoMemory
       
    42 		@since			7.0
       
    43 		@param			aDataLogger The output logging object.
       
    44 		@param			aObserver The observer of this component test.
       
    45 		@return			CLoadManager_ComponentTest* The constructed object.
       
    46 		@pre 			None.
       
    47 		@post			CLoadManager_ComponentTest is fully constructed.
       
    48 	*/
       
    49 	static CLoadManager_ComponentTest* NewLC(CDataLogger& aDataLogger,
       
    50 							MComponentTestObserver& aObserver);
       
    51 
       
    52 private:
       
    53 	/**
       
    54 		@fn				CLoadManager_ComponentTest(CDataLogger& aDataLogger,
       
    55 											MComponentTestObserver& aObserver)
       
    56 		Intended Usage	: Standard c'tor method.
       
    57 		Error Condition	: None.
       
    58 		@since			7.0
       
    59 		@param			aDataLogger The logging object.
       
    60 		@param			aObserver The observer of this component test.
       
    61 		@pre 			None.
       
    62 		@post			CLoadManager_ComponentTest is fully constructed.
       
    63 	*/
       
    64 	inline CLoadManager_ComponentTest(CDataLogger& aDataLogger,
       
    65 												MComponentTestObserver& aObserver);
       
    66 	/**
       
    67 		@fn				void ConstructL()
       
    68 		Intended Usage	: Second phase of safe two phase construction,
       
    69 						to complete the object initialisation.
       
    70 		Error Condition	: Leaves with an error code.
       
    71 		@leave  		KErrNoMemory.
       
    72 		@since			7.0
       
    73 		@return			None
       
    74 		@pre 			CLoadManager_ComponentTest is fully constructed.
       
    75 		@post			CLoadManager_ComponentTest is fully initialised.
       
    76 	*/
       
    77 	inline void ConstructL();
       
    78 
       
    79 	};	// CLoadManager_ComponentTest
       
    80 
       
    81 
       
    82 // ______________________________________________________________________________
       
    83 //
       
    84 inline CLoadManager_ComponentTest* CLoadManager_ComponentTest::NewLC(CDataLogger& aDataLogger, MComponentTestObserver& aObserver)
       
    85 	{
       
    86 	CLoadManager_ComponentTest* self = new (ELeave) CLoadManager_ComponentTest(aDataLogger, aObserver);
       
    87 	CleanupStack::PushL(self);
       
    88 	self->ConstructL();
       
    89 	return self;
       
    90 	}
       
    91 
       
    92 inline CLoadManager_ComponentTest::CLoadManager_ComponentTest(CDataLogger& aDataLogger,
       
    93 									MComponentTestObserver& aObserver)
       
    94 : CComponentTester(aDataLogger, aObserver)
       
    95 	{
       
    96 	// Do nothing here.
       
    97 	}
       
    98 
       
    99 inline void CLoadManager_ComponentTest::ConstructL()
       
   100 	{
       
   101 	// Perform base class initialization
       
   102 	ComponentTesterConstructL();
       
   103 
       
   104 	AddUnitTestL(CLoadManager_CreateAndDestroy_UnitTest::NewL(iDataLogger, *this));
       
   105 	//AddUnitTestL(CLoadManager_FindInstantiationAndDestroy_UnitTest::NewL(iDataLogger, *this));
       
   106 	AddUnitTestL(CLoadManager_FindInstantiationFailure_UnitTest::NewL(iDataLogger, *this));
       
   107 	//AddUnitTestL(CLoadManager_DefectFOT56ULPM_UnitTest::NewL(iDataLogger, *this));
       
   108 	}
       
   109 
       
   110 // ______________________________________________________________________________
       
   111 //
       
   112 EXPORT_C CComponentTester* NewComponentTestLC(CDataLogger& aDataLogger,
       
   113 									MComponentTestObserver&	aComponentTestObserver)
       
   114 	{
       
   115 	return CLoadManager_ComponentTest::NewLC(aDataLogger, aComponentTestObserver);
       
   116 	}
       
   117 
       
   118 // ___________________________________________________________________________
       
   119 //
       
   120 // This section of the module simply includes the exported test harness template which
       
   121 // makes this a "whole" CPP file with a E32Main entry point below. The test MMP
       
   122 // project file can then produce a EXE for the test project instead of a DLL.
       
   123 
       
   124 #include <ecom/test_bed/testharnesstemplate.h>
       
   125 
       
   126 GLDEF_C TInt E32Main()
       
   127 	{
       
   128 	test.Title();
       
   129 	test.Start(_L(" @SYMTestCaseID:SYSLIB-ECOM-LEGACY-LOADMANAGERTEST-0001 "));
       
   130 
       
   131 	test.End();
       
   132 	test.Close();
       
   133 
       
   134 	return E32Main_TestHarness(NewComponentTestLC);
       
   135 	}
       
   136