messagingfw/msgurlhandler/test/basic/src/SmsSchemeHandlerTest.cpp
changeset 0 8e480a14352b
equal deleted inserted replaced
-1:000000000000 0:8e480a14352b
       
     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 CSmsSchemeHandler 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 /**
       
    22  @file
       
    23  @SYMCreationDate Created : 01/06/01 14:07:22
       
    24 */
       
    25 #include "SmsSchemeHandlerUnitTest.h"
       
    26 #include <ecom/test_bed/componenttester.h>
       
    27 
       
    28 // ______________________________________________________________________________
       
    29 //
       
    30 /**
       
    31 	@internalTechnology
       
    32 	@class
       
    33 	Comments : Test the CSmsSchemeHandler class.
       
    34  */
       
    35 class CSmsSchemeHandler_ComponentTest : public CComponentTester
       
    36 	{
       
    37 public:
       
    38 	/**
       
    39 		@fn				NewLC(CDataLogger& aDataLogger,
       
    40 							 MComponentTestObserver& aObserver)
       
    41 		Intended Usage	: Standard two-phase construction which leaves nothing on the
       
    42 						cleanup stack.
       
    43 		Error Condition	: Leaves with the error code.
       
    44 		@leave		KErrNoMemory
       
    45 		@since			6.0
       
    46 		@param			aDataLogger The output logging object.
       
    47 		@param			aObserver The observer of this component test.
       
    48 		@return			CSmsSchemeHandler_ComponentTest* The constructed object.
       
    49 		@pre 			None.
       
    50 		@post			CSmsSchemeHandler_ComponentTest is fully constructed.
       
    51 	*/
       
    52 	static CSmsSchemeHandler_ComponentTest* NewLC(CDataLogger& aDataLogger, 
       
    53 							MComponentTestObserver& aObserver);
       
    54 
       
    55 private:
       
    56 	/**
       
    57 		@fn				CSmsSchemeHandler_ComponentTest(CDataLogger& aDataLogger,
       
    58 											MComponentTestObserver& aObserver)
       
    59 		Intended Usage	: Standard c'tor method.
       
    60 		Error Condition	: None.
       
    61 		@since			6.0
       
    62 		@param			aDataLogger The logging object.
       
    63 		@param			aObserver The observer of this component test.
       
    64 		@pre 			None.
       
    65 		@post			CSmsSchemeHandler_ComponentTest is fully constructed.
       
    66 	*/
       
    67 	inline CSmsSchemeHandler_ComponentTest(CDataLogger& aDataLogger,
       
    68 												MComponentTestObserver& aObserver);
       
    69 	/**
       
    70 		@fn				void ConstructL()
       
    71 		Intended Usage	: Second phase of safe two phase construction, 
       
    72 						to complete the object initialisation.
       
    73 		Error Condition	: Leaves with an error code.
       
    74 		@leave		KErrNoMemory.
       
    75 		@since			6.0
       
    76 		@return			None 
       
    77 		@pre 			CSmsSchemeHandler_ComponentTest is fully constructed.
       
    78 		@post			CSmsSchemeHandler_ComponentTest is fully initialised.
       
    79 	*/
       
    80 	inline void ConstructL();
       
    81 
       
    82 	};	// CSmsSchemeHandler_ComponentTest
       
    83 
       
    84 // ______________________________________________________________________________
       
    85 //
       
    86 EXPORT_C CComponentTester* NewComponentTestLC(CDataLogger& aDataLogger,
       
    87 									MComponentTestObserver&	aComponentTestObserver)
       
    88 	{
       
    89 	return CSmsSchemeHandler_ComponentTest::NewLC(aDataLogger, aComponentTestObserver);
       
    90 	}
       
    91 
       
    92 // ___________________________________________________________________________
       
    93 //
       
    94 // This section of the module simply includes the exported test harness template which 
       
    95 // makes this a "whole" CPP file with a E32Main entry point below. The test MMP 
       
    96 // project file can then produce a EXE for the test project instead of a DLL.
       
    97 
       
    98 #include <ecom/test_bed/testharnesstemplate.h>
       
    99 
       
   100 GLDEF_C TInt E32Main()
       
   101 	{
       
   102 	return E32Main_TestHarness(NewComponentTestLC);
       
   103 	}
       
   104 
       
   105 // ______________________________________________________________________________
       
   106 //
       
   107 inline CSmsSchemeHandler_ComponentTest* CSmsSchemeHandler_ComponentTest::NewLC(CDataLogger& aDataLogger, MComponentTestObserver& aObserver)
       
   108 	{
       
   109 	CSmsSchemeHandler_ComponentTest* self = new (ELeave) CSmsSchemeHandler_ComponentTest(aDataLogger, aObserver);
       
   110 	CleanupStack::PushL(self);
       
   111 	self->ConstructL();
       
   112 	return self;
       
   113 	}
       
   114 
       
   115 inline CSmsSchemeHandler_ComponentTest::CSmsSchemeHandler_ComponentTest(CDataLogger& aDataLogger,
       
   116 									MComponentTestObserver& aObserver)
       
   117 : CComponentTester(aDataLogger, aObserver)
       
   118 	{
       
   119 	// Do nothing here.
       
   120 	}
       
   121 
       
   122 inline void CSmsSchemeHandler_ComponentTest::ConstructL()
       
   123 	{
       
   124 	// Perform base class initialization
       
   125 	ComponentTesterConstructL();
       
   126 
       
   127 	AddUnitTestL(CSmsSchemeHandler_CreateAndDestroy_UnitTest::NewL(iDataLogger, *this));
       
   128 	AddUnitTestL(CSmsSchemeHandler_ParseUrlTest1_UnitTest::NewL(iDataLogger, *this));
       
   129 	AddUnitTestL(CSmsSchemeHandler_ParseUrlTest2_UnitTest::NewL(iDataLogger, *this));
       
   130 	AddUnitTestL(CSmsSchemeHandler_ParseUrlTest3_UnitTest::NewL(iDataLogger, *this));
       
   131 	AddUnitTestL(CSmsSchemeHandler_ParseUrlTest4_UnitTest::NewL(iDataLogger, *this));
       
   132 	AddUnitTestL(CSmsSchemeHandler_ParseUrlTest5_UnitTest::NewL(iDataLogger, *this));
       
   133 	AddUnitTestL(CSmsSchemeHandler_ParseUrlTest6_UnitTest::NewL(iDataLogger, *this));
       
   134 	}
       
   135