sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
* \page pt Test Harness for the certificate store manager
|
sl@0
|
16 |
* <H2>Testing</H2>
|
sl@0
|
17 |
* <H3>Test goals</H3>
|
sl@0
|
18 |
* <P>We want to the entire API for CCertStore and CCertStoreManager. Some other classes
|
sl@0
|
19 |
* will tested indirectly by these tests i.e. the other classes in certstore.h and the file
|
sl@0
|
20 |
* certstore implementation.</P>
|
sl@0
|
21 |
* <P>Test cases</P>
|
sl@0
|
22 |
* IMPORT_C const RArray<TCertManClientInfo>& Clients() const;
|
sl@0
|
23 |
* IMPORT_C void GetCACerts(RPointerArray<CCACertStoreEntry>& aEntries,
|
sl@0
|
24 |
* const TCACertStoreFilter& aFilter, TRequestStatus& aStatus);
|
sl@0
|
25 |
* IMPORT_C void GetUserCerts(RPointerArray<CUserCertStoreEntry>& aEntries,
|
sl@0
|
26 |
* const TUserCertStoreFilter& aFilter, TRequestStatus& aStatus);
|
sl@0
|
27 |
* IMPORT_C TInt StoreCount() const;
|
sl@0
|
28 |
* IMPORT_C CCertStore& Store(TInt aIndex) const;
|
sl@0
|
29 |
* <TABLE BORDER1>
|
sl@0
|
30 |
* <TR>
|
sl@0
|
31 |
* <TD>1. Opening, initializing and deleting the certificate store manager</TD>
|
sl@0
|
32 |
* <TD>This series of tests open, initialize and delete the certificate store manager.</TD>
|
sl@0
|
33 |
* <TD>IMPORT_C static CCertStoreManager* NewL(RFs& aFs, TBool aOpenForWrite);<BR>
|
sl@0
|
34 |
* IMPORT_C static CCertStoreManager* NewLC(RFs& aFs, TBool aOpenForWrite);<BR>
|
sl@0
|
35 |
* IMPORT_C ~CCertStoreManager();<BR>
|
sl@0
|
36 |
* IMPORT_C void Initialise(TRequestStatus& aStatus);<BR></TD>
|
sl@0
|
37 |
* </TR>
|
sl@0
|
38 |
* <TR>
|
sl@0
|
39 |
* <TD>1.1. Opening, initializing and deleting, usual steps.</TD>
|
sl@0
|
40 |
* </TR>
|
sl@0
|
41 |
* <TR>
|
sl@0
|
42 |
* <TD>1.1.1. Creating and initializing the certificate store manager</TD>
|
sl@0
|
43 |
* </TR>
|
sl@0
|
44 |
* <TR>
|
sl@0
|
45 |
* <TD>1.1.2. Deleting the certificate store manager</TD>
|
sl@0
|
46 |
* </TR>
|
sl@0
|
47 |
* <TR>
|
sl@0
|
48 |
* <TD>1.2. Opening, initializing and trying to open another certificate manager</TD>
|
sl@0
|
49 |
* </TR>
|
sl@0
|
50 |
* <TR>
|
sl@0
|
51 |
* <TD>1.2.1. Creating and initializing the certificate store manager</TD>
|
sl@0
|
52 |
* </TR>
|
sl@0
|
53 |
* <TR>
|
sl@0
|
54 |
* <TD>1.2.2. Creating and initializing another certificate store manager</TD>
|
sl@0
|
55 |
* </TR>
|
sl@0
|
56 |
* <TR>
|
sl@0
|
57 |
* <TD>1.2.3. Deleting the certificate store manager</TD>
|
sl@0
|
58 |
* </TR>
|
sl@0
|
59 |
* <TR>
|
sl@0
|
60 |
* <TD>1.2.4. Opening a certificate store manager</TD>
|
sl@0
|
61 |
* </TR>
|
sl@0
|
62 |
* <TR>
|
sl@0
|
63 |
* <TD>1.2.5. Deleting certificate store manager</TD>
|
sl@0
|
64 |
* </TR>
|
sl@0
|
65 |
* <TR>
|
sl@0
|
66 |
* <TD>2. Adding and removing clients</TD>
|
sl@0
|
67 |
* <TD>IMPORT_C void AddClientL(const TCertManClientInfo& aClient);<BR>
|
sl@0
|
68 |
* IMPORT_C void RemoveClientL(const TUid& aUid);</TD>
|
sl@0
|
69 |
* </TD>
|
sl@0
|
70 |
* </TR>
|
sl@0
|
71 |
* <TR>
|
sl@0
|
72 |
* <TD>2.1. Adding and retrieving a client</TD>
|
sl@0
|
73 |
* </TR>
|
sl@0
|
74 |
* <TR>
|
sl@0
|
75 |
* <TD>2.1.1. Initializing the manager</TD>
|
sl@0
|
76 |
* </TR>
|
sl@0
|
77 |
* <TR>
|
sl@0
|
78 |
* <TD>2.1.2. Adding a client</TD>
|
sl@0
|
79 |
* </TR>
|
sl@0
|
80 |
* <TR>
|
sl@0
|
81 |
* <TD>2.1.3. Retrieving the clients</TD>
|
sl@0
|
82 |
* </TR>
|
sl@0
|
83 |
* <TR>
|
sl@0
|
84 |
* <TD>2.1.4. Deleting the client</TD>
|
sl@0
|
85 |
* </TR>
|
sl@0
|
86 |
* <TR>
|
sl@0
|
87 |
* <TD>2.1.5. Deleting the manager</TD>
|
sl@0
|
88 |
* </TR>
|
sl@0
|
89 |
* <TR>
|
sl@0
|
90 |
* <TD>2.2. Adding and retrieving a client, closing the store between the adding and the
|
sl@0
|
91 |
* retrieving</TD>
|
sl@0
|
92 |
* </TR>
|
sl@0
|
93 |
* <TR>
|
sl@0
|
94 |
* <TD>2.2.1. Initializing the manager</TD>
|
sl@0
|
95 |
* </TR>
|
sl@0
|
96 |
* <TR>
|
sl@0
|
97 |
* <TD>2.2.2. Adding a client</TD>
|
sl@0
|
98 |
* </TR>
|
sl@0
|
99 |
* <TR>
|
sl@0
|
100 |
* <TD>2.2.3. Deleting the manager</TD>
|
sl@0
|
101 |
* </TR>
|
sl@0
|
102 |
* <TR>
|
sl@0
|
103 |
* <TD>2.2.4. Initializing the manager</TD>
|
sl@0
|
104 |
* </TR>
|
sl@0
|
105 |
* <TR>
|
sl@0
|
106 |
* <TD>2.2.5. Retrieving the clients</TD>
|
sl@0
|
107 |
* </TR>
|
sl@0
|
108 |
* <TR>
|
sl@0
|
109 |
* <TD>2.2.6. Deleting the client</TD>
|
sl@0
|
110 |
* </TR>
|
sl@0
|
111 |
* <TR>
|
sl@0
|
112 |
* <TD>2.2.7. Deleting the manager</TD>
|
sl@0
|
113 |
* </TR>
|
sl@0
|
114 |
* <TR>
|
sl@0
|
115 |
* <TD>2.3. Adding and removing 2 clients</TD>
|
sl@0
|
116 |
* </TR>
|
sl@0
|
117 |
* <TR>
|
sl@0
|
118 |
* <TD>2.3.1. Initializing the manager</TD>
|
sl@0
|
119 |
* </TR>
|
sl@0
|
120 |
* <TR>
|
sl@0
|
121 |
* <TD>2.3.2. Adding a client (1001)</TD>
|
sl@0
|
122 |
* </TR>
|
sl@0
|
123 |
* <TR>
|
sl@0
|
124 |
* <TD>2.3.3. Adding a client (1002)</TD>
|
sl@0
|
125 |
* </TR>
|
sl@0
|
126 |
* <TR>
|
sl@0
|
127 |
* <TD>2.3.4. Retrieving the clients</TD>
|
sl@0
|
128 |
* </TR>
|
sl@0
|
129 |
* <TR>
|
sl@0
|
130 |
* <TD>2.3.5. Deleting one of the client (1001)</TD>
|
sl@0
|
131 |
* </TR>
|
sl@0
|
132 |
* <TR>
|
sl@0
|
133 |
* <TD>2.3.6. Retrieving the clients</TD>
|
sl@0
|
134 |
* </TR>
|
sl@0
|
135 |
* <TR>
|
sl@0
|
136 |
* <TD>2.3.7. Deleting one of the client (1002)</TD>
|
sl@0
|
137 |
* </TR>
|
sl@0
|
138 |
* <TR>
|
sl@0
|
139 |
* <TD>2.3.8. Retrieving the clients</TD>
|
sl@0
|
140 |
* </TR>
|
sl@0
|
141 |
* <TR>
|
sl@0
|
142 |
* <TD>2.3.9. Deleting the manager</TD>
|
sl@0
|
143 |
* </TR>
|
sl@0
|
144 |
* <TR>
|
sl@0
|
145 |
* <TD>2.4.1. Initializing the manager</TD>
|
sl@0
|
146 |
* </TR>
|
sl@0
|
147 |
* <TR>
|
sl@0
|
148 |
* <TD>2.4.2. Deleting a client that doesn't exist</TD>
|
sl@0
|
149 |
* </TR>
|
sl@0
|
150 |
* <TR>
|
sl@0
|
151 |
* <TD>2.4.3. Deleting the manager</TD>
|
sl@0
|
152 |
* </TR>
|
sl@0
|
153 |
* </TABLE>
|
sl@0
|
154 |
* <H2>Testing with failures</H2>
|
sl@0
|
155 |
* <H3>Introduction</H3>
|
sl@0
|
156 |
* <P>The following test script is meant to test the correct behaviour when errors occur.</P>
|
sl@0
|
157 |
* <H3>Test goals</H3>
|
sl@0
|
158 |
* This is a list of specific error conditions we have to test for.
|
sl@0
|
159 |
* <TABLE BORDER"1">
|
sl@0
|
160 |
* <TR>
|
sl@0
|
161 |
* <TD>Addition of a client</TD><TD>Addition to memory successfull but writing to the store
|
sl@0
|
162 |
* fails</TD>
|
sl@0
|
163 |
* </TR>
|
sl@0
|
164 |
* </TABLE>
|
sl@0
|
165 |
* <H3>Test cases</H3>
|
sl@0
|
166 |
* <TABLE BORDER1>
|
sl@0
|
167 |
* <TR>
|
sl@0
|
168 |
* <TD>1</TD>
|
sl@0
|
169 |
* </TR>
|
sl@0
|
170 |
* </TABLE>
|
sl@0
|
171 |
* 1) We initialize the store.
|
sl@0
|
172 |
* 2) We get the clients and make sure there are none. This is to ensure that the test
|
sl@0
|
173 |
* are meaningfull.
|
sl@0
|
174 |
* 3) We add a client to the store but we make this operation fail after the memory cache
|
sl@0
|
175 |
* is updated but before the stream is updated.
|
sl@0
|
176 |
* 4) We get the clients and make sure that it is still empty.
|
sl@0
|
177 |
* 5) We close the store manager.
|
sl@0
|
178 |
* 6) We reopen it.
|
sl@0
|
179 |
* 7) We get the clients and make sure that it is still empty.
|
sl@0
|
180 |
* 8) We close the store.
|
sl@0
|
181 |
*
|
sl@0
|
182 |
*/
|
sl@0
|
183 |
|
sl@0
|
184 |
|
sl@0
|
185 |
/**
|
sl@0
|
186 |
@file
|
sl@0
|
187 |
*/
|