You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@avro.apache.org by th...@apache.org on 2017/05/19 17:12:47 UTC
[33/36] avro git commit: Added a unit-test for forward referencing of
named types
Added a unit-test for forward referencing of named types
Project: http://git-wip-us.apache.org/repos/asf/avro/repo
Commit: http://git-wip-us.apache.org/repos/asf/avro/commit/e0a3907a
Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/e0a3907a
Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/e0a3907a
Branch: refs/heads/master
Commit: e0a3907a58956bf35e64193d0e26f644905c7a1a
Parents: 9132015
Author: Thiruvalluvan M. G <th...@apache.org>
Authored: Mon May 1 08:42:21 2017 +0530
Committer: Thiruvalluvan M G <th...@startsmartlabs.com>
Committed: Thu May 18 22:23:47 2017 +0530
----------------------------------------------------------------------
.../compiler/src/test/idl/input/forward_ref.avdl | 13 +++++++++++++
.../compiler/src/test/idl/output/forward_ref.avpr | 16 ++++++++++++++++
2 files changed, 29 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/avro/blob/e0a3907a/lang/java/compiler/src/test/idl/input/forward_ref.avdl
----------------------------------------------------------------------
diff --git a/lang/java/compiler/src/test/idl/input/forward_ref.avdl b/lang/java/compiler/src/test/idl/input/forward_ref.avdl
new file mode 100644
index 0000000..a4f108a
--- /dev/null
+++ b/lang/java/compiler/src/test/idl/input/forward_ref.avdl
@@ -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}
+}
http://git-wip-us.apache.org/repos/asf/avro/blob/e0a3907a/lang/java/compiler/src/test/idl/output/forward_ref.avpr
----------------------------------------------------------------------
diff --git a/lang/java/compiler/src/test/idl/output/forward_ref.avpr b/lang/java/compiler/src/test/idl/output/forward_ref.avpr
new file mode 100644
index 0000000..06531b5
--- /dev/null
+++ b/lang/java/compiler/src/test/idl/output/forward_ref.avpr
@@ -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": { }
+}