summaryrefslogtreecommitdiff
path: root/test/AnnotationTest.thrift
diff options
context:
space:
mode:
authorRoger Meier <roger@apache.org>2012-09-17 21:18:05 +0000
committerRoger Meier <roger@apache.org>2012-09-17 21:18:05 +0000
commit3087738f284efdc49aac28d68b50b26f0842b714 (patch)
tree0947d66188e4e2cf23907e817a8937e1bc742649 /test/AnnotationTest.thrift
parente2ef3179b6fd55b4ab3a68a985eb8cdc0ffa1432 (diff)
downloadthrift-3087738f284efdc49aac28d68b50b26f0842b714.tar.gz
THRIFT-1651 Support annotations on all elements
Patch: Benjy Weinberger git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1386848 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/AnnotationTest.thrift')
-rw-r--r--test/AnnotationTest.thrift30
1 files changed, 29 insertions, 1 deletions
diff --git a/test/AnnotationTest.thrift b/test/AnnotationTest.thrift
index 1a34320cd..dac476f5f 100644
--- a/test/AnnotationTest.thrift
+++ b/test/AnnotationTest.thrift
@@ -30,5 +30,33 @@ struct foo {
java.final = "",
)
-typedef string ( unicode.encoding = "UTF-16" ) non_latin_string
+exception foo_error {
+ 1: i32 error_code ( foo="bar" )
+ 2: string error_msg
+} (foo = "bar")
+
+typedef string ( unicode.encoding = "UTF-16" ) non_latin_string (foo="bar")
typedef list< double ( cpp.fixed_point = "16" ) > tiny_float_list
+
+enum weekdays {
+ SUNDAY ( weekend = "yes" ),
+ MONDAY,
+ TUESDAY,
+ WEDNESDAY,
+ THURSDAY,
+ FRIDAY,
+ SATURDAY ( weekend = "yes" )
+} (foo.bar="baz")
+
+/* Note that annotations on senum values are not supported. */
+senum seasons {
+ "Spring",
+ "Summer",
+ "Fall",
+ "Winter"
+} ( foo = "bar" )
+
+service foo_service {
+ void foo() ( foo = "bar" )
+} (a.b="c")
+