summaryrefslogtreecommitdiff
path: root/test/DebugProtoTest.thrift
diff options
context:
space:
mode:
authorBryan Duxbury <bryanduxbury@apache.org>2009-12-18 19:41:11 +0000
committerBryan Duxbury <bryanduxbury@apache.org>2009-12-18 19:41:11 +0000
commit2d80470bcb1a7e41ef0668194ab97bb65342baac (patch)
tree00cacf2bfbe22d4336e2c74fd0e45b37dd08d71e /test/DebugProtoTest.thrift
parente533bace3d462ebad7c65d7de4fd167a0ffbe740 (diff)
downloadthrift-2d80470bcb1a7e41ef0668194ab97bb65342baac.tar.gz
THRIFT-632. java: Constants of enum types don't behave well
This patch causes constants of all types to be resolved differently by the compiler, and makes it so that constants of enum types contain a reference to the enum type so that code generators can produce the correct names. git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@892358 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/DebugProtoTest.thrift')
-rw-r--r--test/DebugProtoTest.thrift24
1 files changed, 22 insertions, 2 deletions
diff --git a/test/DebugProtoTest.thrift b/test/DebugProtoTest.thrift
index 549462eb7..6a9c7855d 100644
--- a/test/DebugProtoTest.thrift
+++ b/test/DebugProtoTest.thrift
@@ -214,6 +214,7 @@ const CompactProtoTestStruct COMPACT_TEST = {
}
+const i32 MYCONST = 2
service Srv {
i32 Janky(1: i32 arg);
@@ -223,6 +224,8 @@ service Srv {
void voidMethod();
i32 primitiveMethod();
CompactProtoTestStruct structMethod();
+
+ void methodWithDefaultArgs(1: i32 something = MYCONST);
}
service Inherited extends Srv {
@@ -253,8 +256,25 @@ service ReverseOrderService {
}
enum SomeEnum {
- ONE
- TWO
+ ONE = 1
+ TWO = 2
+}
+
+const SomeEnum MY_SOME_ENUM = ONE
+
+const SomeEnum MY_SOME_ENUM_1 = 1
+/*const SomeEnum MY_SOME_ENUM_2 = 7*/
+
+const map<SomeEnum,SomeEnum> MY_ENUM_MAP = {
+ ONE : TWO
+}
+
+struct StructWithSomeEnum {
+ 1: SomeEnum blah;
+}
+
+const map<SomeEnum,StructWithSomeEnum> EXTRA_CRAZY_MAP = {
+ ONE : {"blah" : TWO}
}
union TestUnion {