javacommons/fileutils/tsrc/driveutilities/src/getdrivestest.cpp
branchRCL_3
changeset 19 04becd199f91
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2008 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:  GetDrivesTest
       
    15 *
       
    16 */
       
    17 
       
    18 #include "TestHarness.h"
       
    19 
       
    20 #include "commsclientendpoint.h"
       
    21 #include "driveutilities.h"
       
    22 #include "driveobservermessages.h"
       
    23 
       
    24 using namespace java::fileutils;
       
    25 using namespace java::comms;
       
    26 
       
    27 TEST_GROUP(GetDrives)
       
    28 {
       
    29     CommsClientEndpoint comms;
       
    30 
       
    31     TEST_SETUP()
       
    32     {
       
    33         comms.connect(IPC_ADDRESS_JAVA_CAPTAIN_C);
       
    34     }
       
    35 
       
    36     TEST_TEARDOWN()
       
    37     {
       
    38         comms.disconnect();
       
    39     }
       
    40 };
       
    41 
       
    42 TEST(GetDrives, 04_GetAccesibleDrives_comms)
       
    43 {
       
    44     CommsMessage msg;
       
    45     setGetDrivesParams(msg, DRIVEOBSERER_GET_DRIVES_ACCESIBLE);
       
    46 
       
    47     CommsMessage reply;
       
    48     CHECK(!comms.sendReceive(msg, reply, 5));
       
    49 
       
    50     driveInfos drives;
       
    51     getGetDrivesResultParams(reply, drives);
       
    52     CHECK(drives.size() > 0);
       
    53 }
       
    54 
       
    55 TEST(GetDrives, 03_GetAccesibleDrives_method)
       
    56 {
       
    57     driveInfos drives;
       
    58     DriveUtilities::getAccesibleDrives(drives);
       
    59     CHECK(drives.size() > 0);
       
    60 }
       
    61 
       
    62 TEST(GetDrives, 02_GetAllDrives_comms)
       
    63 {
       
    64     CommsMessage msg;
       
    65     setGetDrivesParams(msg, DRIVEOBSERER_GET_DRIVES_ALL);
       
    66 
       
    67     CommsMessage reply;
       
    68     CHECK(!comms.sendReceive(msg, reply, 5));
       
    69 
       
    70     driveInfos drives;
       
    71     getGetDrivesResultParams(reply, drives);
       
    72     CHECK(drives.size() > 0);
       
    73 }
       
    74 
       
    75 TEST(GetDrives, 01_GetAllDrives_method)
       
    76 {
       
    77     driveInfos drives;
       
    78     DriveUtilities::getAllDrives(drives);
       
    79     CHECK(drives.size() > 0);
       
    80 }
       
    81