fix Makefile.am
authorJames Sedgwick <jsedgwick@fb.com>
Fri, 21 Nov 2014 23:23:56 +0000 (15:23 -0800)
committerDave Watson <davejwatson@fb.com>
Thu, 11 Dec 2014 15:58:46 +0000 (07:58 -0800)
Summary: also kill duplicated test file

Test Plan: run all exp/wangle tests

Reviewed By: davejwatson@fb.com

Subscribers: fugalh, njormrod, folly-diffs@

FB internal diff: D1698503

Signature: t1:1698503:1416612139:7139c6aa2ca79eabdaec6c33192194df984af348

folly/Makefile.am
folly/experimental/wangle/channel/ChannelPipelineTest.cpp [deleted file]

index 4aca70683da89c6426d7d39493155f6aaad96ec3..59e450238c9bd963ae0c9959e798110d302b2528 100644 (file)
@@ -72,6 +72,11 @@ nobase_follyinclude_HEADERS = \
        experimental/io/FsUtil.h \
        experimental/Singleton.h \
        experimental/TestUtil.h \
+       experimental/wangle/channel/AsyncSocketHandler.h \
+       experimental/wangle/channel/ChannelHandler.h \
+       experimental/wangle/channel/ChannelHandlerContext.h \
+       experimental/wangle/channel/ChannelPipeline.h \
+       experimental/wangle/channel/OutputBufferingHandler.h \
        experimental/wangle/concurrent/BlockingQueue.h \
        experimental/wangle/concurrent/Codel.h \
        experimental/wangle/concurrent/CPUThreadPoolExecutor.h \
diff --git a/folly/experimental/wangle/channel/ChannelPipelineTest.cpp b/folly/experimental/wangle/channel/ChannelPipelineTest.cpp
deleted file mode 100644 (file)
index bab898d..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright 2014 Facebook, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <folly/experimental/wangle/channel/ChannelHandler.h>
-#include <folly/experimental/wangle/channel/ChannelPipeline.h>
-#include <folly/experimental/wangle/channel/AsyncSocketHandler.h>
-#include <folly/experimental/wangle/channel/OutputBufferingHandler.h>
-#include <folly/experimental/wangle/channel/test/MockChannelHandler.h>
-#include <folly/io/IOBufQueue.h>
-#include <folly/Memory.h>
-#include <folly/Conv.h>
-#include <gtest/gtest.h>
-
-using namespace folly;
-using namespace folly::wangle;
-
-class ToString : public ChannelHandler<int, std::string> {
- public:
-  virtual ~ToString() {}
-  void read(Context* ctx, int msg) override {
-    LOG(INFO) << "ToString read";
-    ctx->fireRead(folly::to<std::string>(msg));
-  }
-  Future<void> write(Context* ctx, std::string msg) override {
-    LOG(INFO) << "ToString write";
-    return ctx->fireWrite(folly::to<int>(msg));
-  }
-};
-
-class KittyPrepender : public ChannelHandlerAdapter<std::string> {
- public:
-  virtual ~KittyPrepender() {}
-  void read(Context* ctx, std::string msg) override {
-    LOG(INFO) << "KittyAppender read";
-    ctx->fireRead(folly::to<std::string>("kitty", msg));
-  }
-  Future<void> write(Context* ctx, std::string msg) override {
-    LOG(INFO) << "KittyAppender write";
-    return ctx->fireWrite(msg.substr(5));
-  }
-};
-
-typedef ChannelHandlerAdapter<IOBuf> BytesPassthrough;
-
-class EchoService : public ChannelHandlerAdapter<std::string> {
- public:
-  virtual ~EchoService() {}
-  void read(Context* ctx, std::string str) override {
-    LOG(INFO) << "ECHO: " << str;
-    ctx->fireWrite(str).then([](Try<void>&& t) {
-      LOG(INFO) << "done writing";
-    });
-  }
-};
-
-TEST(ChannelTest, PlzCompile) {
-  ChannelPipeline<IOBuf, IOBuf,
-    BytesPassthrough,
-    BytesPassthrough,
-    // If this were useful it wouldn't be that hard
-    // ChannelPipeline<BytesPassthrough>,
-    BytesPassthrough>
-  pipeline(BytesPassthrough(), BytesPassthrough(), BytesPassthrough);
-
-  ChannelPipeline<int, std::string,
-    ChannelHandlerPtr<ToString>,
-    KittyPrepender,
-    KittyPrepender>
-  kittyPipeline(
-      std::make_shared<ToString>(),
-      KittyPrepender{},
-      KittyPrepender{});
-  kittyPipeline.addBack(KittyPrepender{});
-  kittyPipeline.addBack(EchoService{});
-  kittyPipeline.finalize();
-  kittyPipeline.read(5);
-
-  auto handler = kittyPipeline.getHandler<KittyPrepender>(2);
-  CHECK(handler);
-
-  auto p = folly::make_unique<int>(42);
-  folly::Optional<std::unique_ptr<int>> foo{std::move(p)};
-}
-
-TEST(ChannelTest, PlzCompile2) {
-  EchoService echoService;
-  ChannelPipeline<int, std::string> pipeline;
-  pipeline
-    .addBack(ToString())
-    .addBack(KittyPrepender())
-    .addBack(KittyPrepender())
-    .addBack(ChannelHandlerPtr<EchoService, false>(&echoService))
-    .finalize();
-  pipeline.read(42);
-}
-
-TEST(ChannelTest, RealHandlersCompile) {
-  EventBase eb;
-  auto socket = AsyncSocket::newSocket(&eb);
-  ChannelPipeline<IOBufQueue&, std::unique_ptr<IOBuf>> pipeline;
-  pipeline
-    .addBack(AsyncSocketHandler(socket))
-    .addBack(OutputBufferingHandler())
-    .finalize();
-}
-
-TEST(ChannelTest, MoveOnlyTypesCompile) {
-  ChannelPipeline<IOBufQueue&, std::unique_ptr<IOBuf>,
-    BytesToBytesHandler,
-    BytesToBytesHandler>
-  pipeline(BytesToBytesHandler{}, BytesToBytesHandler{});
-  pipeline
-    .addFront(BytesToBytesHandler{})
-    .addBack(BytesToBytesHandler{})
-    .finalize();
-}
-
-typedef StrictMock<MockChannelHandlerAdapter<int, int>> IntHandler;
-
-ACTION(FireRead) {
-  arg0->fireRead(arg1);
-}
-
-TEST(ChannelTest, Handoffs) {
-  IntHandler handler1;
-  IntHandler handler2;
-  MockChannelHandlerAdapter<int, int> handler2;
-  ChannelPipeline<IOBufQueue&, std::unique_ptr<IOBuf>,
-    ChannelHandlerPtr<IntHandler, false>,
-    ChannelHandlerPtr<IntHandler, false>>
-  pipeline(IntHandler{}, IntHandler{});
-  pipeline.read(1);
-}