deviceupdatesui/omadmadapters/syncmldm12/tsrc/src/syncmldm12testBlocks.cpp
changeset 45 0f9fc722d255
parent 44 137912d1a556
child 46 b9b00b134b0d
equal deleted inserted replaced
44:137912d1a556 45:0f9fc722d255
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of DM adapter test component
       
    15 * 	This is part of omadmextensions/adapter test application.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 // INCLUDE FILES
       
    25 #include <e32svr.h>
       
    26 #include <StifParser.h>
       
    27 #include <Stiftestinterface.h>
       
    28 #include "syncmldm12Test.h"
       
    29 #include <e32math.h>
       
    30 #include <f32file.h>
       
    31 #include <swinstapi.h>
       
    32 
       
    33 
       
    34 //using namespace NApplicationManagement;//Dipak
       
    35 
       
    36 // ============================ MEMBER FUNCTIONS ===============================
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // Csyncmldm12Test::Delete
       
    40 // Delete here all resources allocated and opened from test methods. 
       
    41 // Called from destructor. 
       
    42 // -----------------------------------------------------------------------------
       
    43 //
       
    44 void Csyncmldm12Test::Delete() 
       
    45     {
       
    46     
       
    47     }
       
    48     
       
    49 // -----------------------------------------------------------------------------
       
    50 // Csyncmldm12Test::RunMethodL
       
    51 // Run specified method. Contains also table of test mothods and their names.
       
    52 // -----------------------------------------------------------------------------
       
    53 //
       
    54 TInt Csyncmldm12Test::RunMethodL( 
       
    55     CStifItemParser& aItem ) 
       
    56     {
       
    57    
       
    58     TStifFunctionInfo const KFunctions[] =
       
    59         {  
       
    60         // Copy this line for every implemented function.
       
    61         // First string is the function name used in TestScripter script file.
       
    62         // Second is the actual implementation member function. 
       
    63         ENTRY( "DDFStructure", Csyncmldm12Test::DDFStructureL),
       
    64         ENTRY( "FetchNode", Csyncmldm12Test::FetchNodeL ),
       
    65         ENTRY( "FetchLeaf", Csyncmldm12Test::FetchLeafL ),
       
    66         ENTRY( "AddNode", Csyncmldm12Test::AddNodeL ),
       
    67         ENTRY( "UpdateLeaf", Csyncmldm12Test::UpdateLeafL ),
       
    68         ENTRY( "UpdateLeafData", Csyncmldm12Test::UpdateLeafDataL ),
       
    69         ENTRY( "Execute", Csyncmldm12Test::ExecuteLeafL ),
       
    70         ENTRY( "ExecuteData", Csyncmldm12Test::ExecuteLeafDataL ),
       
    71         ENTRY( "DeleteNode", Csyncmldm12Test::DeleteObjectL ),
       
    72         ENTRY( "StartAtomic", Csyncmldm12Test::StartAtomicL),
       
    73 	    ENTRY( "CommitAtomic", Csyncmldm12Test::CommitAtomicL),
       
    74 	    ENTRY( "RollbackAtomic", Csyncmldm12Test::RollbackAtomicL),
       
    75 	    ENTRY( "CompleteCommands", Csyncmldm12Test::CompleteCommandsL),
       
    76         };
       
    77 
       
    78     const TInt count = sizeof( KFunctions ) / 
       
    79                         sizeof( TStifFunctionInfo );
       
    80 
       
    81     return RunInternalL( KFunctions, count, aItem );
       
    82 
       
    83     }    
       
    84 
       
    85         
       
    86         
       
    87 HBufC8 *Csyncmldm12Test::GetNextStringLC ( CStifItemParser& aItem, const TDesC &aName )
       
    88 	{
       
    89 	TPtrC nodename;
       
    90 	nodename.Set( KNullDesC );
       
    91 
       
    92     TInt i( aItem.GetNextString ( nodename ) );
       
    93     if ( i != KErrNone ) 
       
    94 	    {
       
    95 	    iLog->Log( _L( "ERROR Reading '%S' argument: 0x%X" ), &aName, i );
       
    96 	    }
       
    97 	else
       
    98 		{
       
    99 		iLog->Log( _L("%S: %S"), &aName, &nodename);
       
   100 		}
       
   101 	
       
   102 	HBufC8 *buf = HBufC8::NewLC( nodename.Length() ) ;
       
   103 	buf->Des().Copy( nodename );
       
   104 	
       
   105 	return buf;
       
   106 	}
       
   107 	
       
   108 //  End of File