Kevin Clark
f8ecb02ef4
rb: NonblockingServer: Use a select() loop in the acceptor thread
...
Using a select() loop with a timeout allows the acceptor thread to be shut down
cleanly under JRuby.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669042 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:20:22 +00:00
Kevin Clark
980e445347
rb: Make a few of the NonblockingServer specs pass under jruby
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669036 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:59 +00:00
Kevin Clark
8c3e0932f2
rb: Fix up the deprecation spec for JRuby
...
JRuby has different behavior regarding #method_added and #included, so the deprecation spec has to handle this
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669035 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:54 +00:00
Kevin Clark
830f46a382
rb: Fix the binaryprotocol spec to run under jruby
...
Stop testing for RangeErrors with bignums in i64, that was just an artifact of the MRI interpreter that has different behavior under jruby.
JRuby uses a different Float::MIN/MAX so stop hard-coding the binary representation
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669034 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:19:51 +00:00
Kevin Clark
1aca9c4097
rb: Add spec to ensure UNIXServerSocket deletes the socket when closing
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669023 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:57 +00:00
Kevin Clark
2ddd8ed40f
rb: Implement Thrift::UNIXSocket and Thrift::UNIXServerSocket
...
In benchmarking it turns out these don't give any noticeable performance boost,
but as I've already written them, somebody may want them for something.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669019 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:35 +00:00
Kevin Clark
138c0e126f
rb: Implement Thrift::Serializer and Thrift::Deserializer
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669018 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:28 +00:00
Kevin Clark
c83d4451b7
rb: Add the path to gen-rb to $: in spec_helper instead of in multiple different specs
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669017 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:21 +00:00
Kevin Clark
c3783f4cdb
rb: Don't type-check when given a nil value.
...
Turn on type-checking for all specs
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669016 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:14 +00:00
Kevin Clark
23193757bc
rb: Implement type-checking in Thrift::Struct.new and field accessors
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669015 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:18:07 +00:00
Kevin Clark
140b555bf4
rb: Fix struct_spec to use a proper description
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669014 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:57 +00:00
Kevin Clark
2818b09c87
rb: Add helpers for optional type-checking
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669013 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:51 +00:00
Kevin Clark
e45bf59417
rb: Completely rewrite Thrift::NonblockingServer
...
It now has a much better and cleaner architecture, a proper persistent thread pool,
a dedicated acceptor thread, and no concurrency issues
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669012 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:44 +00:00
Kevin Clark
3c59aff0b9
rb: Add a hack to prevent fastthread from being loaded when executing specs
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669011 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:37 +00:00
Kevin Clark
1067425ef7
rb: Enhance non-blocking read in Socket
...
Also prevent errors when trying to close a @handle twice
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669010 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:17:30 +00:00
Kevin Clark
2e4f9d61dc
rb: Enhance the backwards compatibility spec to ensure that the deprecated method names really do correspond to the new method names
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669005 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:50 +00:00
Kevin Clark
4eea89737a
rb: Stop calling rspec_clear in specs (which really should have been rspec_reset), as rspec_verify already resets
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669004 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:42 +00:00
Kevin Clark
1535078231
rb: Add spec for shutting down NonblockingServer in response to a client message
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669002 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:27 +00:00
Kevin Clark
6c4598bbc0
rb: Struct#new should properly initialize boolean values
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669001 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:20 +00:00
Kevin Clark
1d4b2d87f7
rb: Thrift::Socket should return false from #open? if an error occurred during a read/write (THRIFT-7)
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@669000 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:11 +00:00
Kevin Clark
e0fdddea44
Implement NonblockingServer and add specs
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668999 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:16:02 +00:00
Kevin Clark
90a2cbe0a4
Squelch warning about parens and standardize require for generated code
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668998 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:53 +00:00
Kevin Clark
c67587006f
Add optional host argument to ServerSocket
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668997 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:45 +00:00
Kevin Clark
c78eeef184
Teach Socket how to read_nonblock
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668996 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:36 +00:00
Kevin Clark
6c30dbbb92
Add a few accessors and specs to prepare for the upcoming NonblockingServer
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668995 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:15:25 +00:00
Kevin Clark
01a514494d
Fix default values of non-primitive types being shared between struct instances (THRIFT-4)
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668989 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:36 +00:00
Kevin Clark
ec9106f854
Mark failing tests as pending
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668988 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:26 +00:00
Kevin Clark
f98286a8e4
Add failing spec for Socket closing when it has an error (THRIFT-7)
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668986 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:08 +00:00
Kevin Clark
1cfd693f3e
Add new spec for properly initializing boolean values
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668985 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:58 +00:00
Kevin Clark
9479b1a593
Add failing spec for sharing of default values between struct instances (THRIFT-4)
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668983 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:37 +00:00
Kevin Clark
0d6007c717
Add missing test for ServerSocket
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668982 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:27 +00:00
Kevin Clark
fa4a958589
Add two missing tests for FramedTransport
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668981 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:18 +00:00
Kevin Clark
dfe22b3e2a
Stop using Array#pack and test using the raw bytes instead
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668980 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:13:09 +00:00
Kevin Clark
090b69ee63
Add useless struct test for code coverage
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668979 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:58 +00:00
Kevin Clark
c13c33bfad
Test BinaryProtocol#read_message_header with bad data
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668978 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:48 +00:00
Kevin Clark
3f48333ad8
Oops, call #skip instead of #read_type when testing skip
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668976 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:26 +00:00
Kevin Clark
3c87129dc0
Spec out Socket and ServerSocket
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668974 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:12:05 +00:00
Kevin Clark
dd330253ae
Spec out HTTPClient
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668970 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:11:18 +00:00
Kevin Clark
f6aa86a506
Spec out MemoryBuffer and IOStreamTransport
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668969 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:11:07 +00:00
Kevin Clark
531e020503
Spec out TransportException, Transport, ServerTransport, BufferedTransport, and FramedTransport
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668964 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:10:17 +00:00
Kevin Clark
080dd878be
Spec out SimpleMongrelHTTPServer
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668963 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:10:05 +00:00
Kevin Clark
03d7a47946
Add specs for Struct.
...
Include the generated code so the thrift compiler is not required to run the specs.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668961 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:41 +00:00
Kevin Clark
ccc86583a3
Spec out Server
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668958 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:00 +00:00
Kevin Clark
378191a645
Stop range-checking in BinaryProtocol#write_iNN, it turns out to break some code
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668955 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:08:19 +00:00
Kevin Clark
356f861420
Rename spec wrapper classes to prevent cross-pollination of specs. Require rspec 1.1.4 or later to fix the "describe Module do" bug
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668954 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:08:05 +00:00
Kevin Clark
e977a63293
Add spec for BinaryProtocolFactory
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668953 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:07:50 +00:00
Kevin Clark
5ae0384d8f
Spec out the BinaryProtocol read methods
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668952 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:07:37 +00:00
Kevin Clark
f18b643e5e
Spec out the BinaryProtocol write methods.
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668950 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:07:10 +00:00
Kevin Clark
9db1c2e5b5
Finish speccing out Protocol and ProtocolFactory
...
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668948 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:06:42 +00:00
Kevin Clark
dc39973565
Start speccing Protocol.
...
The Protocol specs exposed a bug in the implementation of skip(Types::STRUCT).
Previously it would call read_struct_end once per field instead of per struct.
This only worked because read_struct_end is a noop.
Also remove all empty parens () from method calls.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668946 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:06:15 +00:00