RpcSessionTest.cc 750 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #include <boost/bind.hpp>
  2. #include <boost/asio.hpp>
  3. #include <gtest/gtest.h>
  4. #include <gflags/gflags.h>
  5. #include <glog/logging.h>
  6. #include "Rpc/RpcSession.h"
  7. #include "Rpc/RpcServerMock.h"
  8. namespace Egametang {
  9. class RpcSessionTest: public testing::Test
  10. {
  11. protected:
  12. boost::asio::io_service io_service;
  13. int port;
  14. RpcServerMock mock_server;
  15. RpcSession session;
  16. public:
  17. RpcSessionTest():
  18. io_service(), port(10000),
  19. mock_server(io_service, port), session(io_service, mock_server)
  20. {
  21. }
  22. virtual ~RpcSessionTest()
  23. {
  24. }
  25. };
  26. } // namespace Egametang
  27. int main(int argc, char* argv[])
  28. {
  29. testing::InitGoogleTest(&argc, argv);
  30. google::ParseCommandLineFlags(&argc, &argv, true);
  31. google::InitGoogleLogging(argv[0]);
  32. return RUN_ALL_TESTS();
  33. }