summaryrefslogtreecommitdiff
path: root/cppe/test/include/TestApplication.h
blob: 755ddd299bffe771d713c1bea40836076a10fcc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// **********************************************************************
//
// Copyright (c) 2003-2007 ZeroC, Inc. All rights reserved.
//
// This copy of Ice-E is licensed to you under the terms described in the
// ICEE_LICENSE file included in this distribution.
//
// **********************************************************************

#ifndef TEST_APPLICATION_H
#define TEST_APPLICATION_H

#include <IceE/Config.h>
#include <IceE/IceE.h>
#include <IceE/Mutex.h>

//
// XXX: For ICE_TEST_COMMON_API. We could create a TestConfig.h later, or
// perhaps make Test/... subdirectory.
//
#include <TestCommon.h>

class ICE_TEST_COMMON_API TestApplication
{
public:

    TestApplication(const std::string& = "");
    virtual ~TestApplication()
    {
    }

#ifdef _WIN32_WCE
    int main(HINSTANCE);
#else
    int main(int, char*[]);
#endif

    virtual int run(int, char*[]) = 0;

    Ice::LoggerPtr getLogger();

    void setCommunicator(const Ice::CommunicatorPtr&);
    Ice::CommunicatorPtr communicator();

    bool terminated() const;

    void loadConfig(const Ice::PropertiesPtr&);

private:

    const std::string _name;
    Ice::CommunicatorPtr _communicator;
};

#endif