Skip to content

Commit

Permalink
Merge pull request apache#2 from thiru-apache/thiru-AVRO-1723-A
Browse files Browse the repository at this point in the history
Added a unit-test for forward referencing of named types
  • Loading branch information
zolyfarkas authored May 1, 2017
2 parents 008cd8a + 53156fd commit 1f4ec52
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lang/java/compiler/src/test/idl/input/forward_ref.avdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@namespace("org.foo")
protocol Import {
/* Name Value record */
record ANameValue {
/** the name */
string name;
/** the value */
string value;
/* is the value a json object */
ValueType type = "PLAIN";
}
enum ValueType {JSON, BASE64BIN, PLAIN}
}
16 changes: 16 additions & 0 deletions lang/java/compiler/src/test/idl/output/forward_ref.avpr
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"protocol": "Import",
"namespace": "org.foo",
"types": [
{
"type": "record",
"name": "ANameValue",
"fields": [
{ "name":"name", "type": "string", "doc":"the name" },
{ "name": "value", "type": "string", "doc": "the value" },
{ "name": "type", "type": { "type": "enum", "name":"ValueType", "symbols": ["JSON","BASE64BIN","PLAIN"] } }
]
}
],
"messages": { }
}

0 comments on commit 1f4ec52

Please sign in to comment.