avro-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From th...@apache.org
Subject [28/36] avro git commit: Added a unit-test for forward referencing of named types
Date Fri, 19 May 2017 17:12:42 GMT
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/53156fd1
Tree: http://git-wip-us.apache.org/repos/asf/avro/tree/53156fd1
Diff: http://git-wip-us.apache.org/repos/asf/avro/diff/53156fd1

Branch: refs/heads/master
Commit: 53156fd1e475d976df2d55231cbe40b6e0f5dec8
Parents: 008cd8a
Author: Thiruvalluvan M. G <thiru@apache.org>
Authored: Mon May 1 08:42:21 2017 +0530
Committer: Thiruvalluvan M G <thiru@startsmartlabs.com>
Committed: Mon May 1 08:42:21 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/53156fd1/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/53156fd1/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":  { }
+}


Mime
View raw message