use ServerBootstrap
[folly.git] / folly / wangle / bootstrap / BootstrapTest.cpp
index 9f2f664e771c761890a72fd0087d60b874e1d3d4..4bbd80c22f22a5442be0e84377e1ebe1f76598b8 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <glog/logging.h>
 #include <gtest/gtest.h>
+#include <boost/thread.hpp>
 
 using namespace folly::wangle;
 using namespace folly;
@@ -227,3 +228,11 @@ TEST(Bootstrap, SharedThreadPool) {
   server.stop();
   CHECK(factory->pipelines == 5);
 }
+
+TEST(Bootstrap, ExistingSocket) {
+  TestServer server;
+  auto factory = std::make_shared<TestPipelineFactory>();
+  server.childPipeline(factory);
+  folly::AsyncServerSocket::UniquePtr socket(new AsyncServerSocket);
+  server.bind(std::move(socket));
+}