THRIFT-3628 Fix lib/cpp/test/TServerIntegrationTest.cpp to use ephemeral ports.
Client: Test (C++)
Patch: John Sirois

This was already the case for most of the suite, which, besides the one
fixed constructor, retrieved the port to dynamically already.

This closes #859


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/919752ca
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/919752ca
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/919752ca

Branch: refs/heads/master
Commit: 919752ca2fa7e64f8854729aebbd91d4cbd50a57
Parents: 9bd3530
Author: John Sirois <jsir...@apache.org>
Authored: Sat Feb 13 12:35:58 2016 -0700
Committer: Nobuaki Sukegawa <ns...@apache.org>
Committed: Sun Feb 14 22:47:19 2016 +0900

----------------------------------------------------------------------
 lib/cpp/test/TServerIntegrationTest.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/919752ca/lib/cpp/test/TServerIntegrationTest.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/test/TServerIntegrationTest.cpp 
b/lib/cpp/test/TServerIntegrationTest.cpp
index f530771..ce1cbd3 100644
--- a/lib/cpp/test/TServerIntegrationTest.cpp
+++ b/lib/cpp/test/TServerIntegrationTest.cpp
@@ -33,7 +33,6 @@
 #include <thrift/transport/TSocket.h>
 #include <thrift/transport/TTransport.h>
 #include "gen-cpp/ParentService.h"
-#include "TestPortFixture.h"
 #include <vector>
 
 using apache::thrift::concurrency::Guard;
@@ -145,12 +144,12 @@ void autoSocketCloser(TSocket* pSock) {
 }
 
 template <class TServerType>
-class TServerIntegrationTestFixture : public TestPortFixture {
+class TServerIntegrationTestFixture {
 public:
   TServerIntegrationTestFixture(const boost::shared_ptr<TProcessorFactory>& 
_processorFactory)
     : pServer(new TServerType(_processorFactory,
                               boost::shared_ptr<TServerTransport>(
-                                  new TServerSocket("localhost", 
m_serverPort)),
+                                  new TServerSocket("localhost", 0)),
                               boost::shared_ptr<TTransportFactory>(new 
TTransportFactory),
                               boost::shared_ptr<TProtocolFactory>(new 
TBinaryProtocolFactory))),
       pEventHandler(boost::shared_ptr<TServerReadyEventHandler>(new 
TServerReadyEventHandler)) {

Reply via email to