merged asterix_stabilization -r722:751 to asterix_lsm_stabilization

git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_lsm_stabilization@756 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-algebra/pom.xml b/asterix-algebra/pom.xml
index ac2207c..f950800 100644
--- a/asterix-algebra/pom.xml
+++ b/asterix-algebra/pom.xml
@@ -61,7 +61,7 @@
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>hyracks-algebricks-compiler</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>org.json</groupId>
diff --git a/asterix-app/pom.xml b/asterix-app/pom.xml
index 5d7a187..75ec501 100644
--- a/asterix-app/pom.xml
+++ b/asterix-app/pom.xml
@@ -129,17 +129,17 @@
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>hyracks-control-cc</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>hyracks-control-nc</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>hyracks-algebricks-compiler</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>edu.uci.ics.asterix</groupId>
@@ -209,6 +209,11 @@
 			<type>jar</type>
 			<scope>test</scope>
 		</dependency>
+                <dependency>
+                    <groupId>net.sourceforge.cobertura</groupId>
+                    <artifactId>cobertura</artifactId>
+                    <version>1.9.4</version>
+                </dependency>
 	</dependencies>
 
 </project>
diff --git a/asterix-app/src/test/resources/runtimets/queries/flwor/for19.aql b/asterix-app/src/test/resources/runtimets/queries/flwor/for19.aql
new file mode 100644
index 0000000..1101c95
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/flwor/for19.aql
@@ -0,0 +1,11 @@
+/*
+ * Description      :  Test for clause of the FLWOR expression
+ * Expected Result  :  Success
+ * Date             :  7th July 2012
+ */
+
+write output to nc1:"rttest/flwor_for19.adm";
+
+for $a in [[1,2,3,4,5,6,7,8,9,0],[11,34,56,78,98,01,12,34,56,76,83]]
+where len($a) > 1
+return $a
diff --git a/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql b/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql
index 68f09ae..8aed603 100644
--- a/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/string/startwith03.aql
@@ -25,7 +25,7 @@
 insert into dataset testds({"name":"David Smith"});
 insert into dataset testds({"name":"Not a Name"});
 
-write output to nc1:"rttest/string_startwith03.adm;
+write output to nc1:"rttest/string_startwith03.adm";
 
 // Return all names that start with John
 
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for01.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for01.adm
new file mode 100644
index 0000000..0719398
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for01.adm
@@ -0,0 +1,9 @@
+1
+2
+3
+4
+5
+6
+7
+8
+9
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for02.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for02.adm
new file mode 100644
index 0000000..e667d8d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for02.adm
@@ -0,0 +1,2 @@
+[ 6, 7, 8, 9 ]
+[ 20, 30, 40, 50, 60 ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for07.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for07.adm
new file mode 100644
index 0000000..47bf4d2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for07.adm
@@ -0,0 +1,3 @@
+{ "name": "Bob", "age": 10, "sex": "Male" }
+{ "name": "John", "age": 45, "sex": "Female" }
+{ "name": "Raj", "age": 35, "sex": "Male" }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for08.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for08.adm
new file mode 100644
index 0000000..cbafc7b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for08.adm
@@ -0,0 +1 @@
+{ "name": "John", "age": 45, "sex": "Female" }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for10.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for10.adm
new file mode 100644
index 0000000..77de263
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for10.adm
@@ -0,0 +1,3 @@
+{ "a": { "name": "Bob", "age": 10, "sex": "Male" }, "additional-data": {{ "this is additional data", "this is too", "and this is additional too" }} }
+{ "a": { "name": "John", "age": 45, "sex": "Female" }, "additional-data": {{ "this is additional data", "this is too", "and this is additional too" }} }
+{ "a": { "name": "Raj", "age": 35, "sex": "Male" }, "additional-data": {{ "this is additional data", "this is too", "and this is additional too" }} }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for11.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for11.adm
new file mode 100644
index 0000000..98ed45a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for11.adm
@@ -0,0 +1,3 @@
+{{ "this is additional data", "this is too", "and this is additional too" }}
+{{ "this is additional data", "this is too", "and this is additional too" }}
+{{ "this is additional data", "this is too", "and this is additional too" }}
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for12.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for12.adm
new file mode 100644
index 0000000..7802f8c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for12.adm
@@ -0,0 +1 @@
+{ "a": {{ "this is additional data", "this is too", "and this is additional too" }}, "b": {{ "this is additional data", "this is too", "and this is additional too" }} }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for13.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for13.adm
new file mode 100644
index 0000000..31c6c07
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for13.adm
@@ -0,0 +1 @@
+{{ "this is additional data", "this is too", "and this is additional too" }}
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for17.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for17.adm
new file mode 100644
index 0000000..99d9a50
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for17.adm
@@ -0,0 +1 @@
+[ { "id": 3424, "name": "Roger Sanders", "age": 46, "salary": 60000, "dept": "Publishing" }, { "id": 1234, "name": "John Doe", "age": 56, "salary": 50000, "dept": "HR" } ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for18.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for18.adm
new file mode 100644
index 0000000..94d97d8
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for18.adm
@@ -0,0 +1,7 @@
+5
+6
+7
+8
+9
+10
+11
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/for19.adm b/asterix-app/src/test/resources/runtimets/results/flwor/for19.adm
new file mode 100644
index 0000000..1993b65
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/for19.adm
@@ -0,0 +1,2 @@
+[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 ]
+[ 11, 34, 56, 78, 98, 1, 12, 34, 56, 76, 83 ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let01.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let01.adm
new file mode 100644
index 0000000..7daa4d9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let01.adm
@@ -0,0 +1 @@
+92233720368547758i64
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let02.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let02.adm
new file mode 100644
index 0000000..7daa4d9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let02.adm
@@ -0,0 +1 @@
+92233720368547758i64
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let03.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let03.adm
new file mode 100644
index 0000000..4a373dc
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let03.adm
@@ -0,0 +1 @@
+92233720368547759i64
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let04.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let04.adm
new file mode 100644
index 0000000..a3199f9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let04.adm
@@ -0,0 +1 @@
+1.7976931348623157E308d
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let05.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let05.adm
new file mode 100644
index 0000000..974cb4d
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let05.adm
@@ -0,0 +1 @@
+{ "a": 6 }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let06.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let06.adm
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let06.adm
@@ -0,0 +1 @@
+1
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let07.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let07.adm
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let07.adm
@@ -0,0 +1 @@
+2
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let08.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let08.adm
new file mode 100644
index 0000000..dcf37cd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let08.adm
@@ -0,0 +1,3 @@
+2
+3
+4
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let09.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let09.adm
new file mode 100644
index 0000000..1d24055
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let09.adm
@@ -0,0 +1,20 @@
+5
+10
+15
+20
+25
+30
+35
+40
+45
+50
+55
+60
+65
+70
+75
+80
+85
+90
+95
+100
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let10.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let10.adm
new file mode 100644
index 0000000..f9784e4
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let10.adm
@@ -0,0 +1,8 @@
+5
+10
+15
+35
+60
+35
+25
+60
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let12.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let12.adm
new file mode 100644
index 0000000..0cfbf08
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let12.adm
@@ -0,0 +1 @@
+2
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let15.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let15.adm
new file mode 100644
index 0000000..c3b2df1
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let15.adm
@@ -0,0 +1 @@
+[ [ [ [ [ [ [ [ [ [ [ 9222872036854775809i64 ] ] ] ] ] ] ] ] ] ] ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let16.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let16.adm
new file mode 100644
index 0000000..9537c45
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let16.adm
@@ -0,0 +1 @@
+[ [ [ [ [ [ [ [ [ [ [ 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64, 9222872036854775809i64 ] ] ] ] ] ] ] ] ] ] ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let18.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let18.adm
new file mode 100644
index 0000000..4e85e4e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let18.adm
@@ -0,0 +1 @@
+[ {{ "John Doe", 45, "HR", 60000, "Separation" }} ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let19.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let19.adm
new file mode 100644
index 0000000..4ae8208
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let19.adm
@@ -0,0 +1 @@
+{{ "John Doe", 45, "HR", 60000, "Separation" }}
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let21.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let21.adm
new file mode 100644
index 0000000..445a2e6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let21.adm
@@ -0,0 +1,8 @@
+true
+true
+false
+false
+true
+true
+false
+false
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let24.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let24.adm
new file mode 100644
index 0000000..dc64ea3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let24.adm
@@ -0,0 +1 @@
+{ "m": { "name": "Holmes S", "age": 25, "sex": "M" }, "n": { "name": "Bob", "age": 35, "sex": null }, "o": {{ "John", 45, "M" }}, "p": {{ "Optional data goes here", null }}, "q": { "id": 1345, "test": { "name": "Federer", "age": 35 }, "foo": "foo" } }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let25.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let25.adm
new file mode 100644
index 0000000..0fbb402
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let25.adm
@@ -0,0 +1 @@
+{ "a": true, "b": true }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let26.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let26.adm
new file mode 100644
index 0000000..93bfd91
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let26.adm
@@ -0,0 +1 @@
+{ "a": true, "b": false, "c": true }
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let27.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let27.adm
new file mode 100644
index 0000000..fd2d8bd
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let27.adm
@@ -0,0 +1 @@
+[ 200, 0, 10000, 1, 0 ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let28.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let28.adm
new file mode 100644
index 0000000..1717867
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let28.adm
@@ -0,0 +1 @@
+[ 137.8932f, 156.0f, 0.98781f, 436.219f, 0.89217f, 16789.0f ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/let29.adm b/asterix-app/src/test/resources/runtimets/results/flwor/let29.adm
new file mode 100644
index 0000000..e420b1c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/let29.adm
@@ -0,0 +1 @@
+[ 137.8932d, 0.98781d, 436.219d, 0.89217d, -234.324d ]
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-01.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-01.adm
new file mode 100644
index 0000000..71b9db2
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-01.adm
@@ -0,0 +1,7 @@
+"undo"
+"two"
+"twenty"
+"ten"
+"six"
+"four"
+"eight"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-02.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-02.adm
new file mode 100644
index 0000000..99c27cf
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-02.adm
@@ -0,0 +1,7 @@
+"eight"
+"four"
+"six"
+"ten"
+"twenty"
+"two"
+"undo"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-03.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-03.adm
new file mode 100644
index 0000000..c1d50f9
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-03.adm
@@ -0,0 +1,8 @@
+"fiftytest"
+"fortytest"
+"ninetytest"
+"seventytest"
+"sixtytest"
+"tentest"
+"thirtytest"
+"twentytest"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-04.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-04.adm
new file mode 100644
index 0000000..931f30a
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-04.adm
@@ -0,0 +1,8 @@
+"twentytest"
+"thirtytest"
+"tentest"
+"sixtytest"
+"seventytest"
+"ninetytest"
+"fortytest"
+"fiftytest"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-05.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-05.adm
new file mode 100644
index 0000000..3eb440c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-05.adm
@@ -0,0 +1,8 @@
+"twenty"
+"thirty"
+"ten"
+"sixty"
+"seventy"
+"ninety"
+"forty"
+"fifty"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-06.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-06.adm
new file mode 100644
index 0000000..097675e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-06.adm
@@ -0,0 +1,8 @@
+"fifty"
+"forty"
+"ninety"
+"seventy"
+"sixty"
+"ten"
+"thirty"
+"twenty"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-07.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-07.adm
new file mode 100644
index 0000000..3eb440c
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-07.adm
@@ -0,0 +1,8 @@
+"twenty"
+"thirty"
+"ten"
+"sixty"
+"seventy"
+"ninety"
+"forty"
+"fifty"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-08.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-08.adm
new file mode 100644
index 0000000..097675e
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-08.adm
@@ -0,0 +1,8 @@
+"fifty"
+"forty"
+"ninety"
+"seventy"
+"sixty"
+"ten"
+"thirty"
+"twenty"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-09.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-09.adm
new file mode 100644
index 0000000..4c04fa3
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-09.adm
@@ -0,0 +1,8 @@
+"fiftyfifty"
+"fortyforty"
+"ninetyninety"
+"seventyseventy"
+"sixtysixty"
+"tenten"
+"thirtythirty"
+"twentytwenty"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-10.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-10.adm
new file mode 100644
index 0000000..aeb5335
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-10.adm
@@ -0,0 +1,8 @@
+"twentytwenty"
+"thirtythirty"
+"tenten"
+"sixtysixty"
+"seventyseventy"
+"ninetyninety"
+"fortyforty"
+"fiftyfifty"
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-11.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-11.adm
new file mode 100644
index 0000000..362e5c0
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-11.adm
@@ -0,0 +1,18 @@
+-2
+0
+2
+4
+6
+6
+8
+10
+24
+66
+68
+86
+90
+110
+132
+134
+178
+1998
diff --git a/asterix-app/src/test/resources/runtimets/results/flwor/order-by-12.adm b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-12.adm
new file mode 100644
index 0000000..0935089
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/flwor/order-by-12.adm
@@ -0,0 +1,7 @@
+{ "x": [ 45, 67 ], "len($x)": 2 }
+{ "x": [ 5, 2 ], "len($x)": 2 }
+{ "x": [ -1, 999 ], "len($x)": 2 }
+{ "x": [ 66, 89, 0 ], "len($x)": 3 }
+{ "x": [ 1, 3, 4 ], "len($x)": 3 }
+{ "x": [ 3, 33, 55 ], "len($x)": 3 }
+{ "x": [ 43, 12, 34 ], "len($x)": 3 }
diff --git a/asterix-common/pom.xml b/asterix-common/pom.xml
index 2abe6dd..67377d5 100644
--- a/asterix-common/pom.xml
+++ b/asterix-common/pom.xml
@@ -26,12 +26,12 @@
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>hyracks-algebricks-compiler</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>hyracks-dataflow-std</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>edu.uci.ics.asterix</groupId>
diff --git a/asterix-dist/pom.xml b/asterix-dist/pom.xml
index ec27b64..53168b4 100644
--- a/asterix-dist/pom.xml
+++ b/asterix-dist/pom.xml
@@ -32,14 +32,14 @@
     <dependency>
 	  <groupId>edu.uci.ics.hyracks</groupId>
   	  <artifactId>hyracks-server</artifactId>
-  	  <version>0.2.1-SNAPSHOT</version>
+  	  <version>0.2.2-SNAPSHOT</version>
   	  <type>zip</type>
       <classifier>binary-assembly</classifier>
     </dependency>
     <dependency>
 	  <groupId>edu.uci.ics.hyracks</groupId>
   	  <artifactId>hyracks-cli</artifactId>
-  	  <version>0.2.1-SNAPSHOT</version>
+  	  <version>0.2.2-SNAPSHOT</version>
   	  <type>zip</type>
       <classifier>binary-assembly</classifier>
     </dependency>
diff --git a/asterix-external-data/pom.xml b/asterix-external-data/pom.xml
index c297c08..7da6bd9 100644
--- a/asterix-external-data/pom.xml
+++ b/asterix-external-data/pom.xml
@@ -131,7 +131,7 @@
 	        <dependency>
 		         <groupId>edu.uci.ics.hyracks</groupId>
 		         <artifactId>hyracks-dataflow-hadoop</artifactId>
-		         <version>0.2.1-SNAPSHOT</version>
+		         <version>0.2.2-SNAPSHOT</version>
 	        </dependency>
 <dependency>
             <groupId>jdom</groupId>
diff --git a/asterix-metadata/pom.xml b/asterix-metadata/pom.xml
index d782999..d95e29a 100644
--- a/asterix-metadata/pom.xml
+++ b/asterix-metadata/pom.xml
@@ -1,4 +1,5 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 	<parent>
 		<artifactId>asterix</artifactId>
@@ -42,33 +43,33 @@
 			<version>0.0.4-SNAPSHOT</version>
 			<scope>compile</scope>
 		</dependency>
-                <dependency>
-                        <groupId>org.apache.hadoop</groupId>
-                        <artifactId>hadoop-core</artifactId>
-                        <version>0.20.2</version>
-                        <type>jar</type>
-                        <scope>compile</scope>
-                </dependency>
-                <dependency>
-                	<groupId>edu.uci.ics.hyracks</groupId>
-                	<artifactId>
+		<dependency>
+			<groupId>org.apache.hadoop</groupId>
+			<artifactId>hadoop-core</artifactId>
+			<version>0.20.2</version>
+			<type>jar</type>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>edu.uci.ics.hyracks</groupId>
+			<artifactId>
                 		hyracks-storage-am-lsm-invertedindex
                 	</artifactId>
-                	<version>0.2.1-SNAPSHOT</version>
-                </dependency>
-                <dependency>
-                	<groupId>edu.uci.ics.hyracks</groupId>
-                	<artifactId>
+			<version>0.2.2-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>edu.uci.ics.hyracks</groupId>
+			<artifactId>
                 		hyracks-storage-am-lsm-btree
                 	</artifactId>
-                	<version>0.2.1-SNAPSHOT</version>
-                </dependency>
-                <dependency>
-                	<groupId>edu.uci.ics.hyracks</groupId>
-                	<artifactId>
+			<version>0.2.2-SNAPSHOT</version>
+		</dependency>
+		<dependency>
+			<groupId>edu.uci.ics.hyracks</groupId>
+			<artifactId>
                 		hyracks-storage-am-lsm-rtree
                 	</artifactId>
-                	<version>0.2.1-SNAPSHOT</version>
-                </dependency>
+			<version>0.2.2-SNAPSHOT</version>
+		</dependency>
 	</dependencies>
 </project>
diff --git a/asterix-om/pom.xml b/asterix-om/pom.xml
index a72e80a..ff9e143 100644
--- a/asterix-om/pom.xml
+++ b/asterix-om/pom.xml
@@ -34,19 +34,19 @@
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>hyracks-algebricks-compiler</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>
 				hyracks-storage-am-lsm-invertedindex
 			</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 			<artifactId>hyracks-storage-am-lsm-rtree</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 	</dependencies>
 </project>
diff --git a/asterix-runtime/pom.xml b/asterix-runtime/pom.xml
index b765382..eb81fe5 100644
--- a/asterix-runtime/pom.xml
+++ b/asterix-runtime/pom.xml
@@ -56,7 +56,7 @@
 		<dependency>
 			<groupId>edu.uci.ics.hyracks</groupId>
 		        <artifactId>hyracks-storage-am-btree</artifactId>
-			<version>0.2.1-SNAPSHOT</version>
+			<version>0.2.2-SNAPSHOT</version>
 		</dependency>
 		<dependency>
 		        <groupId>edu.uci.ics.asterix</groupId>
diff --git a/asterix-transactions/pom.xml b/asterix-transactions/pom.xml
index d7703fd..c440c2a 100644
--- a/asterix-transactions/pom.xml
+++ b/asterix-transactions/pom.xml
@@ -28,7 +28,7 @@
 	    <dependency>
   		<groupId>edu.uci.ics.hyracks</groupId>
   		<artifactId>hyracks-storage-am-common</artifactId>
-  		<version>0.2.1-SNAPSHOT</version>
+  		<version>0.2.2-SNAPSHOT</version>
   		<type>jar</type>
   		<scope>compile</scope>
   	</dependency>
diff --git a/build.xml b/build.xml
new file mode 100644
index 0000000..a3a2344
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,75 @@
+<project>
+    <target name="instrument">
+        <antcall target="instrumentAModule">
+            <param name="module" value="asterix-aql"/>
+            <param name="module" value="asterix-om"/>
+            <param name="module" value="asterix-metadata"/>
+            <param name="module" value="asterix-tools"/>
+            <param name="module" value="asterix-common"/>
+            <param name="module" value="asterix-transactions"/>
+        </antcall>
+    </target>
+
+    <target name="report" depends="merge">
+        <property name="src.dir" value="src/main/java/"/>
+        <cobertura-report datafile="sum.ser"
+                          format="html"
+                          destdir="./target/report">
+            <!-- Add all modules that should be included below -->
+            <!-- fileset dir="./MODULE_NAME_TO_REPLACE/${src.dir}"/ -->
+            <fileset dir="./asterix-aql/${src.dir}"/>
+            <fileset dir="./asterix-om/${src.dir}"/>
+            <fileset dir="./asterix-metadata/${src.dir}"/>
+            <fileset dir="./asterix-tools/${src.dir}"/>
+            <fileset dir="./asterix-common/${src.dir}"/>
+            <fileset dir="./asterix-runtime/${src.dir}"/>
+            <fileset dir="./asterix-transactions/${src.dir}"/>
+        </cobertura-report>
+    </target>
+
+    <target name="merge">
+        <cobertura-merge datafile="sum.ser">
+            <fileset dir=".">
+                <include name="**/cobertura.ser"/>
+            </fileset>
+        </cobertura-merge>
+    </target>
+
+    <target name="instrumentAModule">
+        <property name="classes.dir" value="target/classes"/>
+        <cobertura-instrument todir="./${module}/${classes.dir}">
+            <fileset dir="./asterix-aql/target/classes">
+                <include name="**/*.class"/>
+            </fileset>
+            <fileset dir="./asterix-om/target/classes">
+                <include name="**/*.class"/>
+            </fileset>
+            <fileset dir="./asterix-metadata/target/classes">
+                <include name="**/*.class"/>
+            </fileset>
+            <fileset dir="./asterix-tools/target/classes">
+                <include name="**/*.class"/>
+            </fileset>
+            <fileset dir="./asterix-common/target/classes">
+                <include name="**/*.class"/>
+            </fileset>
+            <fileset dir="./asterix-runtime/target/classes">
+                <include name="**/*.class"/>
+            </fileset>
+            <fileset dir="./asterix-transactions/target/classes">
+                <include name="**/*.class"/>
+            </fileset>
+        </cobertura-instrument>
+    </target>
+
+<property environment="env"/>
+    <property name="COBERTURA_HOME" value="/home/kfmohamm/.m2/repository/net/sourceforge/cobertura/cobertura/1.9.4.1"/>
+    <property name="cobertura.dir" value="${COBERTURA_HOME}"/>
+    <path id="cobertura.classpath">
+        <fileset dir="${cobertura.dir}">
+            <include name="cobertura.jar"/>
+            <include name="lib/**/*.jar"/>
+        </fileset>
+    </path>
+    <taskdef classpathref="cobertura.classpath" resource="tasks.properties"/>
+</project>
diff --git a/pom.xml b/pom.xml
index 690cb88..c5a3959 100644
--- a/pom.xml
+++ b/pom.xml
@@ -127,5 +127,12 @@
 			<url>http://obelix.ics.uci.edu/nexus/content/repositories/algebricks-snapshots/</url>
 		</repository>
 	</repositories>
-
+    <dependencies>
+        <dependency>
+            <groupId>net.sourceforge.cobertura</groupId>
+            <artifactId>cobertura</artifactId>
+            <version>1.9.4</version>
+            <optional>true</optional>
+        </dependency>
+    </dependencies>
 </project>