Added open-closed type tests
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_opentype@356 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list02.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list02.aql
new file mode 100644
index 0000000..47dd921
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list02.aql
@@ -0,0 +1,35 @@
+/*
+ * Test case Name : heterog-list02.aql
+ * Description : To test insertion of an array of arrays into internal dataset.
+ * : Heterogenous list construction.
+ * Success : Yes
+ * Date : 28th May 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type BatterType as {
+id:int32,
+descrpt:string
+}
+
+create type TestType as {
+id:int32,
+description:string,
+name:string,
+batters:[[BatterType]]
+}
+
+create dataset T1(TestType) partitioned by key id;
+
+insert into dataset T1({
+"id":1234,
+"description":"donut",
+"name":"Cake",
+"batters":[[{"id":345,"descrpt":"Regular"},{"id":445,"descrpt":"Chocolate"}],[{"id":349,"descrpt":"Soft"},{"id":449,"descrpt":"Vanilla"}]] }
+);
+
+for $l in dataset('T1')
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list03.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list03.aql
new file mode 100644
index 0000000..94a87c0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/heterog-list03.aql
@@ -0,0 +1,36 @@
+/*
+ * Test case Name : heterog-list03.aql
+ * Description : To test insertion of an array of arrays into internal dataset.
+ * : batters field is optional in this scenario.
+ * : Heterogenous list construction.
+ * Success : Yes
+ * Date : 28th May 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type BatterType as {
+id:int32,
+descrpt:string
+}
+
+create type TestType as {
+id:int32,
+description:string,
+name:string,
+batters:[[BatterType]]?
+}
+
+create dataset T1(TestType) partitioned by key id;
+
+insert into dataset T1({
+"id":1234,
+"description":"donut",
+"name":"Cake",
+"batters":[[{"id":345,"descrpt":"Regular"},{"id":445,"descrpt":"Chocolate"}],[{"id":349,"descrpt":"Soft"},{"id":449,"descrpt":"Vanilla"}]] }
+);
+
+for $l in dataset('T1')
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-24.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-24.aql
new file mode 100644
index 0000000..e985ab4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-24.aql
@@ -0,0 +1,25 @@
+/*
+ * Testcase Name : open-closed-24.aql
+ * Description : Test use of additional data(open) field in create type statement
+ * Success : Yes
+ * Date : 29th May 2012
+ */
+
+drop dataverse test if exists;
+
+create dataverse test;
+
+use dataverse test;
+
+create type testType as open {
+id : int32,
+name : string,
+opt_tag : {{ string }}
+}
+
+create dataset testds(testType) partitioned by key id;
+
+insert into dataset testds({"id": 32,"name": "UCI","opt_tag":{{"optional text","put any text here","and more"}}});
+
+for $l in dataset('testds')
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-25.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-25.aql
new file mode 100644
index 0000000..55651be
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-25.aql
@@ -0,0 +1,25 @@
+/*
+ * Testcase Name : open-closed-25.aql
+ * Description : Test use of additional data(open) optional field in create type statement
+ * Success : Yes
+ * Date : 29th May 2012
+ */
+
+drop dataverse test if exists;
+
+create dataverse test;
+
+use dataverse test;
+
+create type testType as open {
+id : int32,
+name : string,
+opt_tag : {{ string }}?
+}
+
+create dataset testds(testType) partitioned by key id;
+
+insert into dataset testds({"id": 32,"name": "UCI","opt_tag":{{"optional text","put any text here","and more"}}});
+
+for $l in dataset('testds')
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-26.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-26.aql
new file mode 100644
index 0000000..b5cca5f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-26.aql
@@ -0,0 +1,26 @@
+/*
+ * Testcase Name : open-closed-26.aql
+ * Description : Test use of additional data(open) optional field in create type statement
+ * : No additional data is inserted (as it is declared as optional) from the insert statement.
+ * Success : Yes
+ * Date : 29th May 2012
+ */
+
+drop dataverse test if exists;
+
+create dataverse test;
+
+use dataverse test;
+
+create type testType as open {
+id : int32,
+name : string,
+opt_tag : {{ string }}?
+}
+
+create dataset testds(testType) partitioned by key id;
+
+insert into dataset testds({"id": 32,"name": "UCI"});
+
+for $l in dataset('testds')
+return $l