os/ossrv/genericservices/httputils/Test/t_uriparser/CSipUriAndAuthorityTest.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 // Copyright (c) 2004-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 //
    15 
    16 #ifndef __CSIPURIANDAUTHORITYTEST_H__
    17 #define __CSIPURIANDAUTHORITYTEST_H__
    18 
    19 // System includes
    20 //
    21 #include <e32base.h>
    22 
    23 // Local includes
    24 #include "ctestbase.h"
    25 
    26 // CSipUriAndAuthorityTest - test class for the Uri and Authority family of classes
    27 //
    28 class CSipUriAndAuthorityTest : public CTestBase
    29 	{
    30 public:
    31 
    32 	// Static factory c'tor. Leaves pointer to created object on the cleanup stack.
    33 	//
    34 	// Rtn: pointer to newly created object - ownership transfered to caller.
    35 	//
    36 	static CSipUriAndAuthorityTest* NewLC(CIpuTestHarness* aTestHarness);
    37 
    38 	// Static factory c'tor.
    39 	//
    40 	// Rtn: pointer to newly created object - ownership transfered to caller.
    41 	//
    42 	static CSipUriAndAuthorityTest* NewL(CIpuTestHarness* aTestHarness);
    43 
    44 	// D'tor
    45 	//
    46 	~CSipUriAndAuthorityTest();
    47 
    48 	// Runs the defined tests.
    49 	//
    50 	void DoTestsL();
    51 
    52 	// Default c'tor.
    53 	//
    54 	CSipUriAndAuthorityTest(CIpuTestHarness* aTestHarness);
    55 
    56 private:	// Methods
    57 
    58 	// Non-trivial c'tor. Second part of 2-phase construction - does all allocation.
    59 	//
    60 	void ConstructL();
    61 private:	// Attributes
    62 
    63 	// Open session and file
    64 	TInt OpenSipURIFile();
    65 
    66 	// In:
    67 	// aError			- the error code
    68 	// aSipUri			- the SIP URI that is currently being validated
    69 	//
    70 	void SipLogError(TInt aError, const TDesC16& aSipUri) const;
    71 
    72 	// In:
    73 	//aSipUri			- the sip uri that we are currently using
    74 	// aError			- the error code
    75 	//
    76 	void LogErrorMessage(const TDesC16& aSipUri, const TInt aError)const;
    77 
    78 	//Validate SIP URIs
    79 	//
    80 	TInt SipUriValidationL();
    81 
    82 	//Compare 2 SIP URIs
    83 	//
    84 	TInt SipUriEquivalenceL();
    85 	
    86 	// Test harness
    87 	CIpuTestHarness*	iTestHarness;
    88 	
    89 	TFileText iTUriParserFile;
    90 	RFs iFsSession;
    91 	TBool iFoundEquivalence;
    92 	};
    93 
    94 #endif	// __CSIPURIANDAUTHORITYTEST_H__