wlanutilities/wlanwizard/t_wlanwizard/stubs/eapqtconfiginterface_stub.cpp
changeset 53 bdc64aa9b954
parent 49 fb81b597edf1
child 60 822a45792fdd
equal deleted inserted replaced
49:fb81b597edf1 53:bdc64aa9b954
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  *   Stub for EAP method configuration QT interface
       
    16  *
       
    17  */
       
    18 
       
    19 /*
       
    20  * %version: 5 %
       
    21  */
       
    22 
       
    23 #include <QList>
       
    24 #include <QDebug>
       
    25 #include <QTest>
       
    26 #include "eapqtconfiginterface.h"
       
    27 
       
    28 //----------------------------------------------------------------------------
       
    29 //              EapQtConfigInterface
       
    30 //----------------------------------------------------------------------------
       
    31 
       
    32 EapQtConfigInterface::EapQtConfigInterface(
       
    33     const EapBearerType bearerType, 
       
    34     const int iapId)
       
    35 {
       
    36     mCalledMethods.append("EapQtConfigInterface");
       
    37     QCOMPARE(bearerType, EapQtConfigInterface::EapBearerTypeWlan);
       
    38     QCOMPARE(iapId, EapQtConfigInterface::IapIdUndefined);
       
    39 }
       
    40 
       
    41 EapQtConfigInterface::~EapQtConfigInterface()
       
    42 {
       
    43     mCalledMethods.append("~EapQtConfigInterface");
       
    44 }
       
    45 
       
    46 bool EapQtConfigInterface::setConfigurationReference(const int iapId)
       
    47 {
       
    48     mCalledMethods.append("setConfigurationReference");
       
    49     QCOMPARE(iapId, mIapId);
       
    50     
       
    51     return mReturnSetConfigurationReference;
       
    52 }
       
    53 
       
    54 QList<EapQtCertificateInfo> EapQtConfigInterface::certificateAuthorityCertificates()
       
    55 {
       
    56     mCalledMethods.append("certificateAuthorityCertificates");
       
    57     return mCertsCa;
       
    58 }
       
    59 
       
    60 QList<EapQtCertificateInfo> EapQtConfigInterface::userCertificates()
       
    61 {
       
    62     mCalledMethods.append("userCertificates");
       
    63     return mCertsUser;
       
    64 }
       
    65 
       
    66 
       
    67 bool EapQtConfigInterface::updateCertificates()
       
    68 {
       
    69     mCalledMethods.append("updateCertificates");
       
    70     return true;
       
    71 }
       
    72 
       
    73 bool EapQtConfigInterface::isSupportedOuterType(const EapQtPluginHandle& handle)
       
    74 {
       
    75     mCalledMethods.append("isSupportedOuterType");
       
    76     return mSupportedOuterTypes.contains(handle);
       
    77 }
       
    78 
       
    79 bool EapQtConfigInterface::isSupportedInnerType(
       
    80     const EapQtPluginHandle& outerHandle,
       
    81     const EapQtPluginHandle& innerHandle)
       
    82 {
       
    83     mCalledMethods.append("isSupportedOuterType");
       
    84     QCOMPARE(mSupportedInnerTypesOuterHandle, (int)outerHandle.pluginId());
       
    85     return mSupportedInnerTypes.contains(innerHandle);
       
    86 }
       
    87 
       
    88 bool EapQtConfigInterface::setSelectedOuterTypes(
       
    89     const QList<EapQtPluginHandle>& outerHandles)
       
    90 {
       
    91     mCalledMethods.append("setSelectedOuterTypes");
       
    92     QCOMPARE(mSetSelectectedOuterTypes, outerHandles);
       
    93     return mReturnSetSelectedOuterTypes;
       
    94 }
       
    95 
       
    96 bool EapQtConfigInterface::saveConfiguration(
       
    97     const EapQtPluginHandle& pluginInfo,
       
    98     EapQtConfig &config)
       
    99 {
       
   100     mCalledMethods.append("saveConfiguration");
       
   101     
       
   102     if (pluginInfo == mOuterPlugin) {
       
   103         QCOMPARE(config == mSaveConfigurationsOuter, true);
       
   104         return mReturnSaveConfigurationOuter;
       
   105     } else {
       
   106         QCOMPARE(pluginInfo == mInnerPlugin, true);
       
   107         QCOMPARE(config == mSaveConfigurationsInner, true);
       
   108         return mReturnSaveConfigurationInner;
       
   109     }
       
   110 }
       
   111 
       
   112 bool EapQtConfigInterface::deleteConfiguration()
       
   113 {
       
   114     mCalledMethods.append("deleteConfiguration");
       
   115     return true;
       
   116 }
       
   117 
       
   118 EapQtValidator *EapQtConfigInterface::validatorEap(
       
   119     EapQtExpandedEapType type,
       
   120     EapQtConfig::SettingsId id)
       
   121 {
       
   122     mCalledMethods.append("validatorEap");
       
   123     
       
   124     QCOMPARE(mValidator[type.type()][id] != NULL, true);
       
   125     EapQtValidator *validator = mValidator[type.type()][id];
       
   126     mValidator[type.type()].remove(id);
       
   127     return validator;
       
   128 }
       
   129 
       
   130 
       
   131 bool EapQtConfigInterface::readPacStoreConfiguration(EapQtPacStoreConfig &config)
       
   132 {
       
   133     config = mReadPacStoreConfiguration;
       
   134     return mReadPacStoreConfigurationReturn;
       
   135 }
       
   136 
       
   137 bool EapQtConfigInterface::savePacStoreConfiguration(EapQtPacStoreConfig &config)
       
   138 {
       
   139     QCOMPARE(config == mSavePacStoreConfiguration, true);
       
   140     return mSavePacStoreConfigurationReturn;
       
   141 }
       
   142 
       
   143 EapQtValidator *EapQtConfigInterface::validatorPacStore(
       
   144     EapQtPacStoreConfig::PacStoreSettings id)
       
   145 {
       
   146     mCalledMethods.append("validatorPacStore");
       
   147     
       
   148     QCOMPARE(mValidatorPacStore.contains(id), true);
       
   149     EapQtValidator *validator = mValidatorPacStore[id];
       
   150     mValidatorPacStore.remove(id);
       
   151     return validator;
       
   152 }