wlanutilities/wlanwizard/tsrc/stubs/eapqtconfiginterface_stub.cpp
branchRCL_3
changeset 24 63be7eb3fc78
equal deleted inserted replaced
23:b852595f5cbe 24:63be7eb3fc78
       
     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: 6 %
       
    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 
       
    47 EapQtValidator *EapQtConfigInterface::validatorEap(
       
    48     const EapQtExpandedEapType &type,
       
    49     const EapQtConfig::SettingsId id)
       
    50 {
       
    51     mCalledMethods.append("validatorEap");
       
    52     
       
    53     QCOMPARE(mValidator[type.type()][id] != NULL, true);
       
    54     EapQtValidator *validator = mValidator[type.type()][id];
       
    55     mValidator[type.type()].remove(id);
       
    56     return validator;
       
    57 }
       
    58 
       
    59 EapQtValidator *EapQtConfigInterface::validatorPacStore(
       
    60     const EapQtPacStoreConfig::PacStoreSettings id)
       
    61 {
       
    62     mCalledMethods.append("validatorPacStore");
       
    63     
       
    64     QCOMPARE(mValidatorPacStore.contains(id), true);
       
    65     EapQtValidator *validator = mValidatorPacStore[id];
       
    66     mValidatorPacStore.remove(id);
       
    67     return validator;
       
    68 }
       
    69 
       
    70 bool EapQtConfigInterface::setConfigurationReference(const int iapId)
       
    71 {
       
    72     mCalledMethods.append("setConfigurationReference");
       
    73     QCOMPARE(iapId, mIapId);
       
    74     
       
    75     return mReturnSetConfigurationReference;
       
    76 }
       
    77 
       
    78 QList<EapQtCertificateInfo> EapQtConfigInterface::certificateAuthorityCertificates()
       
    79 {
       
    80     mCalledMethods.append("certificateAuthorityCertificates");
       
    81     return mCertsCa;
       
    82 }
       
    83 
       
    84 QList<EapQtCertificateInfo> EapQtConfigInterface::userCertificates()
       
    85 {
       
    86     mCalledMethods.append("userCertificates");
       
    87     return mCertsUser;
       
    88 }
       
    89 
       
    90 
       
    91 bool EapQtConfigInterface::updateCertificates()
       
    92 {
       
    93     mCalledMethods.append("updateCertificates");
       
    94     return true;
       
    95 }
       
    96 
       
    97 bool EapQtConfigInterface::isSupportedOuterType(const EapQtPluginHandle& handle)
       
    98 {
       
    99     mCalledMethods.append("isSupportedOuterType");
       
   100     return mSupportedOuterTypes.contains(handle);
       
   101 }
       
   102 
       
   103 bool EapQtConfigInterface::isSupportedInnerType(
       
   104     const EapQtPluginHandle& outerHandle,
       
   105     const EapQtPluginHandle& innerHandle)
       
   106 {
       
   107     mCalledMethods.append("isSupportedOuterType");
       
   108     QCOMPARE(mSupportedInnerTypesOuterHandle, (int)outerHandle.pluginId());
       
   109     return mSupportedInnerTypes.contains(innerHandle);
       
   110 }
       
   111 
       
   112 bool EapQtConfigInterface::setSelectedOuterTypes(
       
   113     const QList<EapQtPluginHandle>& outerHandles)
       
   114 {
       
   115     mCalledMethods.append("setSelectedOuterTypes");
       
   116     QCOMPARE(mSetSelectectedOuterTypes, outerHandles);
       
   117     return mReturnSetSelectedOuterTypes;
       
   118 }
       
   119 
       
   120 bool EapQtConfigInterface::saveConfiguration(
       
   121     const EapQtPluginHandle& pluginInfo,
       
   122     const EapQtConfig &config)
       
   123 {
       
   124     mCalledMethods.append("saveConfiguration");
       
   125     
       
   126     if (pluginInfo == mOuterPlugin) {
       
   127         QCOMPARE(config == mSaveConfigurationsOuter, true);
       
   128         return mReturnSaveConfigurationOuter;
       
   129     } else {
       
   130         QCOMPARE(pluginInfo == mInnerPlugin, true);
       
   131         QCOMPARE(config == mSaveConfigurationsInner, true);
       
   132         return mReturnSaveConfigurationInner;
       
   133     }
       
   134 }
       
   135 
       
   136 bool EapQtConfigInterface::deleteConfiguration()
       
   137 {
       
   138     mCalledMethods.append("deleteConfiguration");
       
   139     return true;
       
   140 }
       
   141 
       
   142 
       
   143 bool EapQtConfigInterface::readPacStoreConfiguration(EapQtPacStoreConfig &config)
       
   144 {
       
   145     config = mReadPacStoreConfiguration;
       
   146     return mReadPacStoreConfigurationReturn;
       
   147 }
       
   148 
       
   149 bool EapQtConfigInterface::savePacStoreConfiguration(EapQtPacStoreConfig &config)
       
   150 {
       
   151     QCOMPARE(config == mSavePacStoreConfiguration, true);
       
   152     return mSavePacStoreConfigurationReturn;
       
   153 }
       
   154 
       
   155