Added open-closed type test

git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization@169 eaa15691-b419-025a-1212-ee371bd00084
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
new file mode 100644
index 0000000..ced75c4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/open-closed-22.aql
@@ -0,0 +1,43 @@
+/*
+ * Test case name :  open-closed-22.aql
+ * Description    :  Insert into a closed type internal dataset which has nullable(optional) and non-nullable fields
+ * Success        :  Yes
+ * Date           :  30 April 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+write output to nc1:"rttest/open-closed-22.adm";
+
+create type Emp as closed {
+id:int32,
+name:string,
+age:int8?,
+dept:string?,
+sex:string,
+dob:date?
+}
+
+create dataset employee(Emp) partitioned by key id;
+
+//date("YYYY-MM-DD")
+insert into dataset employee({"id":201,"name":"John Doe","age":37,"dept":"HR","sex":"M","dob":date("1975-11-02")});
+
+insert into dataset employee({"id":202,"name":"John Smith","age":30,"dept":"Sales","sex":"M","dob":date("1982-12-12")});
+
+// all optional fields missing
+insert into dataset employee({"id":201,"name":"John Wayne","age":62,"sex":"M"});
+
+// missing age field
+insert into dataset employee({"id":203,"name":"Roger Sanders","dept":"Technology","sex":"M","dob":date("1970-03-12")});
+
+// all optional fields missing!
+insert into dataset employee({"id":204,"name":"Raj Singh","sex":"M"});
+
+// missing dept field
+insert into dataset employee({"id":205,"name":"Mike Tyson","age":44,"sex":"M","dob":date("1970-12-22")});
+
+for $l in dataset('employee')
+return $l