Mark Slee | 6d7d595 | 2007-01-27 01:44:22 +0000 | [diff] [blame^] | 1 | #!/usr/bin/ruby |
| 2 | |
| 3 | $:.push('gen-rb') |
| 4 | $:.push('../../lib/ruby/lib') |
| 5 | |
| 6 | require 'thrift/transport/tsocket' |
| 7 | require 'thrift/protocol/tbinaryprotocol' |
| 8 | require 'ThriftTest' |
| 9 | |
| 10 | s = TSocket.new('localhost', 9090) |
| 11 | p = TBinaryProtocol.new(s) |
| 12 | c = ThriftTest::Client.new(p) |
| 13 | |
| 14 | s.open() |
| 15 | |
| 16 | puts c.testString('string') |
| 17 | puts c.testByte(8) |
| 18 | puts c.testByte(-8) |
| 19 | puts c.testI32(32) |
| 20 | puts c.testI32(-32) |
| 21 | puts c.testI64(64) |
| 22 | puts c.testI64(-64) |
| 23 | puts c.testDouble(3.14) |
| 24 | puts c.testDouble(-3.14) |
| 25 | puts c.testMap({1 => 1, 2 => 2, 3 => 3}) |
| 26 | puts c.testList([1,2,3,4,5]) |
| 27 | puts c.testSet({1 => true, 2 => true, 3 => true}) |
| 28 | |
| 29 | s.close() |
| 30 | |
| 31 | |