added & updated open-closed type tests

git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization@177 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-20.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-20.aql
index cc2513f..d7ad173 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-20.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-20.aql
@@ -1,9 +1,10 @@
 /*
  * Test case name :  open-closed-20.aql
- * Description    :  Insert into open type internal dataset by querying another internal dataset
+ * Description    :  Insert into open type internal dataset by querying another internal dataset which is of open type with nullable fields
  *                :  In this case source dataset has (n+n) fields and the target dataset has only n fields, but has no intial records in it.
+ *                :  In this scenario, the source dataset (open) has some optional fields
  * Success        :  Yes
- * Date           :  29 April 2012
+ * Date           :  May 01 2012
  */
 
 
@@ -21,26 +22,24 @@
 id:int32,
 name:string,
 age:int8,
-sex:string,
-dob:date
+sex:string?,
+dob:date?
 }
 
 create dataset employee(Emp) partitioned by key id;
 
-insert into dataset employee({"id":201,"name":"John Doe","age":32,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":202,"name":"John Smith","age":30,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":201,"name":"John Wayne","age":62,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":203,"name":"Roger Sanders","age":48,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":204,"name":"Raj Singh","age":37,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":205,"name":"Mike Tyson","age":44,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":206,"name":"Brett Lee","age":35,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":207,"name":"Chen Li","age":39,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":208,"name":"Mike Carey","age":42,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":209,"name":"Abdullah","age":29,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":221,"name":"Mariam","age":25,"sex":"F","dob":"1-1-82"});
-insert into dataset employee({"id":221,"name":"Mariam","age":25,"sex":"F","dob":"1-1-82","desgination":{{"dsg":"Department Manager"}}});
+insert into dataset employee({"id":201,"name":"John Doe","age":32,"sex":"M","dob":date("1975-01-11")});
+insert into dataset employee({"id":202,"name":"John Smith","age":30,date("1982-05-23")});
+insert into dataset employee({"id":201,"name":"John Wayne","age":62,"sex":"M"});
+insert into dataset employee({"id":203,"name":"Roger Sanders","age":48,"sex":"M","dob":date("1960-01-08")});
+insert into dataset employee({"id":204,"name":"Raj Singh","age":37,"sex":"M","dob":date("1975-01-08")});
+insert into dataset employee({"id":205,"name":"Mike Tyson","age":44,"dob":date("1969-11-02")});
+insert into dataset employee({"id":206,"name":"Brett Lee","age":35,"sex":"M","dob":date("1976-06-09")});
+insert into dataset employee({"id":207,"name":"Chen Li","age":39,"sex":"M"});
+insert into dataset employee({"id":208,"name":"Mike Carey","age":42});
+insert into dataset employee({"id":221,"name":"Mariam","age":40,"sex":"F","dob":date("1970-01-09"),"desgination":{{"dsg":"Department Manager"}}});
 
-insert into dataset dtst01({for $l in dataset('employee') return $l});
+insert into dataset dtst01(for $l in dataset('employee') return $l);
 
 for $l in dataset('dtst01')
-retunr $l 
+return $l 
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-21.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-21.aql
index c1c7ab2..71ce585 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-21.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-21.aql
@@ -1,12 +1,11 @@
 /*
  * Test case name :  open-closed-21.aql
- * Description    :  Insert into open type internal dataset by querying another closed type internal dataset
- *                :  In this case source dataset has (n+n) fields and the target dataset has only n fields, but has no intial records in it.
+ * Description    :  Insert into open type internal dataset by querying another open type internal dataset
+ *                :  In this case source dataset has (n+n) fields and the target dataset has only 1 field, but has no intial records in it.
  * Success        :  Yes
  * Date           :  29 April 2012
  */
 
-
 drop dataverse test if exists;
 create dataverse test;
 use dataverse test;
@@ -17,7 +16,7 @@
 
 create dataset dtst01(TestType) partitioned by key id;
 
-create type Emp as closed {
+create type Emp as open {
 id:int32,
 name:string,
 age:int8,
@@ -27,19 +26,17 @@
 
 create dataset employee(Emp) partitioned by key id;
 
-insert into dataset employee({"id":201,"name":"John Doe","age":32,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":202,"name":"John Smith","age":30,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":201,"name":"John Wayne","age":62,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":203,"name":"Roger Sanders","age":48,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":204,"name":"Raj Singh","age":37,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":205,"name":"Mike Tyson","age":44,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":206,"name":"Brett Lee","age":35,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":207,"name":"Chen Li","age":39,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":208,"name":"Mike Carey","age":42,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":209,"name":"Abdullah","age":29,"sex":"M","dob":"1-1-82"});
-insert into dataset employee({"id":221,"name":"Mariam","age":25,"sex":"F","dob":"1-1-82"});
+insert into dataset employee({"id":201,"name":"John Doe","age":32,"sex":"M","dob":date("1975-01-11")});
+insert into dataset employee({"id":202,"name":"John Smith","age":30,"sex":"M","dob":date("1982-07-12")});
+insert into dataset employee({"id":203,"name":"John Wayne","age":62,"sex":"M","dob":date("1950-01-08")});
+insert into dataset employee({"id":204,"name":"Roger Sanders","age":48,"sex":"M","dob":date("1972-11-12")});
+insert into dataset employee({"id":205,"name":"Raj Singh","age":37,"sex":"M","dob":date("1978-05-06")});
+insert into dataset employee({"id":206,"name":"Mike Tyson","age":44,"sex":"M","dob":date("1965-09-03")});
+insert into dataset employee({"id":227,"name":"Mariam","age":30,"sex":"F","dob":date("1982-11-01")});
 
-insert into dataset dtst01({for $l in dataset('employee') return $l});
+insert into dataset employee({"id":228,"name":"Cathy","age":35,"sex":"F","dob":date("1976-06-11"),"desgination":{{"Department Manager"}}});
+
+insert into dataset dtst01(for $l in dataset('employee') return $l);
 
 for $l in dataset('dtst01')
-retunr $l 
+return $l 
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-22.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-22.aql
index ced75c4..6e05f61 100644
--- a/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-22.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-22.aql
@@ -1,6 +1,6 @@
 /*
  * Test case name :  open-closed-22.aql
- * Description    :  Insert into a closed type internal dataset which has nullable(optional) and non-nullable fields
+ * Description    :  Insert into a closed type dataset which has nullable(optional) and non-nullable fields
  * Success        :  Yes
  * Date           :  30 April 2012
  */