mmshplugins/mmshaoplugin/tsrc/ut_aoplugin/src/ut_musaopluginmain.cpp
changeset 22 496ad160a278
parent 0 f0cf47e981f9
equal deleted inserted replaced
15:ccd8e69b5392 22:496ad160a278
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  Main plugin class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #include <alwaysonlinemanagercommon.h>
       
    22 #include <alwaysonlinemanagerclient.h>
       
    23 #include <digia/eunit/eunitmacros.h>
       
    24     
       
    25 #include "musaocallmonitor.h"
       
    26 #include "musaoplugin.h"
       
    27 #include "musaoplugintest.h"
       
    28 #include "muslogger.h" 
       
    29 #include "musmanager.h"
       
    30 
       
    31 // --------------------------------------------------------------------------
       
    32 // C++ constructor.
       
    33 // --------------------------------------------------------------------------
       
    34 // 
       
    35 CMusAoPluginTest::CMusAoPluginTest()
       
    36     {
       
    37     }
       
    38 
       
    39 
       
    40 // --------------------------------------------------------------------------
       
    41 // Symbian two-phase constructor.
       
    42 // --------------------------------------------------------------------------
       
    43 // 
       
    44 CMusAoPluginTest* CMusAoPluginTest::NewL()
       
    45     {
       
    46     CMusAoPluginTest* self = new (ELeave) CMusAoPluginTest();
       
    47     CleanupStack::PushL( self );
       
    48     self->ConstructL();
       
    49     CleanupStack::Pop( self );
       
    50     return self;
       
    51     }
       
    52 
       
    53 
       
    54 // --------------------------------------------------------------------------
       
    55 // Symbian second-phase constructor.
       
    56 // --------------------------------------------------------------------------
       
    57 // 
       
    58 void CMusAoPluginTest::ConstructL()
       
    59     {
       
    60     }
       
    61 
       
    62 
       
    63 // --------------------------------------------------------------------------
       
    64 // C++ destructor.
       
    65 // --------------------------------------------------------------------------
       
    66 // 
       
    67 CMusAoPluginTest::~CMusAoPluginTest()
       
    68     {
       
    69     }
       
    70 
       
    71 // --------------------------------------------------------------------------
       
    72 // --------------------------------------------------------------------------
       
    73 // 
       
    74 void CMusAoPluginTest::HandleServerCommandL()
       
    75     {
       
    76     iPlugin->HandleServerCommandL( EAOManagerPluginStart, NULL );
       
    77     iPlugin->HandleServerCommandL( EAOManagerPluginStop, NULL );
       
    78     iPlugin->HandleServerCommandL( EAOManagerNWOpsNotAllowed, NULL );
       
    79     iPlugin->HandleServerCommandL( EAOManagerNWOpsAllowed, NULL );
       
    80     iPlugin->HandleServerCommandL( EAOManagerStartedRoaming, NULL );
       
    81     iPlugin->HandleServerCommandL( EAOManagerStoppedRoaming, NULL );
       
    82     iPlugin->HandleServerCommandL( EAOManagerDiskSpaceAboveCritical, NULL );
       
    83     iPlugin->HandleServerCommandL( EAOManagerDiskSpaceBelowCritical, NULL );
       
    84     }
       
    85 
       
    86 
       
    87 // --------------------------------------------------------------------------
       
    88 // From base class MMusAoCallMonitorObserver.
       
    89 // --------------------------------------------------------------------------
       
    90 // 
       
    91 void CMusAoPluginTest::LineStatusChange()
       
    92     {
       
    93     iPlugin->LineStatusChange( MMusAoCallMonitorObserver::ELineConnected );
       
    94     iPlugin->LineStatusChange( MMusAoCallMonitorObserver::ELineDisconnected );
       
    95     iPlugin->LineStatusChange( MMusAoCallMonitorObserver::EUnknown ); 
       
    96     }
       
    97     
       
    98 void CMusAoPluginTest::SetupL(  )
       
    99     {
       
   100     iPlugin = CMusAoPlugin::NewL();
       
   101     }
       
   102 
       
   103 void CMusAoPluginTest::Teardown(  )
       
   104     {
       
   105     delete iPlugin;
       
   106     }
       
   107 
       
   108 //  TEST TABLE
       
   109 
       
   110 EUNIT_BEGIN_TEST_TABLE(
       
   111     CMusAoPluginTest,
       
   112     "CMusAoPluginTest",
       
   113     "CMusAoPluginTest" )
       
   114 
       
   115 EUNIT_TEST(
       
   116     "CMusAoPluginTest",
       
   117     "CMusAoPluginTest",
       
   118     "HandleServerCommandL",
       
   119     "FUNCTIONALITY",
       
   120     SetupL, HandleServerCommandL, Teardown)
       
   121 
       
   122 EUNIT_TEST(
       
   123     "CMusAoPluginTest",
       
   124     "CMusAoPluginTest",
       
   125     "LineStatusChange",
       
   126     "FUNCTIONALITY",
       
   127     SetupL, LineStatusChange, Teardown)
       
   128 
       
   129 
       
   130 EUNIT_END_TEST_TABLE
       
   131