code review: added tests for issue 29,55,134,166,201,205,208
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization_printerfix_staging@968 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql
new file mode 100644
index 0000000..e0a0695
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/dml/query-issue205.aql
@@ -0,0 +1,33 @@
+/*
+ * Description : This test case is to verify the fix for issue205
+ : https://code.google.com/p/asterixdb/issues/detail?id=205
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+drop dataverse test if exists;
+create dataverse test;
+use dataverse test;
+
+create type EmployeeStat as open {
+ age: int32,
+ salary:int32
+}
+
+create type EmployeeType as closed {
+ id:string,
+ stat:EmployeeStat,
+ deptCode:int32
+}
+
+create dataset Employees(EmployeeType)
+ partitioned by key id;
+
+insert into dataset Employees({"id":"1234", "stat":{ "age":50, "salary":120000}, "deptCode":32 });
+insert into dataset Employees({"id":"5678", "stat":{ "age":40, "salary":100000}, "deptCode":16 });
+
+delete $l from dataset Employees where $l.id = "1234";
+
+write output to nc1:"rttest/dml_query-issue205.adm";
+for $l in dataset('Employees')
+return $l
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue134.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue134.aql
new file mode 100644
index 0000000..62a9ed8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue134.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue134
+ : https://code.google.com/p/asterixdb/issues/detail?id=134
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue134.adm";
+
+let $a:=true
+return {{[1,2,3,4,5],[6,5,3,8,9],[44,22,66,-1,0,99.9]}}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue166.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue166.aql
new file mode 100644
index 0000000..aa0d13b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue166.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue166
+ : https://code.google.com/p/asterixdb/issues/detail?id=166
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue166.adm";
+
+let $a := [[1,2,3],[4,5,6,7]]
+return $a[1]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
new file mode 100644
index 0000000..e46286c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue208.aql
@@ -0,0 +1,45 @@
+/*
+ * Description : This test case is to verify the fix for issue208
+ : https://code.google.com/p/asterixdb/issues/detail?id=208
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+drop dataverse OpenSocialNetworkData if exists;
+create dataverse OpenSocialNetworkData;
+
+use dataverse OpenSocialNetworkData;
+
+create type TwitterUserType as open {
+screen-name: string,
+lang: string,
+friends_count: int32,
+statuses_count: int32,
+name: string,
+followers_count: int32
+}
+
+create type TweetMessageType as open {
+tweetid: string,
+tweetid-copy: string,
+send-time-copy: datetime
+}
+
+create dataset TweetMessages(TweetMessageType)
+partitioned by key tweetid;
+
+load dataset TweetMessages
+using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
+(("path"="nc1://data/twitter/tw_messages.adm"),("format"="adm"));
+
+write output to nc1:"rttest/open-closed_query-issue208.adm";
+for $t in dataset('TweetMessages')
+where $t.send-time >= datetime('2005-04-13T17:17:22') and
+$t.send-time <= datetime('2011-04-13T17:18:22')
+group by $uid := $t.user.screen-name with $t
+order by $uid
+return {
+ "user": $uid,
+ "count": count($t)
+}
+
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue29.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue29.aql
new file mode 100644
index 0000000..8b778ba
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue29.aql
@@ -0,0 +1,70 @@
+/*
+ * Description : This test case is to verify the fix for issue29
+ : https://code.google.com/p/asterixdb/issues/detail?id=29
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue29.adm";
+
+let $tweets :=
+{{
+ {
+ "tweetid": "1023",
+ "user": {
+ "screen-name": "dflynn24",
+ "lang": "en",
+ "friends_count": 46,
+ "statuses_count": 987,
+ "name": "danielle flynn",
+ "followers_count": 47
+ },
+ "sender-location": "40.904177,-72.958996",
+ "send-time": "2010-02-21T11:56:02-05:00",
+ "referred-topics": {{ "verizon" }},
+ "message-text": "i need a #verizon phone like nowwwww! :("
+ },
+ {
+ "tweetid": "1024",
+ "user": {
+ "screen-name": "miriamorous",
+ "lang": "en",
+ "friends_count": 69,
+ "statuses_count": 1068,
+ "name": "Miriam Songco",
+ "followers_count": 78
+ },
+ "send-time": "2010-02-21T11:11:43-08:00",
+ "referred-topics": {{ "commercials", "verizon", "att" }},
+ "message-text": "#verizon & #att #commercials, so competitive"
+ },
+ {
+ "tweetid": "1025",
+ "user": {
+ "screen-name": "dj33",
+ "lang": "en",
+ "friends_count": 96,
+ "statuses_count": 1696,
+ "name": "Don Jango",
+ "followers_count": 22
+ },
+ "send-time": "2010-02-21T12:38:44-05:00",
+ "referred-topics": {{ "charlotte" }},
+ "message-text": "Chillin at dca waiting for 900am flight to #charlotte and from there to providenciales"
+ },
+ {
+ "tweetid": "1026",
+ "user": {
+ "screen-name": "reallyleila",
+ "lang": "en",
+ "friends_count": 106,
+ "statuses_count": 107,
+ "name": "Leila Samii",
+ "followers_count": 52
+ },
+ "send-time": "2010-02-21T21:31:57-06:00",
+ "referred-topics": {{ "verizon", "at&t", "iphone" }},
+ "message-text": "I think a switch from #verizon to #at&t may be in my near future... my smartphone is like a land line compared to the #iphone!"
+ }
+}}
+return $tweets
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55-1.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55-1.aql
new file mode 100644
index 0000000..11b75d1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55-1.aql
@@ -0,0 +1,13 @@
+/*
+ * Description : This test case is to verify the fix for issue55 query 1
+ : https://code.google.com/p/asterixdb/issues/detail?id=55
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue55-1.adm";
+
+let $l := [1.1f, 1.0f, 1.2f, 0.9, 1.3, 1, 2]
+for $i in $l
+for $j in $l
+return [$i, $j, "=", $i = $j, "<", $i < $j, "<=", $i <= $j, ">", $i > $j, ">=", $i >= $j]
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55.aql b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55.aql
new file mode 100644
index 0000000..b4e4572
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/open-closed/query-issue55.aql
@@ -0,0 +1,11 @@
+/*
+ * Description : This test case is to verify the fix for issue55 query 2
+ : https://code.google.com/p/asterixdb/issues/detail?id=55
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/open-closed_query-issue55.adm";
+
+for $x in [[1,3],[4,5,2],[-1,-3,0],["a"]]
+return $x
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201.aql b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201.aql
new file mode 100644
index 0000000..0505179
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/user-defined-functions/query-issue201.aql
@@ -0,0 +1,12 @@
+/*
+ * Description : This test case is to verify the fix for issue201
+ : https://code.google.com/p/asterixdb/issues/detail?id=201
+ * Expected Res : Success
+ * Date : 26th November 2012
+ */
+
+write output to nc1:"rttest/user-defined-functions_query-issue201.adm";
+
+let $x:=range(1,100)
+for $i in $x
+return $i
\ No newline at end of file