|
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 // INCLUDE FILES |
|
18 #include "xmlengtester.h" |
|
19 #include "xmlengtesterdef.h" |
|
20 #include <XmlEngxestd.h> |
|
21 #include <domain/osextensions/Stiftestinterface.h> |
|
22 |
|
23 #include <sys/reent.h> |
|
24 |
|
25 // EXTERNAL DATA STRUCTURES |
|
26 |
|
27 // EXTERNAL FUNCTION PROTOTYPES |
|
28 |
|
29 // CONSTANTS |
|
30 |
|
31 // MACROS |
|
32 |
|
33 // LOCAL CONSTANTS AND MACROS |
|
34 |
|
35 // MODULE DATA STRUCTURES |
|
36 |
|
37 // LOCAL FUNCTION PROTOTYPES |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 |
|
41 // ============================ MEMBER FUNCTIONS =============================== |
|
42 |
|
43 // ----------------------------------------------------------------------------- |
|
44 // CLibxml2Tester::CLibxml2Tester |
|
45 // C++ default constructor can NOT contain any code, that |
|
46 // might leave. |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 CLibxml2Tester::CLibxml2Tester( |
|
50 CTestModuleIf& aTestModuleIf ): |
|
51 CScriptBase( aTestModuleIf ) |
|
52 { |
|
53 } |
|
54 |
|
55 // ----------------------------------------------------------------------------- |
|
56 // CLibxml2Tester::ConstructL |
|
57 // Symbian 2nd phase constructor can leave. |
|
58 // ----------------------------------------------------------------------------- |
|
59 // |
|
60 void CLibxml2Tester::ConstructL() |
|
61 { |
|
62 iLog = CStifLogger::NewL( KXML_TestLogPath, |
|
63 KXML_TestLogFile, |
|
64 CStifLogger::ETxt, |
|
65 CStifLogger::EFile, |
|
66 EFalse ); |
|
67 |
|
68 XmlEngineAttachL(); |
|
69 |
|
70 DOM_impl.OpenL( ); |
|
71 |
|
72 parser.Open( DOM_impl ); |
|
73 |
|
74 infoNum = 0; |
|
75 iLastError = KErrNone; |
|
76 } |
|
77 |
|
78 // ----------------------------------------------------------------------------- |
|
79 // CLibxml2Tester::NewL |
|
80 // Two-phased constructor. |
|
81 // ----------------------------------------------------------------------------- |
|
82 // |
|
83 CLibxml2Tester* CLibxml2Tester::NewL( |
|
84 CTestModuleIf& aTestModuleIf ) |
|
85 { |
|
86 CLibxml2Tester* self = new (ELeave) CLibxml2Tester( aTestModuleIf ); |
|
87 |
|
88 CleanupStack::PushL( self ); |
|
89 self->ConstructL(); |
|
90 CleanupStack::Pop( self ); |
|
91 |
|
92 return self; |
|
93 |
|
94 } |
|
95 |
|
96 // Destructor |
|
97 CLibxml2Tester::~CLibxml2Tester() |
|
98 { |
|
99 |
|
100 if(iDoc.NotNull()) |
|
101 { |
|
102 iDoc.Close(); |
|
103 } |
|
104 parser.Close(); |
|
105 DOM_impl.Close(); |
|
106 XmlEngineCleanup(); |
|
107 CloseSTDLIB(); // Close EstLib here |
|
108 // Delete resources allocated from test methods |
|
109 Delete(); |
|
110 |
|
111 // Delete logger |
|
112 delete iLog; |
|
113 |
|
114 } |
|
115 |
|
116 // ========================== OTHER EXPORTED FUNCTIONS ========================= |
|
117 |
|
118 // ----------------------------------------------------------------------------- |
|
119 // LibEntryL is a polymorphic Dll entry point. |
|
120 // Returns: CScriptBase: New CScriptBase derived object |
|
121 // ----------------------------------------------------------------------------- |
|
122 // |
|
123 EXPORT_C CScriptBase* LibEntryL( |
|
124 CTestModuleIf& aTestModuleIf ) // Backpointer to STIF Test Framework |
|
125 { |
|
126 |
|
127 return ( CScriptBase* ) CLibxml2Tester::NewL( aTestModuleIf ); |
|
128 |
|
129 } |
|
130 |
|
131 // End of File |