test_fixtures.h
Go to the documentation of this file.
1 /*
2  * Unit tests for XmlRpc++
3  *
4  * Copyright (C) 2017, Zoox Inc
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Author: Austin Hendrix <austin@zoox.com>
21  *
22  */
23 
24 #include "xmlrpcpp/XmlRpc.h"
25 
26 #include <boost/thread/mutex.hpp>
27 #include <boost/thread/thread.hpp>
28 #include <gtest/gtest.h>
29 
30 // No arguments, result is "Hello".
31 class Hello : public XmlRpc::XmlRpcServerMethod
32 {
33 public:
35 
36  virtual ~Hello() {}
37 
38  void execute(XmlRpc::XmlRpcValue& params, XmlRpc::XmlRpcValue& result);
39 
40  boost::mutex hello_mutex;
41 };
42 
43 class XmlRpcTest : public ::testing::Test
44 {
45 protected:
46  XmlRpcTest();
47 
48  void work();
49 
50  virtual void SetUp();
51 
52  virtual void TearDown();
53 
54  // The server and its methods
56  Hello hello;
57 
58  // Server port number (for clients)
59  int port;
60 
61  // Server thread
63  boost::thread server_thread;
64 };
Hello(XmlRpc::XmlRpcServer *s)
Definition: test_fixtures.h:34
bool server_done
Definition: test_fixtures.h:62
RPC method arguments and results are represented by Values.
Definition: XmlRpcValue.h:24
boost::mutex hello_mutex
Definition: test_fixtures.h:40
XmlRpcServer s
Definition: HelloServer.cpp:11
Abstract class representing a single RPC method.
virtual ~Hello()
Definition: test_fixtures.h:36
void execute(XmlRpcValue &params, XmlRpcValue &result)
Execute the method. Subclasses must provide a definition for this method.
Definition: HelloServer.cpp:19
A class to handle XML RPC requests.
Definition: XmlRpcServer.h:41
XmlRpc::XmlRpcServer s
Definition: test_fixtures.h:55
XmlRpcServerMethod(std::string const &name, XmlRpcServer *server=0)
Constructor.


xmlrpcpp
Author(s): Chris Morley, Konstantin Pilipchuk, Morgan Quigley, Austin Hendrix, Dirk Thomas
autogenerated on Mon Feb 28 2022 23:33:22