javatools/tckrunner/tsrc/src/utils/testserver.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2007-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:
       
    15  *
       
    16 */
       
    17 
       
    18 #ifndef TESTSERVER_H
       
    19 #define TESTSERVER_H
       
    20 #include <queue>
       
    21 
       
    22 #include "commslistener.h"
       
    23 #include "commsserverendpoint.h"
       
    24 #include "commsclientendpoint.h"
       
    25 #include "commsmessage.h"
       
    26 
       
    27 using namespace java::comms;
       
    28 using namespace std;
       
    29 
       
    30 const int MSG_ID_GET_NEXT_OPERATION = 500;
       
    31 const int MSG_ID_OPERATION          = 501;
       
    32 const int MSG_ID_OPERATION_RESULT   = 502;
       
    33 
       
    34 const int OPERATION_INSTALL   = 0;
       
    35 const int OPERATION_UNINSTALL = 1;
       
    36 const int OPERATION_EXIT      = 2;
       
    37 
       
    38 class TestServer : public CommsListener
       
    39 {
       
    40 public:
       
    41     TestServer();
       
    42     virtual ~TestServer();
       
    43 
       
    44     // CommsListener methods
       
    45     virtual void processMessage(CommsMessage& aMessage);
       
    46 
       
    47     int start();
       
    48     int stop();
       
    49 
       
    50     CommsEndpoint& getJavaCaptain()
       
    51     {
       
    52         return mJavaCaptain;
       
    53     }
       
    54     CommsEndpoint& getJavaInstaller()
       
    55     {
       
    56         return mJavaInstaller;
       
    57     }
       
    58 
       
    59     queue<string> mLaunchReqs;
       
    60 
       
    61 private:
       
    62     int startTckRunner();
       
    63     int stopTckRunner();
       
    64     void stopJavaCaptain();
       
    65 
       
    66     CommsServerEndpoint mJavaCaptain;
       
    67     CommsClientEndpoint mJavaInstaller;
       
    68 };
       
    69 
       
    70 #endif // TESTSERVER_H