thrift: added server and processor test code
----------------------------------------------
Key: THRIFT-1336
URL: https://issues.apache.org/jira/browse/THRIFT-1336
Project: Thrift
Issue Type: Improvement
Components: C++ - Library
Reporter: Dave Watson
Priority: Minor
Attachments: 0032-thrift-added-server-and-processor-test-code.patch
davejwatson:
Internally FB uses a different build system. I added stuff to the Makefile.am
for these tests, but I'm not a makefile master, it would be nice to have
a second set of eyes here
>From 2f30313189df5d5886298c96fcd6dfdf0e126d77 Mon Sep 17 00:00:00 2001
From: Adam Simpkins <[email protected]>
Date: Fri, 23 Apr 2010 04:19:18 +0000
Subject: [PATCH 32/33] thrift: added server and processor test code
Summary:
This code tests that the TServerEventHandler and TProcessorEventHandler
hooks are invoked correctly by the server and event code. The test
cases all start a server in a separate thread, then make some calls
against it. The TServerEventHandler and TProcessorEventHandler record
each time they are called, and the test code checks to make sure that
the recorded calls match what is expected.
Test Plan:
Ran it.
Currently it fails for several reasons. Several of the servers don't
implement stop() properly, causing tests to hang trying to shutdown
their server. TNonblockingServer also doesn't invoke the
TProcessorEventHandler correctly when not using a ThreadManager.
I have fixes for all of these, which I'll submit as separate diffs.
Revert Plan:
OK
---
lib/cpp/Makefile.am | 47 ++-
lib/cpp/src/processor/test/EventLog.cpp | 129 ++++
lib/cpp/src/processor/test/EventLog.h | 94 +++
lib/cpp/src/processor/test/Handlers.h | 341 ++++++++++
lib/cpp/src/processor/test/ProcessorTest.cpp | 941 ++++++++++++++++++++++++++
lib/cpp/src/processor/test/ServerThread.cpp | 148 ++++
lib/cpp/src/processor/test/ServerThread.h | 143 ++++
lib/cpp/src/processor/test/proc.thrift | 22 +
8 files changed, 1863 insertions(+), 2 deletions(-)
create mode 100644 lib/cpp/src/processor/test/EventLog.cpp
create mode 100644 lib/cpp/src/processor/test/EventLog.h
create mode 100644 lib/cpp/src/processor/test/Handlers.h
create mode 100644 lib/cpp/src/processor/test/ProcessorTest.cpp
create mode 100644 lib/cpp/src/processor/test/ServerThread.cpp
create mode 100644 lib/cpp/src/processor/test/ServerThread.h
create mode 100644 lib/cpp/src/processor/test/proc.thrift
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira