thrift/test
Jens Geyer 426ab86801 THRIFT-3022 Compact protocol for Haxe
Client: Haxe
Patch: Jens Geyer

This closes #388
2015-03-05 23:43:23 +01:00
..
c_glib THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
cpp cpp: remove unused variable g_socket_syscalls 2015-03-04 14:32:59 +01:00
erl THRIFT-2951 Fix Erlang name conflict test 2015-02-05 12:39:34 +11:00
go THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
haxe THRIFT-3022 Compact protocol for Haxe 2015-03-05 23:43:23 +01:00
hs THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
keys THRIFT-2325: SSL test certificates 2014-04-07 23:45:19 +02:00
lua THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
ocaml THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
perl THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
php THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
py THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
py.tornado THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
py.twisted THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
rb THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:54 +01:00
threads Thrift-2029:Port C++ tests to Windows 2014-01-07 21:42:01 -05:00
AnnotationTest.thrift THRIFT-2768: Whitespace Fixup 2014-10-03 20:30:38 +02:00
BrokenConstants.thrift THRIFT-387. Add license headers to a bunch of files 2009-03-30 21:35:00 +00:00
ConstantsDemo.thrift THRIFT-918 : better haskell tests 2010-09-27 19:27:40 +00:00
DebugProtoTest.thrift THRIFT-2768: Whitespace Fixup 2014-10-03 20:30:38 +02:00
DenseLinkingTest.thrift THRIFT-2637 "java:fullcamel_service_methods" option to automatically camel-case Java service methods 2014-07-25 23:26:11 +02:00
DocTest.thrift THRIFT-2849: spelling errors fixed using codespell tool 2014-11-24 10:55:31 +01:00
EnumTest.thrift THRIFT-2784 Eliminate compiler warnings in generated C++ code 2014-10-21 21:28:04 +02:00
FastbinaryTest.py THRIFT-420. Remove all negative structure field ids from the code 2009-04-02 19:24:02 +00:00
Include.thrift THRIFT-1995: IDL can generate uncompilable ocde 2013-06-09 05:28:47 -07:00
JavaBeansTest.thrift THRIFT-734. java: Can't use primitive types in service definitions for bean generated code 2010-03-16 03:13:26 +00:00
Makefile.am THRIFT-2644 Haxe support 2014-11-09 01:58:25 +01:00
ManyOptionals.thrift THRIFT-1469. java: Java isset space optimization 2011-12-21 18:13:29 +00:00
ManyTypedefs.thrift THRIFT-387. Add license headers to a bunch of files 2009-03-30 21:35:00 +00:00
NameConflictTest.thrift THRIFT-2951 Fix Erlang name conflict test 2015-02-05 12:39:34 +11:00
OptionalRequiredTest.thrift THRIFT-1394:Treatment of optional fields is not consistent between C++ and Java 2012-01-27 04:48:26 +00:00
README.md Fixed a typo in test/README.md 2014-12-18 22:15:49 +01:00
Recursive.thrift THRIFT-2768: Whitespace Fixup 2014-10-03 20:30:38 +02:00
result.html THRIFT-2578 Moving 'make cross' from test.sh to test.py 2014-08-01 23:39:32 +02:00
ReuseObjects.thrift THRIFT-2368 New option: reuse-objects for Java generator 2014-03-31 16:21:37 +02:00
SmallTest.thrift THRIFT-387. Add license headers to a bunch of files 2009-03-30 21:35:00 +00:00
StressTest.thrift THRIFT-2497 server and client for test/go, also several fixes and improvements 2014-05-08 23:18:44 +02:00
test.py THRIFT-2849: spelling errors fixed using codespell tool 2014-11-24 10:55:31 +01:00
test.sh THRIFT-2969 2015-02-16 00:51:24 -08:00
tests.json THRIFT-847 Test Framework harmonization across all languages 2014-08-15 23:01:09 +02:00
ThriftTest.thrift THRIFT-2886 Integrate binary type in standard Thrift cross test 2015-01-03 17:37:10 +01:00
TypedefTest.thrift THRIFT-1040 Can't end typedef lines with a semicolon 2014-09-11 22:36:41 +02:00

Apache Thrift - integration test suite

This is the cross everything integration test suite for Apache Thrift. executed by

make cross

at the moment, this starts the test.sh script which does the real cross test with different transports, protocols and languages.

Unit tests for languages are usually located under lib//test/ cross language tests according to ThriftTest.thrift shall be provided for every language including executables with the following command line interface for servers:

$ ./cpp/TestServer -h
Allowed options:
  -h [ --help ]               produce help message
  --port arg (=9090)          Port number to listen
  --domain-socket arg         Unix Domain Socket (e.g. /tmp/ThriftTest.thrift)
  --named-pipe arg            Windows Named Pipe (e.g. MyThriftPipe)
  --server-type arg (=simple) type of server, "simple", "thread-pool", 
                              "threaded", or "nonblocking"
  --transport arg (=buffered) transport: buffered, framed, http, anonpipe
  --protocol arg (=binary)    protocol: binary, compact, json
  --ssl                       Encrypted Transport using SSL
  --processor-events          processor-events
  -n [ --workers ] arg (=4)   Number of thread pools workers. Only valid for 
                          thread-pool server type

and this for clients:

$ ./cpp/TestClient -h
Allowed options:
  -h [ --help ]               produce help message
  --host arg (=localhost)     Host to connect
  --port arg (=9090)          Port number to connect
  --domain-socket arg         Domain Socket (e.g. /tmp/ThriftTest.thrift), 
                              instead of host and port
  --named-pipe arg            Windows Named Pipe (e.g. MyThriftPipe)
  --anon-pipes hRead hWrite   Windows Anonymous Pipes pair (handles)
  --transport arg (=buffered) Transport: buffered, framed, http, evhttp
  --protocol arg (=binary)    Protocol: binary, compact, json
  --ssl                       Encrypted Transport using SSL
  -n [ --testloops ] arg (=1) Number of Tests
  -t [ --threads ] arg (=1)   Number of Test threads 

If you have executed the make check or make cross then you will be able to browse gen-html/ThriftTest.html with the test documentation.

The return code (exit code) shall be 0 on success, or an integer in the range 1 - 255 on errors. In order to signal failed tests, the return code shall be composed from these bits to indicate failing tests:

  #define TEST_BASETYPES     1  // 0000 0001
  #define TEST_STRUCTS       2  // 0000 0010
  #define TEST_CONTAINERS    4  // 0000 0100
  #define TEST_EXCEPTIONS    8  // 0000 1000
  #define TEST_NOTUSED     240  // 1111 0000 (reserved bits)

Tests that have not been executed at all count as errors.

Example:

During tests, the test client notices that some of the Struct tests fail. Furthermore, due to some other problem none of the Exception tests is executed. Therefore, the test client returns the code 10 = 2 | 8, indicating the failure of both test 2 (TEST_STRUCTS) and test 8 (TEST_EXCEPTIONS).

SSL

Test Keys and Certificates are provided in multiple formats under the following directory test/keys