sl@0: /* sl@0: * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * \page pt Test Harness for the certificate store manager sl@0: * <H2>Testing</H2> sl@0: * <H3>Test goals</H3> sl@0: * <P>We want to the entire API for CCertStore and CCertStoreManager. Some other classes sl@0: * will tested indirectly by these tests i.e. the other classes in certstore.h and the file sl@0: * certstore implementation.</P> sl@0: * <P>Test cases</P> sl@0: * IMPORT_C const RArray<TCertManClientInfo>& Clients() const; sl@0: * IMPORT_C void GetCACerts(RPointerArray<CCACertStoreEntry>& aEntries, sl@0: * const TCACertStoreFilter& aFilter, TRequestStatus& aStatus); sl@0: * IMPORT_C void GetUserCerts(RPointerArray<CUserCertStoreEntry>& aEntries, sl@0: * const TUserCertStoreFilter& aFilter, TRequestStatus& aStatus); sl@0: * IMPORT_C TInt StoreCount() const; sl@0: * IMPORT_C CCertStore& Store(TInt aIndex) const; sl@0: * <TABLE BORDER1> sl@0: * <TR> sl@0: * <TD>1. Opening, initializing and deleting the certificate store manager</TD> sl@0: * <TD>This series of tests open, initialize and delete the certificate store manager.</TD> sl@0: * <TD>IMPORT_C static CCertStoreManager* NewL(RFs& aFs, TBool aOpenForWrite);<BR> sl@0: * IMPORT_C static CCertStoreManager* NewLC(RFs& aFs, TBool aOpenForWrite);<BR> sl@0: * IMPORT_C ~CCertStoreManager();<BR> sl@0: * IMPORT_C void Initialise(TRequestStatus& aStatus);<BR></TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>1.1. Opening, initializing and deleting, usual steps.</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>1.1.1. Creating and initializing the certificate store manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>1.1.2. Deleting the certificate store manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>1.2. Opening, initializing and trying to open another certificate manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>1.2.1. Creating and initializing the certificate store manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>1.2.2. Creating and initializing another certificate store manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>1.2.3. Deleting the certificate store manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>1.2.4. Opening a certificate store manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>1.2.5. Deleting certificate store manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2. Adding and removing clients</TD> sl@0: * <TD>IMPORT_C void AddClientL(const TCertManClientInfo& aClient);<BR> sl@0: * IMPORT_C void RemoveClientL(const TUid& aUid);</TD> sl@0: * </TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.1. Adding and retrieving a client</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.1.1. Initializing the manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.1.2. Adding a client</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.1.3. Retrieving the clients</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.1.4. Deleting the client</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.1.5. Deleting the manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.2. Adding and retrieving a client, closing the store between the adding and the sl@0: * retrieving</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.2.1. Initializing the manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.2.2. Adding a client</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.2.3. Deleting the manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.2.4. Initializing the manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.2.5. Retrieving the clients</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.2.6. Deleting the client</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.2.7. Deleting the manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3. Adding and removing 2 clients</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3.1. Initializing the manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3.2. Adding a client (1001)</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3.3. Adding a client (1002)</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3.4. Retrieving the clients</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3.5. Deleting one of the client (1001)</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3.6. Retrieving the clients</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3.7. Deleting one of the client (1002)</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3.8. Retrieving the clients</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.3.9. Deleting the manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.4.1. Initializing the manager</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.4.2. Deleting a client that doesn't exist</TD> sl@0: * </TR> sl@0: * <TR> sl@0: * <TD>2.4.3. Deleting the manager</TD> sl@0: * </TR> sl@0: * </TABLE> sl@0: * <H2>Testing with failures</H2> sl@0: * <H3>Introduction</H3> sl@0: * <P>The following test script is meant to test the correct behaviour when errors occur.</P> sl@0: * <H3>Test goals</H3> sl@0: * This is a list of specific error conditions we have to test for. sl@0: * <TABLE BORDER"1"> sl@0: * <TR> sl@0: * <TD>Addition of a client</TD><TD>Addition to memory successfull but writing to the store sl@0: * fails</TD> sl@0: * </TR> sl@0: * </TABLE> sl@0: * <H3>Test cases</H3> sl@0: * <TABLE BORDER1> sl@0: * <TR> sl@0: * <TD>1</TD> sl@0: * </TR> sl@0: * </TABLE> sl@0: * 1) We initialize the store. sl@0: * 2) We get the clients and make sure there are none. This is to ensure that the test sl@0: * are meaningfull. sl@0: * 3) We add a client to the store but we make this operation fail after the memory cache sl@0: * is updated but before the stream is updated. sl@0: * 4) We get the clients and make sure that it is still empty. sl@0: * 5) We close the store manager. sl@0: * 6) We reopen it. sl@0: * 7) We get the clients and make sure that it is still empty. sl@0: * 8) We close the store. sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: */