You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by ro...@apache.org on 2012/05/11 12:12:41 UTC

svn commit: r1337098 - in /thrift/trunk/lib/cpp: ./ src/thrift/concurrency/test/ src/thrift/processor/test/ test/ test/concurrency/ test/processor/

Author: roger
Date: Fri May 11 10:12:39 2012
New Revision: 1337098

URL: http://svn.apache.org/viewvc?rev=1337098&view=rev
Log:
THRIFT-1336 thrift: added server and processor test code

move the tests from src to test:
lib\cpp\src\thrift\concurrency\test to lib\cpp\test\concurrency
lib\cpp\src\thrift\processor\test to lib\cpp\test\processor

Added:
    thrift/trunk/lib/cpp/test/concurrency/
    thrift/trunk/lib/cpp/test/concurrency/Tests.cpp
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/concurrency/test/Tests.cpp
    thrift/trunk/lib/cpp/test/concurrency/ThreadFactoryTests.h
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h
    thrift/trunk/lib/cpp/test/concurrency/ThreadManagerTests.h
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h
    thrift/trunk/lib/cpp/test/concurrency/TimerManagerTests.h
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h
    thrift/trunk/lib/cpp/test/processor/
    thrift/trunk/lib/cpp/test/processor/EventLog.cpp   (contents, props changed)
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.cpp
    thrift/trunk/lib/cpp/test/processor/EventLog.h   (contents, props changed)
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.h
    thrift/trunk/lib/cpp/test/processor/Handlers.h   (contents, props changed)
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/Handlers.h
    thrift/trunk/lib/cpp/test/processor/ProcessorTest.cpp
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/ProcessorTest.cpp
    thrift/trunk/lib/cpp/test/processor/ServerThread.cpp   (contents, props changed)
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.cpp
    thrift/trunk/lib/cpp/test/processor/ServerThread.h   (contents, props changed)
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.h
    thrift/trunk/lib/cpp/test/processor/proc.thrift
      - copied, changed from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/proc.thrift
Removed:
    thrift/trunk/lib/cpp/src/thrift/concurrency/test/Tests.cpp
    thrift/trunk/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h
    thrift/trunk/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h
    thrift/trunk/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h
    thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.cpp
    thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.h
    thrift/trunk/lib/cpp/src/thrift/processor/test/Handlers.h
    thrift/trunk/lib/cpp/src/thrift/processor/test/ProcessorTest.cpp
    thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.cpp
    thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.h
    thrift/trunk/lib/cpp/src/thrift/processor/test/proc.thrift
Modified:
    thrift/trunk/lib/cpp/Makefile.am
    thrift/trunk/lib/cpp/test/Makefile.am   (contents, props changed)

Modified: thrift/trunk/lib/cpp/Makefile.am
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/Makefile.am?rev=1337098&r1=1337097&r2=1337098&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/Makefile.am (original)
+++ thrift/trunk/lib/cpp/Makefile.am Fri May 11 10:12:39 2012
@@ -207,52 +207,8 @@ include_qt_HEADERS = \
                   src/thrift/qt/TQIODeviceTransport.h \
                   src/thrift/qt/TQTcpServer.h
 
-
-noinst_PROGRAMS = concurrency_test \
-                  processor_test
-
-concurrency_test_SOURCES = \
-                           src/thrift/concurrency/test/Tests.cpp \
-                           src/thrift/concurrency/test/ThreadFactoryTests.h \
-                           src/thrift/concurrency/test/ThreadManagerTests.h \
-                           src/thrift/concurrency/test/TimerManagerTests.h
-
-concurrency_test_LDADD = libthrift.la
-
-processor_test_SOURCES = src/thrift/processor/test/ProcessorTest.cpp \
-                        src/thrift/processor/test/EventLog.cpp \
-                        src/thrift/processor/test/ServerThread.cpp \
-                        src/thrift/processor/test/EventLog.h \
-                        src/thrift/processor/test/Handlers.h \
-                        src/thrift/processor/test/ServerThread.h
-
-processor_test_LDADD = libprocessortest.la \
-                       libthrift.la \
-                       libthriftnb.la \
-                       $(BOOST_LDFLAGS) \
-                       -levent \
-                       $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
-
-check_PROGRAMS = \
-       concurrency_test \
-       processor_test
-
-TESTS = \
-       $(check_PROGRAMS)
-
-noinst_LTLIBRARIES = libprocessortest.la
-
 THRIFT = $(top_builddir)/compiler/cpp/thrift
 
-gen-cpp/ChildService.cpp: $(top_srcdir)/lib/cpp/src/thrift/processor/test/proc.thrift
-	$(THRIFT) --gen cpp:templates,cob_style $<
-
-nodist_libprocessortest_la_SOURCES = \
-       src/thrift/processor/test/gen-cpp/ChildService.h \
-       src/thrift/processor/test/gen-cpp/ChildService.cpp \
-       src/thrift/processor/test/gen-cpp/ParentService.h \
-       src/thrift/processor/test/gen-cpp/ParentService.cpp
-
 WINDOWS_DIST = \
              README_WINDOWS \
              src/thrift/windows \

Modified: thrift/trunk/lib/cpp/test/Makefile.am
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/Makefile.am?rev=1337098&r1=1337097&r2=1337098&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/test/Makefile.am (original)
+++ thrift/trunk/lib/cpp/test/Makefile.am Fri May 11 10:12:39 2012
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-noinst_LTLIBRARIES = libtestgencpp.la
+noinst_LTLIBRARIES = libtestgencpp.la libprocessortest.la
 nodist_libtestgencpp_la_SOURCES = \
 	gen-cpp/DebugProtoTest_types.cpp \
 	gen-cpp/OptionalRequiredTest_types.cpp \
@@ -29,6 +29,14 @@ nodist_libtestgencpp_la_SOURCES = \
 	ThriftTest_extras.cpp \
 	DebugProtoTest_extras.cpp
 
+nodist_libprocessortest_la_SOURCES = \
+	gen-cpp/ChildService.cpp \
+	gen-cpp/ChildService.h \
+	gen-cpp/ParentService.cpp \
+	gen-cpp/ParentService.h \
+	gen-cpp/proc_types.cpp \
+	gen-cpp/proc_types.h
+
 ThriftTest_extras.o: gen-cpp/ThriftTest_types.h
 DebugProtoTest_extras.o: gen-cpp/DebugProtoTest_types.h
 
@@ -52,7 +60,9 @@ check_PROGRAMS = \
 	TransportTest \
 	ZlibTest \
 	TFileTransportTest \
-	UnitTests
+	UnitTests \
+	concurrency_test \
+	processor_test
 
 TESTS_ENVIRONMENT= \
 	BOOST_TEST_LOG_SINK=tests.xml \
@@ -163,7 +173,29 @@ SpecializationTest_SOURCES = \
 
 SpecializationTest_LDADD = libtestgencpp.la
 
-
+concurrency_test_SOURCES = \
+	concurrency/Tests.cpp \
+	concurrency/ThreadFactoryTests.h \
+	concurrency/ThreadManagerTests.h \
+	concurrency/TimerManagerTests.h
+
+concurrency_test_LDADD = \
+  $(top_builddir)/lib/cpp/libthrift.la
+
+processor_test_SOURCES = \
+	processor/ProcessorTest.cpp \
+	processor/EventLog.cpp \
+	processor/ServerThread.cpp \
+	processor/EventLog.h \
+	processor/Handlers.h \
+	processor/ServerThread.h
+
+processor_test_LDADD = libprocessortest.la \
+                       $(top_builddir)/lib/cpp/libthrift.la \
+                       $(top_builddir)/lib/cpp/libthriftnb.la \
+                       $(BOOST_LDFLAGS) \
+                       -levent \
+                       $(BOOST_ROOT_PATH)/lib/libboost_unit_test_framework.a
 #
 # Common thrift code generation rules
 #
@@ -181,6 +213,9 @@ gen-cpp/Service.cpp gen-cpp/StressTest_t
 gen-cpp/SecondService.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_types.cpp gen-cpp/ThriftTest_types.h: $(top_srcdir)/test/ThriftTest.thrift
 	$(THRIFT) --gen cpp:dense $<
 
+gen-cpp/ChildService.cpp: processor/proc.thrift
+	$(THRIFT) --gen cpp:templates,cob_style $<
+
 INCLUDES = \
 	-I$(top_srcdir)/lib/cpp/src
 

Propchange: thrift/trunk/lib/cpp/test/Makefile.am
------------------------------------------------------------------------------
    svn:executable = *

Copied: thrift/trunk/lib/cpp/test/concurrency/Tests.cpp (from r1336895, thrift/trunk/lib/cpp/src/thrift/concurrency/test/Tests.cpp)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/concurrency/Tests.cpp?p2=thrift/trunk/lib/cpp/test/concurrency/Tests.cpp&p1=thrift/trunk/lib/cpp/src/thrift/concurrency/test/Tests.cpp&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
    (empty)

Copied: thrift/trunk/lib/cpp/test/concurrency/ThreadFactoryTests.h (from r1336895, thrift/trunk/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/concurrency/ThreadFactoryTests.h?p2=thrift/trunk/lib/cpp/test/concurrency/ThreadFactoryTests.h&p1=thrift/trunk/lib/cpp/src/thrift/concurrency/test/ThreadFactoryTests.h&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
    (empty)

Copied: thrift/trunk/lib/cpp/test/concurrency/ThreadManagerTests.h (from r1336895, thrift/trunk/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/concurrency/ThreadManagerTests.h?p2=thrift/trunk/lib/cpp/test/concurrency/ThreadManagerTests.h&p1=thrift/trunk/lib/cpp/src/thrift/concurrency/test/ThreadManagerTests.h&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
    (empty)

Copied: thrift/trunk/lib/cpp/test/concurrency/TimerManagerTests.h (from r1336895, thrift/trunk/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/concurrency/TimerManagerTests.h?p2=thrift/trunk/lib/cpp/test/concurrency/TimerManagerTests.h&p1=thrift/trunk/lib/cpp/src/thrift/concurrency/test/TimerManagerTests.h&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
    (empty)

Copied: thrift/trunk/lib/cpp/test/processor/EventLog.cpp (from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.cpp)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/processor/EventLog.cpp?p2=thrift/trunk/lib/cpp/test/processor/EventLog.cpp&p1=thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.cpp&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.cpp (original)
+++ thrift/trunk/lib/cpp/test/processor/EventLog.cpp Fri May 11 10:12:39 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-#include "processor/test/EventLog.h"
+#include "EventLog.h"
 
 #include <stdarg.h>
 

Propchange: thrift/trunk/lib/cpp/test/processor/EventLog.cpp
------------------------------------------------------------------------------
    svn:executable = *

Copied: thrift/trunk/lib/cpp/test/processor/EventLog.h (from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.h)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/processor/EventLog.h?p2=thrift/trunk/lib/cpp/test/processor/EventLog.h&p1=thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.h&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/thrift/processor/test/EventLog.h (original)
+++ thrift/trunk/lib/cpp/test/processor/EventLog.h Fri May 11 10:12:39 2012
@@ -19,7 +19,7 @@
 #ifndef _THRIFT_TEST_EVENTLOG_H_
 #define _THRIFT_TEST_EVENTLOG_H_ 1
 
-#include "concurrency/Monitor.h"
+#include <thrift/concurrency/Monitor.h>
 
 namespace apache { namespace thrift { namespace test {
 

Propchange: thrift/trunk/lib/cpp/test/processor/EventLog.h
------------------------------------------------------------------------------
    svn:executable = *

Copied: thrift/trunk/lib/cpp/test/processor/Handlers.h (from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/Handlers.h)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/processor/Handlers.h?p2=thrift/trunk/lib/cpp/test/processor/Handlers.h&p1=thrift/trunk/lib/cpp/src/thrift/processor/test/Handlers.h&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/thrift/processor/test/Handlers.h (original)
+++ thrift/trunk/lib/cpp/test/processor/Handlers.h Fri May 11 10:12:39 2012
@@ -19,7 +19,7 @@
 #ifndef _THRIFT_PROCESSOR_TEST_HANDLERS_H_
 #define _THRIFT_PROCESSOR_TEST_HANDLERS_H_ 1
 
-#include "processor/test/EventLog.h"
+#include "EventLog.h"
 #include "gen-cpp/ParentService.h"
 #include "gen-cpp/ChildService.h"
 

Propchange: thrift/trunk/lib/cpp/test/processor/Handlers.h
------------------------------------------------------------------------------
    svn:executable = *

Copied: thrift/trunk/lib/cpp/test/processor/ProcessorTest.cpp (from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/ProcessorTest.cpp)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/processor/ProcessorTest.cpp?p2=thrift/trunk/lib/cpp/test/processor/ProcessorTest.cpp&p1=thrift/trunk/lib/cpp/src/thrift/processor/test/ProcessorTest.cpp&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/thrift/processor/test/ProcessorTest.cpp (original)
+++ thrift/trunk/lib/cpp/test/processor/ProcessorTest.cpp Fri May 11 10:12:39 2012
@@ -35,9 +35,9 @@
 #include <thrift/server/TSimpleServer.h>
 #include <thrift/transport/TSocket.h>
 
-#include <thrift/processor/test/EventLog.h>
-#include <thrift/processor/test/ServerThread.h>
-#include <thrift/processor/test/Handlers.h>
+#include "EventLog.h"
+#include "ServerThread.h"
+#include "Handlers.h"
 #include "gen-cpp/ChildService.h"
 
 using namespace std;

Copied: thrift/trunk/lib/cpp/test/processor/ServerThread.cpp (from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.cpp)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/processor/ServerThread.cpp?p2=thrift/trunk/lib/cpp/test/processor/ServerThread.cpp&p1=thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.cpp&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.cpp (original)
+++ thrift/trunk/lib/cpp/test/processor/ServerThread.cpp Fri May 11 10:12:39 2012
@@ -19,13 +19,13 @@
 #ifndef _THRIFT_TEST_SERVERTHREAD_TCC_
 #define _THRIFT_TEST_SERVERTHREAD_TCC_ 1
 
-#include "processor/test/ServerThread.h"
+#include "ServerThread.h"
 
-#include "concurrency/PosixThreadFactory.h"
-#include "concurrency/ThreadManager.h"
-#include "server/TThreadPoolServer.h"
-#include "transport/TBufferTransports.h"
-#include "transport/TServerSocket.h"
+#include <thrift/concurrency/PosixThreadFactory.h>
+#include <thrift/concurrency/ThreadManager.h>
+#include <thrift/server/TThreadPoolServer.h>
+#include <thrift/transport/TBufferTransports.h>
+#include <thrift/transport/TServerSocket.h>
 
 namespace apache { namespace thrift { namespace test {
 

Propchange: thrift/trunk/lib/cpp/test/processor/ServerThread.cpp
------------------------------------------------------------------------------
    svn:executable = *

Copied: thrift/trunk/lib/cpp/test/processor/ServerThread.h (from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.h)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/processor/ServerThread.h?p2=thrift/trunk/lib/cpp/test/processor/ServerThread.h&p1=thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.h&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
--- thrift/trunk/lib/cpp/src/thrift/processor/test/ServerThread.h (original)
+++ thrift/trunk/lib/cpp/test/processor/ServerThread.h Fri May 11 10:12:39 2012
@@ -19,12 +19,12 @@
 #ifndef _THRIFT_TEST_SERVERTHREAD_H_
 #define _THRIFT_TEST_SERVERTHREAD_H_ 1
 
-#include "TProcessor.h"
-#include "protocol/TProtocol.h"
-#include "server/TServer.h"
-#include "transport/TTransport.h"
+#include <thrift/TProcessor.h>
+#include <thrift/protocol/TProtocol.h>
+#include <thrift/server/TServer.h>
+#include <thrift/transport/TTransport.h>
 
-#include "processor/test/EventLog.h"
+#include "EventLog.h"
 
 namespace apache { namespace thrift { namespace test {
 

Propchange: thrift/trunk/lib/cpp/test/processor/ServerThread.h
------------------------------------------------------------------------------
    svn:executable = *

Copied: thrift/trunk/lib/cpp/test/processor/proc.thrift (from r1336895, thrift/trunk/lib/cpp/src/thrift/processor/test/proc.thrift)
URL: http://svn.apache.org/viewvc/thrift/trunk/lib/cpp/test/processor/proc.thrift?p2=thrift/trunk/lib/cpp/test/processor/proc.thrift&p1=thrift/trunk/lib/cpp/src/thrift/processor/test/proc.thrift&r1=1336895&r2=1337098&rev=1337098&view=diff
==============================================================================
    (empty)