|
1 // Copyright (c) 1997-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 // The state accessor class definitionss for the CLoadManager class |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef __LOADMANAGERSTATEACCESSOR_H__ |
|
19 #define __LOADMANAGERSTATEACCESSOR_H__ |
|
20 |
|
21 #include <e32base.h> |
|
22 #include <f32file.h> |
|
23 #include <s32stor.h> |
|
24 #include <s32file.h> |
|
25 |
|
26 #include "TestUtilities.h" |
|
27 #include <ecom/test_bed/testbeddefinitions.h> |
|
28 #include "StateAccessor.h" |
|
29 #include "LoadManager.h" |
|
30 |
|
31 const TUid KUniqueDllUid = {0x10009DB1}; |
|
32 const TUid KUniqueImplementationUid_Works = {0x10009DC3}; |
|
33 const TUid KUniqueImplementationUid_Fails = {0x10009DC1}; |
|
34 |
|
35 // ______________________________________________________________________________ |
|
36 // |
|
37 /** |
|
38 @internalComponent |
|
39 Comments : State accessor for the CLoadManager object under test. |
|
40 */ |
|
41 class TLoadManager_StateAccessor : public MStateAccessor |
|
42 { |
|
43 public: |
|
44 /** |
|
45 @fn InvariantTest(TAny* aTestObject) |
|
46 Intended Usage : Checks that CLoadManager has not violated its invariants. |
|
47 @since 7.0 |
|
48 @param TAny* A pointer to the object under test. |
|
49 @return TInt KErrNone if the invariants were valid, error code otherwise. |
|
50 @pre TLoadManager_StateAccessor is fully constructed. |
|
51 @post The class under test is set to the state specified. |
|
52 */ |
|
53 inline TInt InvariantTest(TAny* aTestObject); |
|
54 |
|
55 /** |
|
56 @fn Internalize(TAny* aTestObject) |
|
57 Intended Usage : Implemented by the developer to set the state of the object under test. |
|
58 @since 7.0 |
|
59 @param aTestObject The object to be tested |
|
60 @return KErrNone if the internalize was successful. |
|
61 @return One of the EPOC standard error codes indicating the reason |
|
62 for the failure to load the object state. |
|
63 @pre TLoadManager_StateAccessor is fully constructed, and |
|
64 valid test object must be passed in. |
|
65 @post The class under test is set to the state specified |
|
66 */ |
|
67 inline virtual TInt Internalize(TAny* aTestObject); |
|
68 |
|
69 /** |
|
70 @fn Externalize(TAny* aTestObject) |
|
71 Intended Usage : Implemented by the developer to persist the state of the object under test. |
|
72 @since 7.0 |
|
73 @param aTestObject The object to be tested |
|
74 @return KErrNone if the internalize was successful. |
|
75 @return One of the EPOC standard error codes indicating the reason |
|
76 for the failure to externalize the object. |
|
77 @pre TLoadManager_StateAccessor is fully constructed, and |
|
78 valid test object must be passed in. |
|
79 @post Returns an error code dependant on the result of the test |
|
80 */ |
|
81 inline virtual TInt Externalize(TAny* aTestObject); |
|
82 |
|
83 /** |
|
84 @fn InternalizeL(RFileReadStream& aStream, CLoadManager* aLoadManager) |
|
85 Intended Usage : Implemented by the developer to set the state of the object under test. |
|
86 Error Condition : Leaves with an error code. |
|
87 @since 7.0 |
|
88 @param aStream The filestram to read from . |
|
89 @param aLoadManager A pointer to the CLoadManager object under test. |
|
90 @return None. |
|
91 @pre TLoadManager_StateAccessor is fully constructed. |
|
92 @post The class under test is set to the state specified. |
|
93 */ |
|
94 inline void InternalizeL(RFileReadStream& aStream, CLoadManager* aLoadManager); |
|
95 |
|
96 /** |
|
97 @fn ExternalizeL(RFileWriteStream& aStream, CLoadManager* aLoadManager) |
|
98 Intended Usage : Implemented by the developer to persist the state of the object under test. |
|
99 Error Condition : Leaves with an error code. |
|
100 @since 7.0 |
|
101 @param aStream The filestream to persist into. |
|
102 @param aLoadManager A pointer to the CLoadManager object under test. |
|
103 @return None. |
|
104 @pre TLoadManager_StateAccessor is fully constructed. |
|
105 @post No change to the class under test, its internal state. |
|
106 is persisted. |
|
107 */ |
|
108 inline void ExternalizeL(RFileWriteStream& aStream, CLoadManager* aLoadManager); |
|
109 |
|
110 private: |
|
111 /** |
|
112 @fn InternalizeL(CLoadManager* aLoadManager) |
|
113 Intended Usage : Implemented by the developer to set the state of the object under test. |
|
114 Error Condition : Leaves with an error code. |
|
115 @since 7.0 |
|
116 @param aLoadManager A pointer to the CLoadManager object under test. |
|
117 @return None. |
|
118 @pre TLoadManager_StateAccessor is fully constructed. |
|
119 @post The class under test is set to the state specified. |
|
120 */ |
|
121 inline void InternalizeL(CLoadManager* aLoadManager); |
|
122 |
|
123 /** |
|
124 @fn ExternalizeL(CLoadManager* aLoadManager) |
|
125 Intended Usage : Implemented by the developer to persist the state of the object under test. |
|
126 Error Condition : Leaves with an error code. |
|
127 @since 7.0 |
|
128 @param aLoadManager A pointer to the CLoadManager object under test. |
|
129 @return None. |
|
130 @pre TLoadManager_StateAccessor is fully constructed. |
|
131 @post No change to the class under test, its internal state. |
|
132 is persisted. |
|
133 */ |
|
134 inline void ExternalizeL(CLoadManager* aLoadManager); |
|
135 }; // TLoadManager_StateAccessor |
|
136 |
|
137 |
|
138 #include "LoadManagerStateAccessor.inl" |
|
139 |
|
140 #endif // __LOADMANAGERSTATEACCESSOR_H__ |