Commit Graph

220 Commits

Author SHA1 Message Date
Kevin Clark
586f0a0f01 Remove now defunct tests (they've been moved to specs in lib/rb)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@750188 13f79535-47bb-0310-9956-ffa450edef68
2009-03-04 22:06:59 +00:00
Kevin Clark
af99b5c398 THRIFT-352. rb: Implicit enums should be valid values
Author: Gary Tsang

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@750171 13f79535-47bb-0310-9956-ffa450edef68
2009-03-04 21:42:46 +00:00
David Reiss
b139f64448 THRIFT-325. Remove a bunch of uses of the old command line format
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@745242 13f79535-47bb-0310-9956-ffa450edef68
2009-02-17 20:28:46 +00:00
David Reiss
d831a21773 THRIFT-309. Make Thrift's C# mapping .NET 2.0 (Mono 1.2.4) compatible
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743963 13f79535-47bb-0310-9956-ffa450edef68
2009-02-13 03:09:52 +00:00
David Reiss
7d3df42bb5 cpp: Fix "make check" by defining a comparator for "Empty"
The TCompactProtocol revision added a "set<Empty>" in DebugProtoTest.
C++ needs a comparator in order to link this.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@743111 13f79535-47bb-0310-9956-ffa450edef68
2009-02-10 21:38:44 +00:00
Bryan Duxbury
538e344122 THRIFT-110. java: A more compact format
This patch includes the Java implementation of the new Compact Protocol outlined in the issue and a matching test. It also creates Fixtures.java, a helper class that contains some useful test structure instances. 

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@742847 13f79535-47bb-0310-9956-ffa450edef68
2009-02-10 04:49:39 +00:00
David Reiss
a7fc092ee1 THRIFT-256. python: Fix inheritance of services in the same IDL file
The old version of type_name did not fully qualify parent service names
when they were defined in the same IDL file, but it is necessary because
they end up in different Python files.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741833 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 02:37:09 +00:00
David Reiss
8cee47cf5e THRIFT-310. python: Generate valid code for empty services
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741832 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 02:37:05 +00:00
David Reiss
0b7d6fa5ee THRIFT-314. Purge reflection.limited
This was a feature designed to allow a Thrift server to report
information about its interface.  However, the feature has
significant design problems, and is presence is currently causing
confusion without doing any good.  Therefore, it is being removed.
It will always be in source control if and when we are ready to
come back to it.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@741824 13f79535-47bb-0310-9956-ffa450edef68
2009-02-07 02:36:35 +00:00
T Jake Luciani
b5e6221eb5 THRIFT-270: change cpp namespaces from facebook::thrift to apache::thrift
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739644 13f79535-47bb-0310-9956-ffa450edef68
2009-01-31 22:36:20 +00:00
David Reiss
f78ec2bc66 THRIFT-195. python: Add a simple THttpServer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739638 13f79535-47bb-0310-9956-ffa450edef68
2009-01-31 21:59:32 +00:00
David Reiss
4c591c95a5 THRIFT-212. python: Make TFramedTransport implement CReadableTransport
This involved adding a few methods to provide lower-level access to the
internal read buffer.  This will allow us to use TBinaryProtocolAccelerated
with TFramedTransport.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739632 13f79535-47bb-0310-9956-ffa450edef68
2009-01-31 21:39:25 +00:00
David Reiss
9813cbeda6 cpp: Make the test server compatible with the Python test client
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739629 13f79535-47bb-0310-9956-ffa450edef68
2009-01-31 21:39:11 +00:00
David Reiss
3166141fbd python: Make the unit tests run faster and more reliably
- The async test was making the server sleep for 2 seconds.  Cut it to 0.5.
- The test driver was waiting 5 seconds for shutdown.  Cut it to 1.
- Add a 0.25 second sleep to make sure the server comes up before the client.

This is all a bit hacky, but it is better than the status quo.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739628 13f79535-47bb-0310-9956-ffa450edef68
2009-01-31 21:39:08 +00:00
David Reiss
c04452eff2 THRIFT-289. cpp: Fix "make check" by defining a comparator for "Instanity"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739083 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 23:46:46 +00:00
Bryan Duxbury
50119f15aa THRIFT-289. test: "make check" no longer runs the Java tests
Thanks to David for the changes that straighten the makefiles out.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739024 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 21:31:25 +00:00
Bryan Duxbury
986d705578 THRIFT-253. java: Enhance FieldMetaData
The code generator new creates a static map of field id to metadata for each field, including information like the field TType, class of embedded structs, required/optional/default, etc. Additionally, on loading, generated classes statically register their class and metadata map with the global FieldMetaData map, so you can get the metadata for any TBase-implementing class easily.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738708 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 01:51:08 +00:00
Bryan Duxbury
249d7cb199 THRIFT-166. java: Java tests should be in lib/java/test/
THRIFT-221. java: Make java build classpath more dynamic and configurable

This issue moves all the tests from test/java to lib/java/test/src and combines the build files. In addition, rather than continue on with the same busted approach to finding dependent jars for the tests, THRIFT-221 has been implemented, allowing the user to specify a .thrift-build.properties file in their home directory that contains additional classpath entries. 

As a result of this patch, "make check" does not currently work as it is expected to. This will be resolved in a follow-up commit.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@738695 13f79535-47bb-0310-9956-ffa450edef68
2009-01-29 01:21:20 +00:00
Bryan Duxbury
afa80ea73d THRIFT-34 Java libraries should be namespaced under org.apache.thrift, not com.facebook.thrift
Library classes and tests have been moved to the proper package and directory structure, and references to com.facebook.thrift where replaced with org.apache.thrift throughout the code. The fb303 contrib project still contains com.facebook packages.



git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734855 13f79535-47bb-0310-9956-ffa450edef68
2009-01-15 23:47:51 +00:00
Kevin Clark
c85fd50e2b THRIFT-216. Add validate method to fixtures so tests pass
Author: Esteve Fernandez


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734565 13f79535-47bb-0310-9956-ffa450edef68
2009-01-14 23:55:10 +00:00
David Reiss
46bb4aeb5e THRIFT-242. python: Used named arguments in __init__ instead of a dict
This is a wire-compatible but non-source-compatible change.
When initializing structures, you must use

Foo(bar=1, baz="qux")
Foo(**{"bar": 1, "baz": "qux"})

instead of

Foo({"bar": 1, "baz": "qux"})


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@734536 13f79535-47bb-0310-9956-ffa450edef68
2009-01-14 22:34:15 +00:00
David Reiss
6319133cac THRIFT-25. csharp: Various compiler and library improvements
Compiler:
- Thrift structures are serializable.
- The member fields of thrift structures are now private and only accessible
  through Properties, which keep the appropriate __isset up to date.

Library
- Addition of TBufferedTransport, which can be used to wrap other Transports.
- Addition of TThreadedServer, which manually manages threads instead of
  relying on .NET ThreadPool.
- Servers use a log delegate that defaults to System.Console but allows
  servers to use log4net without introducing the dependency.

ThriftTest Visual Studio Project
- Test client and server that use ThriftTest.thrift. The project references
  thrift.exe and Thrift.dll from the subversion tree and automatically builds
  generated code. This makes it very easy to test changes in both the compiler
  and library.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@732079 13f79535-47bb-0310-9956-ffa450edef68
2009-01-06 19:49:22 +00:00
David Reiss
25be92bf0d THRIFT-222. java: Better exposure if __isset in beans style
- Generate an isSet method for each field to test its set-ness.
- Generate a generic isSet method that checks by field id.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731722 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:58 +00:00
David Reiss
5455f00348 THRIFT-138. java: Fix copy constructor for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@731719 13f79535-47bb-0310-9956-ffa450edef68
2009-01-05 21:02:48 +00:00
T Jake Luciani
41687fc6cf THRIFT-193: Patch for proper namespace support in perl compiler
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@728863 13f79535-47bb-0310-9956-ffa450edef68
2008-12-23 03:45:43 +00:00
David Reiss
a8efac862a THRIFT-225. java/cpp: Handle non-i32 integer constants properly
Java generates a warning when converting from an integer constant
to a byte or short without an explicit cast.  This change adds a
cast to byte and short literals in Java.

Both Java and C++ fail to compile integer literals larger than 2^31
unless they are decorated with "L" (for Java) or "LL" (for g++).
This change adds the appropriate decorations.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@727130 13f79535-47bb-0310-9956-ffa450edef68
2008-12-16 20:28:13 +00:00
David Reiss
a230999667 THRIFT-121. Support arbitrary type annotations
Adds syntax for attaching arbitrary key/value pairs to types.
These annotations can be accessed by individual generators to alter
the code they produce.

This version supports annotations on container types and structures.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@724954 13f79535-47bb-0310-9956-ffa450edef68
2008-12-10 01:52:48 +00:00
David Reiss
0c87ad41ee THRIFT-217. Use "--gen py" instead of "-py" in build scripts
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722333 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:11:13 +00:00
David Reiss
603d50437c THRIFT-138. java: Create deep-copy constructors for Thrift structs
- Create a copy constructor for every Thrift struct.  The constructor
  performs a deep copy on the argument, resulting in no shared state.
- Make thrift structions implement Cloneable and implement .clone()
  using the copy constructor.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@722332 13f79535-47bb-0310-9956-ffa450edef68
2008-12-02 02:06:31 +00:00
David Reiss
04c315946c THRIFT-81. java: TNonblockingServer: Support a limit on read buffer size
This change makes it possible to set a maximum amount of memory that
TNonblockingServer will use for all read buffers (combined).
If it is exceeded, no new data will be read from clients until
memory is freed.  The current implementation does a busy wait in
the main thread when this happens.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719741 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 23:07:05 +00:00
David Reiss
30a9360e3f THRIFT-172. java: Improve toString output for binary fields
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719720 13f79535-47bb-0310-9956-ffa450edef68
2008-11-21 21:31:36 +00:00
David Reiss
c26da0a391 THRIFT-202: java: Fix "make check"
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@719407 13f79535-47bb-0310-9956-ffa450edef68
2008-11-20 22:22:23 +00:00
David Reiss
74421273ad THRIFT-67. python: Add TNonblockingServer
This TNonblockingServer is very similar to the C++ implementation.
It assumes the framed transport, but it uses select instead of libevent.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@712306 13f79535-47bb-0310-9956-ffa450edef68
2008-11-07 23:09:31 +00:00
David Reiss
1cc0c5e6d6 THRIFT-109. python: Use self.assert* instead of assert in tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@705734 13f79535-47bb-0310-9956-ffa450edef68
2008-10-17 19:30:35 +00:00
David Reiss
8d07e1d152 s/ENABLE_RUBY/WITH_RUBY/ for consistency.
This didn't happen in r666490 because the Ruby stuff was developed
in a separate branch.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@675857 13f79535-47bb-0310-9956-ffa450edef68
2008-07-11 08:04:12 +00:00
Kevin Clark
4bd8916b12 Merge branch 'fastbinary'
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@674688 13f79535-47bb-0310-9956-ffa450edef68
2008-07-08 00:47:49 +00:00
David Reiss
af78778acd (THRIFT-54) Remove "frameResponses" from TNonblockingServer
TNonblockingServer and TFramedTransport used to have the option to only
frame messages on one side of the communication.  This capability was
removed from TFramedTransport because it was poorly implemented and not
useful.  This change removes it from TNonblockingServer as well, and
removes references to it in some of the C++ test code.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@673791 13f79535-47bb-0310-9956-ffa450edef68
2008-07-03 20:29:34 +00:00
David Reiss
03b574fead (THRIFT-5) A TNonblockingServers (single-threaded and thread-pool) for Java
This patch adds two Thrift servers for Java that both use non-blocking I/O
to avoid locking up worker threads for idle connections.  The two classes are
- TNonblockingServer, which supports single-threaded serving
- THsHaServer, which performs I/O in one thread and method invocations in
  a configurable thread pool.
To support these servers, TNonblockingServerSocket and TNonblockingSocket
have been added.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@673550 13f79535-47bb-0310-9956-ffa450edef68
2008-07-02 23:55:04 +00:00
David Reiss
f14541626d Partial handlling of 64-bit integer constants.
- Parse integer constants in Thrift files as 64-bit ints.
- Die if an overflow occurs.
- Warn if an enum value cannot fit in 32 bits.
- Add a simple test for the above.

I ran all of the generators over BrokenConstants.thrift before adding the
overflow, and they appeared to work.  However, the code generated was not
always valid (for example, the 64-bit constant must have an LL suffix in C++).


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672907 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 20:45:47 +00:00
David Reiss
6b082755f0 (THRIFT-61) Fix "make check" for the C++ library by not doing empty flushes.
I changed the behavior of TFramedTransport when flush is called without
writing any data to the transport.  This broke the unit test, which was
relying on a weird corner of TFramedTransport's behavior in order to do
some stricter checking.  I altered the unit test to never flush without
writing and added a new test to verfy the "empty flush" behavior.


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@672881 13f79535-47bb-0310-9956-ffa450edef68
2008-06-30 19:48:04 +00:00
Kevin Clark
45671689ea Fix odd bug in integration tests where it passed the wrong args to an Exception struct initializer
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668987 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:14:17 +00:00
Kevin Clark
41c0a0266b Improve compatibility with the old Hash-style set.
Fix the integration test for the Set change


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668960 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:09:28 +00:00
Kevin Clark
d639ac13b5 Fix the last of the deprecated names in tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668938 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:04:18 +00:00
Kevin Clark
9d33041a1b Fix name usage in tests. Remove test for TTransport as it really wasn't testing anything useful.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668937 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:04:03 +00:00
Kevin Clark
dd8ef9ef53 Remove test_remappings because it isn't comprehensive and it's triggering undesired warnings. This should be re-created as a spec.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668936 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 01:03:48 +00:00
Kevin Clark
adfdf39dd3 Clean up the last few deprecation warnings in the tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668922 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:59:56 +00:00
Kevin Clark
f85e793494 Fix up thrift/thrift to only require the the files that define the classes it used to hold. This fixes the existing tests
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668912 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:56:48 +00:00
Kevin Clark
2960044415 rb: Add more classes/modules to the Thrift namespace. Provide backwards compatable mappings.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668904 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:54:13 +00:00
Kevin Clark
c669efa48b rb: Add deprecate! method Rename TTransport#readAll/isOpen, and deprecate
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668899 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:52:26 +00:00
Kevin Clark
a7e7c04e9d rb: Switch to dyn generator syntax for testing namespaces
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668898 13f79535-47bb-0310-9956-ffa450edef68
2008-06-18 00:52:05 +00:00