appfw/apparchitecture/tef/T_DataMappingPersistenceA.cpp
changeset 0 2e3d3ce01487
child 19 924385140d98
equal deleted inserted replaced
-1:000000000000 0:2e3d3ce01487
       
     1 // Copyright (c) 2005-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 /**
       
    17  @file
       
    18  @internalComponent - Internal Symbian test code  
       
    19 */
       
    20 
       
    21 #include "T_DataMappingPersistenceA.h"
       
    22 
       
    23 
       
    24 /**
       
    25  * Constructor
       
    26  */	
       
    27 CT_DataMappingPersistenceATestStep::CT_DataMappingPersistenceATestStep()
       
    28 	{
       
    29 	// Call base class method to set up the human readable name for logging
       
    30 	SetTestStepName(KT_DataMappingPersistenceAStep);
       
    31 	}
       
    32 
       
    33 /**
       
    34  * Destructor
       
    35  */
       
    36 CT_DataMappingPersistenceATestStep::~CT_DataMappingPersistenceATestStep()
       
    37 	{
       
    38 	iSession.Close();
       
    39 	}
       
    40 
       
    41 /**
       
    42  * @return - TVerdict code
       
    43  * Override of base class virtual
       
    44  */	
       
    45 TVerdict CT_DataMappingPersistenceATestStep::doTestStepPreambleL()
       
    46 	{
       
    47 	SetTestStepResult(EPass);
       
    48 	TInt error = iSession.Connect();
       
    49 	TEST(error==KErrNone);
       
    50 	return TestStepResult();
       
    51 	}
       
    52 
       
    53 /**
       
    54  * @return - TVerdict code
       
    55  * Override of base class virtual
       
    56  */
       
    57 TVerdict CT_DataMappingPersistenceATestStep::doTestStepPostambleL()
       
    58 	{
       
    59 	return TestStepResult();
       
    60 	}
       
    61 
       
    62 TVerdict CT_DataMappingPersistenceATestStep::doTestStepL()
       
    63 	{
       
    64 	INFO_PRINTF1(_L("Testing Apparc...T_DataMappingPersistenceA Test Cases Running..."));
       
    65 
       
    66 	TRAPD(ret,RunTestCasesL())
       
    67 	TEST(ret==KErrNone);
       
    68 	
       
    69 	INFO_PRINTF1(_L("...T_DataMappingPersistenceA Test Cases Completed."));
       
    70 
       
    71 	return TestStepResult();
       
    72 	}
       
    73 
       
    74 TInt CT_DataMappingPersistenceATestStep::RunTestCasesL()
       
    75 	{
       
    76 	//DONT_CHECK since array in type store is uncompressed
       
    77 	HEAP_TEST_LS_SESSION(iSession, 0, DONT_CHECK, TestInsertDataMappingL(), NO_CLEANUP);
       
    78 	
       
    79 	return KErrNone;
       
    80 	}
       
    81 	
       
    82 void CT_DataMappingPersistenceATestStep::TestInsertDataMappingL()
       
    83 	{
       
    84 	TUid appUid = {0x10004c58}; 
       
    85 	_LIT8(KLitMimeTypeData,"text/TestDataMappingPersistence");
       
    86 	TDataType dataType (KLitMimeTypeData);
       
    87 	TInt error = iSession.InsertDataMapping(dataType,1,appUid);	
       
    88 	TEST(error==KErrNone);
       
    89 	}