javacommons/utils/tsrc/src/testoslayer.cpp
branchRCL_3
changeset 19 04becd199f91
child 67 63b81d807542
equal deleted inserted replaced
16:f5050f1da672 19:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2009 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 *
       
    16 */
       
    17 
       
    18 #include <stdio.h>
       
    19 #include <string>
       
    20 
       
    21 #include "TestHarness.h"
       
    22 
       
    23 #include "javacommonutils.h"
       
    24 #include "javaoslayer.h"
       
    25 
       
    26 using namespace std;
       
    27 using namespace java::util;
       
    28 
       
    29 TEST_GROUP(TestOsLayer)
       
    30 {
       
    31     TEST_SETUP()
       
    32     {
       
    33     }
       
    34 
       
    35     TEST_TEARDOWN()
       
    36     {
       
    37     }
       
    38 };
       
    39 
       
    40 /**
       
    41  * Test JavaOsLayer::bootClassPath().
       
    42  *
       
    43  * 1. Test midp cp.
       
    44  * 2. Test installer cp.
       
    45  * 3. Test tckrunner cp.
       
    46  * 4. Test negative type.
       
    47  * 5. Test positive greater boyndary.
       
    48  */
       
    49 TEST(TestOsLayer, bootClassPath)
       
    50 {
       
    51     // 1. Test midp cp.
       
    52     list <wstring> odcs;
       
    53     list <wstring> bc;
       
    54     const wstring delim = L";";
       
    55     JavaOsLayer::bootClassPath(odcs, bc, BOOT_CLASSPATH_MIDP);
       
    56     CHECK(odcs.size() > 35);
       
    57     CHECK(bc.size() == 1);
       
    58     odcs.clear();
       
    59     bc.clear();
       
    60 
       
    61     // 2. Test installer cp.
       
    62     JavaOsLayer::bootClassPath(odcs, bc, BOOT_CLASSPATH_INSTALLER);
       
    63     CHECK(odcs.size() > 24);
       
    64     CHECK(bc.size() == 1);
       
    65     odcs.clear();
       
    66     bc.clear();
       
    67 
       
    68     // 3. Test tckrunner cp.
       
    69     JavaOsLayer::bootClassPath(odcs, bc, BOOT_CLASSPATH_TCKRUNNER);
       
    70     CHECK(bc.size() > 10);
       
    71     CHECK(bc.size() == 1);
       
    72     odcs.clear();
       
    73     bc.clear();
       
    74 
       
    75     // 4. Test negative type.
       
    76     JavaOsLayer::bootClassPath(odcs, bc, -1);
       
    77     CHECK(odcs.size() > 35);
       
    78     CHECK(bc.size() == 1);
       
    79     odcs.clear();
       
    80     bc.clear();
       
    81 
       
    82     // 5. Test positive greater boyndary.
       
    83     JavaOsLayer::bootClassPath(odcs, bc, 50);
       
    84     CHECK(odcs.size() > 4);
       
    85     CHECK(bc.size() == 1);
       
    86     odcs.clear();
       
    87     bc.clear();
       
    88 }