44
|
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 "syncmldsTest.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 |
// CsyncmldsTest::Delete
|
|
40 |
// Delete here all resources allocated and opened from test methods.
|
|
41 |
// Called from destructor.
|
|
42 |
// -----------------------------------------------------------------------------
|
|
43 |
//
|
|
44 |
void CsyncmldsTest::Delete()
|
|
45 |
{
|
|
46 |
|
|
47 |
}
|
|
48 |
|
|
49 |
// -----------------------------------------------------------------------------
|
|
50 |
// CsyncmldsTest::RunMethodL
|
|
51 |
// Run specified method. Contains also table of test mothods and their names.
|
|
52 |
// -----------------------------------------------------------------------------
|
|
53 |
//
|
|
54 |
TInt CsyncmldsTest::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", CsyncmldsTest::DDFStructureL),
|
|
64 |
ENTRY( "FetchNode", CsyncmldsTest::FetchNodeL ),
|
|
65 |
ENTRY( "FetchLeaf", CsyncmldsTest::FetchLeafL ),
|
|
66 |
ENTRY( "AddNode", CsyncmldsTest::AddNodeL ),
|
|
67 |
ENTRY( "UpdateLeaf", CsyncmldsTest::UpdateLeafL ),
|
|
68 |
ENTRY( "UpdateLeafData", CsyncmldsTest::UpdateLeafDataL ),
|
|
69 |
ENTRY( "Execute", CsyncmldsTest::ExecuteLeafL ),
|
|
70 |
ENTRY( "ExecuteData", CsyncmldsTest::ExecuteLeafDataL ),
|
|
71 |
ENTRY( "DeleteNode", CsyncmldsTest::DeleteObjectL ),
|
|
72 |
ENTRY( "StartAtomic", CsyncmldsTest::StartAtomicL),
|
|
73 |
ENTRY( "CommitAtomic", CsyncmldsTest::CommitAtomicL),
|
|
74 |
ENTRY( "RollbackAtomic", CsyncmldsTest::RollbackAtomicL),
|
|
75 |
ENTRY( "CompleteCommands", CsyncmldsTest::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 *CsyncmldsTest::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
|