diff -r 000000000000 -r 2c201484c85f cryptoservices/certificateandkeymgmt/tcertstore/doctestharness.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cryptoservices/certificateandkeymgmt/tcertstore/doctestharness.cpp Wed Jul 08 11:25:26 2009 +0100 @@ -0,0 +1,190 @@ +/* +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the License "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* \page pt Test Harness for the certificate store manager +*

Testing

+*

Test goals

+*

We want to the entire API for CCertStore and CCertStoreManager. Some other classes +* will tested indirectly by these tests i.e. the other classes in certstore.h and the file +* certstore implementation.

+*

Test cases

+* IMPORT_C const RArray& Clients() const; +* IMPORT_C void GetCACerts(RPointerArray& aEntries, +* const TCACertStoreFilter& aFilter, TRequestStatus& aStatus); +* IMPORT_C void GetUserCerts(RPointerArray& aEntries, +* const TUserCertStoreFilter& aFilter, TRequestStatus& aStatus); +* IMPORT_C TInt StoreCount() const; +* IMPORT_C CCertStore& Store(TInt aIndex) const; +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +* +*
1. Opening, initializing and deleting the certificate store managerThis series of tests open, initialize and delete the certificate store manager.IMPORT_C static CCertStoreManager* NewL(RFs& aFs, TBool aOpenForWrite);
+* IMPORT_C static CCertStoreManager* NewLC(RFs& aFs, TBool aOpenForWrite);
+* IMPORT_C ~CCertStoreManager();
+* IMPORT_C void Initialise(TRequestStatus& aStatus);
1.1. Opening, initializing and deleting, usual steps.
1.1.1. Creating and initializing the certificate store manager
1.1.2. Deleting the certificate store manager
1.2. Opening, initializing and trying to open another certificate manager
1.2.1. Creating and initializing the certificate store manager
1.2.2. Creating and initializing another certificate store manager
1.2.3. Deleting the certificate store manager
1.2.4. Opening a certificate store manager
1.2.5. Deleting certificate store manager
2. Adding and removing clientsIMPORT_C void AddClientL(const TCertManClientInfo& aClient);
+* IMPORT_C void RemoveClientL(const TUid& aUid);
2.1. Adding and retrieving a client
2.1.1. Initializing the manager
2.1.2. Adding a client
2.1.3. Retrieving the clients
2.1.4. Deleting the client
2.1.5. Deleting the manager
2.2. Adding and retrieving a client, closing the store between the adding and the +* retrieving
2.2.1. Initializing the manager
2.2.2. Adding a client
2.2.3. Deleting the manager
2.2.4. Initializing the manager
2.2.5. Retrieving the clients
2.2.6. Deleting the client
2.2.7. Deleting the manager
2.3. Adding and removing 2 clients
2.3.1. Initializing the manager
2.3.2. Adding a client (1001)
2.3.3. Adding a client (1002)
2.3.4. Retrieving the clients
2.3.5. Deleting one of the client (1001)
2.3.6. Retrieving the clients
2.3.7. Deleting one of the client (1002)
2.3.8. Retrieving the clients
2.3.9. Deleting the manager
2.4.1. Initializing the manager
2.4.2. Deleting a client that doesn't exist
2.4.3. Deleting the manager
+*

Testing with failures

+*

Introduction

+*

The following test script is meant to test the correct behaviour when errors occur.

+*

Test goals

+* This is a list of specific error conditions we have to test for. +* +* +* +* +*
Addition of a clientAddition to memory successfull but writing to the store +* fails
+*

Test cases

+* +* +* +* +*
1
+* 1) We initialize the store. +* 2) We get the clients and make sure there are none. This is to ensure that the test +* are meaningfull. +* 3) We add a client to the store but we make this operation fail after the memory cache +* is updated but before the stream is updated. +* 4) We get the clients and make sure that it is still empty. +* 5) We close the store manager. +* 6) We reopen it. +* 7) We get the clients and make sure that it is still empty. +* 8) We close the store. +* +*/ + + + + + +/** + @file +*/