1) Fix Issue 198 (Metadata tests need to be rewritten - added additional tests, cleaned existing) 
2) Metadata tests now use the new test framework. 


git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization@950 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-app/src/test/resources/metadata/queries.txt b/asterix-app/src/test/resources/metadata/queries.txt
deleted file mode 100644
index 747dce3..0000000
--- a/asterix-app/src/test/resources/metadata/queries.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-metadata_dataverse.aql
-metadata_dataset.aql
-metadata_index.aql
-metadata_datatype.aql
-metadata_node.aql
-metadata_nodegroup.aql
-custord_q1.aql
-custord_q2.aql
-custord_q3.aql
-custord_q4.aql
-custord_dataverse.aql
-custord_dataset.aql
-custord_index.aql
-custord_datatype.aql
-custord_nodegroup.aql
-custord_q5.aql
-exceptions.aql
-custord_q7.aql
-custord_q8.aql
-metadata_dataverse.aql
-metadata_dataset.aql
-metadata_index.aql
-metadata_datatype.aql
-metadata_node.aql
-metadata_nodegroup.aql
diff --git a/asterix-app/src/test/resources/metadata/queries/meta01.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta01.aql
similarity index 78%
rename from asterix-app/src/test/resources/metadata/queries/meta01.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta01.aql
index 15b7de8..5ce47ad 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta01.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta01.aql
@@ -7,7 +7,9 @@
 drop dataverse testdv if exists;
 create dataverse testdv;
 
-write output to nc1:"rttest/meta01.adm";
+write output to nc1:"mdtest/basic_meta01.adm";
 
 for $l in dataset('Metadata.Dataverse')
 return $l
+
+drop dataverse testdv;
diff --git a/asterix-app/src/test/resources/metadata/queries/meta02.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta02.aql
similarity index 77%
rename from asterix-app/src/test/resources/metadata/queries/meta02.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta02.aql
index f6686b1..8bfc240 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta02.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta02.aql
@@ -7,9 +7,9 @@
 drop dataverse testdv if exists;
 create dataverse testdv;
 
-write output to nc1:"rttest/meta02.adm";
+write output to nc1:"mdtest/basic_meta02.adm";
 
-create type test.testtype as open {
+create type testdv.testtype as open {
 id : int32
 }
 
@@ -18,3 +18,5 @@
 for $l in dataset('Metadata.Dataset')
 where $l.DataverseName = 'testdv' and $l.DatasetName = 'dst01'
 return $l
+
+drop dataverse testdv; 
diff --git a/asterix-app/src/test/resources/metadata/queries/meta03.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta03.aql
similarity index 83%
rename from asterix-app/src/test/resources/metadata/queries/meta03.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta03.aql
index 88c658c..0b876f2 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta03.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta03.aql
@@ -7,7 +7,7 @@
 drop dataverse testdv if exists;
 create dataverse testdv;
 
-write output to nc1:"rttest/meta03.adm";
+write output to nc1:"mdtest/basic_meta03.adm";
 
 create type testdv.testtype as closed {
 id : int32
@@ -16,3 +16,6 @@
 for $l in dataset('Metadata.Datatype')
 where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
 return $l
+
+drop dataverse testdv;
+
diff --git a/asterix-app/src/test/resources/metadata/queries/meta04.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta04.aql
similarity index 83%
rename from asterix-app/src/test/resources/metadata/queries/meta04.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta04.aql
index fac73da..b2e7304 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta04.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta04.aql
@@ -7,7 +7,7 @@
 drop dataverse testdv if exists;
 create dataverse testdv;
 
-write output to nc1:"rttest/meta04.adm";
+write output to nc1:"mdtest/basic_meta04.adm";
 
 create type testdv.testtype as open {
 id : int32
@@ -16,3 +16,5 @@
 for $l in dataset('Metadata.Datatype')
 where $l.DataverseName='testdv' and $l.DatatypeName='testtype'
 return $l
+
+drop dataverse testdv;
diff --git a/asterix-app/src/test/resources/metadata/queries/meta05.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta05.aql
similarity index 86%
rename from asterix-app/src/test/resources/metadata/queries/meta05.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta05.aql
index 6a99187..9eb129d 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta05.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta05.aql
@@ -7,7 +7,7 @@
 drop dataverse testdv if exists;
 create dataverse testdv;
 
-write output to nc1:"rttest/meta05.adm";
+write output to nc1:"mdtest/basic_meta05.adm";
 
 create type testdv.testtype as open {
 id : int32,
@@ -21,3 +21,5 @@
 for $l in dataset('Metadata.Index')
 where $l.DataverseName='testdv' 
 return $l
+
+drop dataverse testdv;
diff --git a/asterix-app/src/test/resources/metadata/queries/meta06.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta06.aql
similarity index 83%
rename from asterix-app/src/test/resources/metadata/queries/meta06.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta06.aql
index c0b9a9b..6297561 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta06.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta06.aql
@@ -7,7 +7,7 @@
 drop dataverse testdv if exists;
 create dataverse testdv;
 
-write output to nc1:"rttest/meta06.adm";
+write output to nc1:"mdtest/basic_meta06.adm";
 
 create function testdv.fun01(){
 "This is an AQL Bodied UDF"
@@ -16,3 +16,4 @@
 for $l in dataset('Metadata.Function')
 return $l
 
+drop dataverse testdv;
diff --git a/asterix-app/src/test/resources/metadata/queries/meta07.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta07.aql
similarity index 84%
rename from asterix-app/src/test/resources/metadata/queries/meta07.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta07.aql
index 2455eeb..6544bca 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta07.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta07.aql
@@ -6,7 +6,7 @@
 
 // Please note this query was run on two nodes, i.e; two NCs
 
-write output to nc1:"rttest/meta07.adm";
+write output to nc1:"mdtest/basic_meta07.adm";
 
 for $l in dataset('Metadata.Node')
 return $l
diff --git a/asterix-app/src/test/resources/metadata/queries/meta08.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta08.aql
similarity index 84%
rename from asterix-app/src/test/resources/metadata/queries/meta08.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta08.aql
index e382c47..a7d536f 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta08.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta08.aql
@@ -6,7 +6,7 @@
 
 // Please note this query was run on two nodes, i.e; two NCs
 
-write output to nc1:"rttest/meta08.adm";
+write output to nc1:"mdtest/basic_meta08.adm";
 
 for $l in dataset('Metadata.Nodegroup')
 return $l
diff --git a/asterix-app/src/test/resources/metadata/queries/meta09.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta09.aql
similarity index 92%
rename from asterix-app/src/test/resources/metadata/queries/meta09.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta09.aql
index 4404707..28a3794 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta09.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta09.aql
@@ -7,7 +7,7 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/meta09.adm";
+write output to nc1:"mdtest/basic_meta09.adm";
 
 create type test.testtype as open {
 id:int32
@@ -29,3 +29,5 @@
 for $l in dataset('Metadata.Dataset')
 where $l.DataverseName='test' and $l.DatasetName='t1'
 return $l
+
+drop dataverse test; 
diff --git a/asterix-app/src/test/resources/metadata/queries/meta10.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta10.aql
similarity index 77%
rename from asterix-app/src/test/resources/metadata/queries/meta10.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta10.aql
index 6aae87b..452dcc3 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta10.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta10.aql
@@ -8,7 +8,10 @@
 create dataverse test;
 drop dataverse test if exists;
 
-write output to nc1:"rttest/meta10.adm";
+write output to nc1:"mdtest/basic_meta10.adm";
 
+count(
 for $l in dataset('Metadata.Dataverse')
+where $l.DataverseName='test'
 return $l
+)
diff --git a/asterix-app/src/test/resources/metadata/queries/meta11.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta11.aql
similarity index 74%
rename from asterix-app/src/test/resources/metadata/queries/meta11.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta11.aql
index a5ae81e..d781114 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta11.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta11.aql
@@ -7,7 +7,7 @@
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/meta11.adm";
+write output to nc1:"mdtest/basic_meta11.adm";
 
 create type test.testtype as open {
 id : int32
@@ -17,5 +17,11 @@
 
 drop dataset test.dst01;
 
+count(
 for $l in dataset('Metadata.Dataset')
+where $l.DataverseName='test' and $l.DatasetName='dst01'
 return $l
+)
+
+drop dataverse test;
+
diff --git a/asterix-app/src/test/resources/metadata/queries/meta12.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta12.aql
similarity index 85%
rename from asterix-app/src/test/resources/metadata/queries/meta12.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta12.aql
index 481cc3a..1de7ac5 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta12.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta12.aql
@@ -4,12 +4,10 @@
  * Date         : Sep 17 2012
  */
 
-// This drop index test is broken for now.
-
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/meta12.adm";
+write output to nc1:"mdtest/basic_meta12.adm";
 
 create type test.testtype as open {
 id : int32,
@@ -25,3 +23,5 @@
 for $l in dataset('Metadata.Index')
 where $l.DatasetName = 'dst01'
 return $l
+
+drop dataverse test;
diff --git a/asterix-app/src/test/resources/metadata/queries/meta13.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta13.aql
similarity index 72%
rename from asterix-app/src/test/resources/metadata/queries/meta13.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta13.aql
index 62d0964..0c0f627 100644
--- a/asterix-app/src/test/resources/metadata/queries/meta13.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta13.aql
@@ -5,12 +5,10 @@
  * Date         : Sep 17 2012
  */
 
-// this test returns NPE today
-
 drop dataverse test if exists;
 create dataverse test;
 
-write output to nc1:"rttest/meta13.adm";
+write output to nc1:"mdtest/basic_meta13.adm";
 
 create function test.foo(){
 "drop this function"
@@ -18,6 +16,9 @@
 
 drop function test.foo@0;
 
+count(
 for $l in dataset('Metadata.Function')
-return $l;
+where $l.DataverseName='test' and $l.Name='foo' and $l.Arity=0
+return $l);
 
+drop dataverse test;
diff --git a/asterix-app/src/test/resources/metadata/queries/regress_04_drop_nested_type.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta14.aql
similarity index 68%
rename from asterix-app/src/test/resources/metadata/queries/regress_04_drop_nested_type.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta14.aql
index f8c8626..9103614 100644
--- a/asterix-app/src/test/resources/metadata/queries/regress_04_drop_nested_type.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta14.aql
@@ -4,6 +4,7 @@
  * Expected Result  :  Success
  */
 
+
 drop dataverse test if exists;
 create dataverse test;
 use dataverse test;
@@ -12,10 +13,15 @@
    bar: int32?
 };
 
+
 drop type FooType;
 
-create type FooType as closed {
-   bar: int32?
-};
+write output to nc1:"mdtest/basic_meta14.adm";
 
-drop type FooType;
\ No newline at end of file
+count(
+for $x in dataset('Metadata.Datatype')
+where $x.DataverseName='test'
+return $x
+)
+
+drop dataverse test;
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta15.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta15.aql
new file mode 100644
index 0000000..91827ef
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta15.aql
@@ -0,0 +1,11 @@
+/*
+ * Description  : Query Metadata dataset Adapter to verify to contents.
+ * Expected Res : Success
+ * Date         : 25 Nov 2012
+ */
+
+write output to nc1:"mdtest/basic_meta15.adm";
+
+for $l in dataset('Metadata.DatasourceAdapter')
+return $l
+
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta16.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta16.aql
new file mode 100644
index 0000000..8b69b4f
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta16.aql
@@ -0,0 +1,9 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta16.adm";
+
+for $c in dataset('Dataset')
+return $c
+
+
+
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta17.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta17.aql
new file mode 100644
index 0000000..2cd25ee
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta17.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta17.adm";
+     
+for $c in dataset('Datatype')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta18.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta18.aql
new file mode 100644
index 0000000..45f065a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta18.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta18.adm";
+
+for $c in dataset('Dataverse')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_index.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta19.aql
similarity index 66%
rename from asterix-app/src/test/resources/metadata/queries/metadata_index.aql
rename to asterix-app/src/test/resources/metadata/queries/basic/meta19.aql
index cbe0109..21de582 100644
--- a/asterix-app/src/test/resources/metadata/queries/metadata_index.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta19.aql
@@ -1,6 +1,6 @@
 use dataverse Metadata;
 
-write output to nc1:"rttest/metadata_index.adm";
+write output to nc1:"mdtest/basic_meta19.adm";
 
 for $c in dataset('Index')
 where $c.DataverseName='Metadata'
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta20.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta20.aql
new file mode 100644
index 0000000..259f23e
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta20.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;    
+
+write output to nc1:"mdtest/basic_meta20.adm";
+
+for $c in dataset('Node')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/meta21.aql b/asterix-app/src/test/resources/metadata/queries/basic/meta21.aql
new file mode 100644
index 0000000..b5f8110
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/meta21.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"mdtest/basic_meta21.adm";
+     
+for $c in dataset('Nodegroup')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset.aql
new file mode 100644
index 0000000..94f7a58
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataset.aql
@@ -0,0 +1,9 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_dataset.adm";
+
+for $c in dataset('Dataset')
+return $c
+
+
+
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype.aql
new file mode 100644
index 0000000..4cc94de
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_datatype.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_datatype.adm";
+     
+for $c in dataset('Datatype')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse.aql
new file mode 100644
index 0000000..d3edfed
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_dataverse.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_dataverse.adm";
+
+for $c in dataset('Dataverse')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_index.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_index.aql
similarity index 63%
copy from asterix-app/src/test/resources/metadata/queries/metadata_index.aql
copy to asterix-app/src/test/resources/metadata/queries/basic/metadata_index.aql
index cbe0109..cb78758 100644
--- a/asterix-app/src/test/resources/metadata/queries/metadata_index.aql
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_index.aql
@@ -1,6 +1,6 @@
 use dataverse Metadata;
 
-write output to nc1:"rttest/metadata_index.adm";
+write output to nc1:"rttest/basic_metadata_index.adm";
 
 for $c in dataset('Index')
 where $c.DataverseName='Metadata'
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_node.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_node.aql
new file mode 100644
index 0000000..2d28ed6
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_node.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;    
+
+write output to nc1:"rttest/basic_metadata_node.adm";
+
+for $c in dataset('Node')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup.aql b/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup.aql
new file mode 100644
index 0000000..86615e6
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/basic/metadata_nodegroup.aql
@@ -0,0 +1,6 @@
+use dataverse Metadata;
+
+write output to nc1:"rttest/basic_metadata_nodegroup.adm";
+     
+for $c in dataset('Nodegroup')
+return $c
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_dataset.aql b/asterix-app/src/test/resources/metadata/queries/custord_dataset.aql
deleted file mode 100644
index 530c6c9..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_dataset.aql
+++ /dev/null
@@ -1,10 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_dataset.adm";
-
-for $c in dataset('Dataset')
-where $c.DataverseName = "custord"
-return $c
-
-
-
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_datatype.aql b/asterix-app/src/test/resources/metadata/queries/custord_datatype.aql
deleted file mode 100644
index 1525b93..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_datatype.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_datatype.adm";
-     
-for $c in dataset('Datatype')
-where $c.DataverseName = "custord"
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_dataverse.aql b/asterix-app/src/test/resources/metadata/queries/custord_dataverse.aql
deleted file mode 100644
index 277bf62..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_dataverse.aql
+++ /dev/null
@@ -1,8 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_dataverse.adm";
-
-for $c in dataset('Dataverse')
-where $c.DataverseName = "custord"
-return $c
-
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_index.aql b/asterix-app/src/test/resources/metadata/queries/custord_index.aql
deleted file mode 100644
index 95450da..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_index.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_index.adm";
-
-for $c in dataset('Index')
-where $c.DataverseName = "custord"
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_nodegroup.aql b/asterix-app/src/test/resources/metadata/queries/custord_nodegroup.aql
deleted file mode 100644
index 090c739..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_nodegroup.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_nodegroup.adm";
-     
-for $c in dataset('Nodegroup')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q1.aql b/asterix-app/src/test/resources/metadata/queries/custord_q1.aql
deleted file mode 100644
index 4ba02b9..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q1.aql
+++ /dev/null
@@ -1,65 +0,0 @@
-drop dataverse custord if exists;
-
-create dataverse custord;
-
-use dataverse custord;
-
-create type StreetType as closed {
-  number: int32?,
-  name: string
-}
-
-create type AddressType as open {
-  street: StreetType,
-  city: string,
-  state: string,
-  zip: int16
-}
-
-create type CustomerType as closed {
-  cid: int32, 
-  name: string,
-  age: int32?,
-  address: AddressType?,
-  interests: {{string}},
-  children: [ {
-             name : string,
-             dob : string
-             } ]
-}
-
-create type OrderType as open {
-  oid: int32,
-  cid: int32,
-  orderstatus: string,
-  orderpriority: string,
-  clerk: string,
-  total: float,
-  items: [ {
-       number: int64,
-       storeIds: {{int8}} 
-       } ]
-}
-
-create nodegroup group1  if not exists on nc1, nc2;
-
-create dataset Customers(CustomerType)
-  partitioned by key cid, name on group1;
-
-load dataset Customers 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/metadata/customerData.json"),("format"="adm"));
-        
-create dataset Orders(OrderType)
-  partitioned by key oid on group1;
-
-load dataset Orders 
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/metadata/orderData.json"),("format"="adm"));
-
-create index ordCustId if not exists on Orders(cid);
-
-create index custName if not exists on Customers(name, cid);
-
-create index ordClerkTotal if not exists on Orders(clerk, total);
-  
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q10.aql b/asterix-app/src/test/resources/metadata/queries/custord_q10.aql
deleted file mode 100644
index abe6041..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q10.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/custord_q10.adm";
-
-for $c in dataset('Dataset')
-return $c
-
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q2.aql b/asterix-app/src/test/resources/metadata/queries/custord_q2.aql
deleted file mode 100644
index 291ca64..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q2.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-use dataverse custord;
-     
-write output to nc1:"rttest/custord_q2.adm";
-      
-for $c in dataset('Customers')
-order by $c.cid
-return $c.address
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q3.aql b/asterix-app/src/test/resources/metadata/queries/custord_q3.aql
deleted file mode 100644
index c093baa..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q3.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse custord;
-
-write output to nc1:"rttest/custord_q3.adm";
-      
-for $o in dataset('Orders')
-return {"id" : $o.oid, "total": $o.total} 
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q4.aql b/asterix-app/src/test/resources/metadata/queries/custord_q4.aql
deleted file mode 100644
index 9bdf494..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q4.aql
+++ /dev/null
@@ -1,9 +0,0 @@
-use dataverse custord;
-
-write output to nc1:"rttest/custord_q4.adm";
-
-for $c in dataset('Customers')
-for $o in dataset('Orders')
-where $c.cid = $o.cid 
-order by $c.cid
-return {"cust_name":$c.name, "cust_age": $c.age, "order_total":$o.total} 
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q5.aql b/asterix-app/src/test/resources/metadata/queries/custord_q5.aql
deleted file mode 100644
index 716cce7..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q5.aql
+++ /dev/null
@@ -1,21 +0,0 @@
-drop nodegroup fuzzynodegroup if exists;
-
-drop dataverse fuzzyjoin if exists;
-
-use dataverse custord;
-
-create dataset Customers if not exists (CustomerType)
-  partitioned by key cid, name on group1;
-  
-drop dataset employees if exists;
-
-create index custName if not exists on Customers(name, cid);
-
-drop index Customers.custAddress if exists;
-
-create type StreetType if not exists as closed {
-  number: int32?,
-  name: string
-}
-
-drop type DBLPType if exists;
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q6.aql b/asterix-app/src/test/resources/metadata/queries/custord_q6.aql
deleted file mode 100644
index 231c410..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q6.aql
+++ /dev/null
@@ -1,7 +0,0 @@
-use dataverse custord;
-
-drop index Orders.ordClerkTotal;
-
-drop dataset Orders;
-
-drop type OrderType;
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q7.aql b/asterix-app/src/test/resources/metadata/queries/custord_q7.aql
deleted file mode 100644
index 247ed78..0000000
--- a/asterix-app/src/test/resources/metadata/queries/custord_q7.aql
+++ /dev/null
@@ -1,2 +0,0 @@
-drop dataverse custord;
- 
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset.aql
new file mode 100644
index 0000000..4cce09a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataset.aql
@@ -0,0 +1 @@
+drop dataset DBLP;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse.aql
new file mode 100644
index 0000000..b92618e
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_dataverse.aql
@@ -0,0 +1 @@
+drop dataverse fuzzyjoin;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
new file mode 100644
index 0000000..386a71d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_index.aql
@@ -0,0 +1 @@
+drop index Cust.ord;
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q8.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup.aql
similarity index 95%
rename from asterix-app/src/test/resources/metadata/queries/custord_q8.aql
rename to asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup.aql
index bb4225d..664f52f 100644
--- a/asterix-app/src/test/resources/metadata/queries/custord_q8.aql
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_nodegroup.aql
@@ -1,2 +1 @@
 drop nodegroup group1;
- 
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1.aql
new file mode 100644
index 0000000..4c6c7ae
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type1.aql
@@ -0,0 +1 @@
+drop type AddressType;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2.aql
new file mode 100644
index 0000000..b97b812
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type2.aql
@@ -0,0 +1 @@
+drop type CustomerType;
diff --git a/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3.aql b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3.aql
new file mode 100644
index 0000000..3812745
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/exception/exception_drop_type3.aql
@@ -0,0 +1 @@
+drop type StreetType;
diff --git a/asterix-app/src/test/resources/metadata/queries/exceptions.aql b/asterix-app/src/test/resources/metadata/queries/exceptions.aql
deleted file mode 100644
index b6ec188..0000000
--- a/asterix-app/src/test/resources/metadata/queries/exceptions.aql
+++ /dev/null
@@ -1,21 +0,0 @@
-// Each statement (except for the second "use" statement) should throw an exception.
-
-//drop nodegroup group1;
-
-//drop dataverse fuzzyjoin;
-
-//use dataverse fuzzy;
-
-//use dataverse custord;
-
-//drop index Cust.ord;
-
-//drop index Customers.ord;
-
-//drop type AddressType;
-
-//drop type CustomerType;
-
-//drop type StreetType;
-
-//drop dataset DBLP;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_dataset.aql b/asterix-app/src/test/resources/metadata/queries/metadata_dataset.aql
deleted file mode 100644
index 723e65c..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_dataset.aql
+++ /dev/null
@@ -1,9 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_dataset.adm";
-
-for $c in dataset('Dataset')
-return $c
-
-
-
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_datatype.aql b/asterix-app/src/test/resources/metadata/queries/metadata_datatype.aql
deleted file mode 100644
index a144f4f..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_datatype.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_datatype.adm";
-     
-for $c in dataset('Datatype')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_dataverse.aql b/asterix-app/src/test/resources/metadata/queries/metadata_dataverse.aql
deleted file mode 100644
index e7e1249..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_dataverse.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_dataverse.adm";
-
-for $c in dataset('Dataverse')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_node.aql b/asterix-app/src/test/resources/metadata/queries/metadata_node.aql
deleted file mode 100644
index ce28ac8..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_node.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;    
-
-write output to nc1:"rttest/metadata_node.adm";
-
-for $c in dataset('Node')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/metadata_nodegroup.aql b/asterix-app/src/test/resources/metadata/queries/metadata_nodegroup.aql
deleted file mode 100644
index 090c739..0000000
--- a/asterix-app/src/test/resources/metadata/queries/metadata_nodegroup.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse Metadata;
-
-write output to nc1:"rttest/metadata_nodegroup.adm";
-     
-for $c in dataset('Nodegroup')
-return $c
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/regress_01_create_type.aql b/asterix-app/src/test/resources/metadata/queries/regress_01_create_type.aql
deleted file mode 100644
index e978572..0000000
--- a/asterix-app/src/test/resources/metadata/queries/regress_01_create_type.aql
+++ /dev/null
@@ -1,12 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create nodegroup group1 if not exists on nc1, nc2;
-
-// Create a type in test dataverse.
-// This type will be referred to in a subsequent script.
-create type TestType as closed {
-  id: int32,
-  name: string
-}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/regress_02_refer_existing_type.aql b/asterix-app/src/test/resources/metadata/queries/regress_02_refer_existing_type.aql
deleted file mode 100644
index aeed866..0000000
--- a/asterix-app/src/test/resources/metadata/queries/regress_02_refer_existing_type.aql
+++ /dev/null
@@ -1,6 +0,0 @@
-use dataverse test;
-
-// Refer to existing type in test dataverse.
-create type UseTestType as closed {
-  test: TestType
-}
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/regress_03_repeated_create_drop.aql b/asterix-app/src/test/resources/metadata/queries/regress_03_repeated_create_drop.aql
deleted file mode 100644
index 02009da..0000000
--- a/asterix-app/src/test/resources/metadata/queries/regress_03_repeated_create_drop.aql
+++ /dev/null
@@ -1,34 +0,0 @@
-drop dataverse test if exists;
-create dataverse test;
-use dataverse test;
-
-create type TypeOne as open {
-  f: int32
-}
-create nodegroup group1 if not exists on nc1, nc2;
-create dataset typeonedataset(TypeOne)
-partitioned by key f on group1;
-
-
-drop dataverse test if exists;  
-create dataverse test;
-use dataverse test;
-
-create type TypeTwo as open {
-  f: int32
-}
-create nodegroup group1 if not exists on nc1, nc2;
-create dataset typetwodataset(TypeTwo)
-partitioned by key f on group1;
-
-
-drop dataverse test if exists;  
-create dataverse test;
-use dataverse test;
-
-create type TypeThree as open {
-  f: int32
-}
-create nodegroup group1 if not exists on nc1, nc2;
-create dataset typethreedataset(TypeThree)
-partitioned by key f on group1;
\ No newline at end of file
diff --git a/asterix-app/src/test/resources/metadata/queries/custord_q9.aql b/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql
similarity index 65%
rename from asterix-app/src/test/resources/metadata/queries/custord_q9.aql
rename to asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql
index 2d3f960..5250eef 100644
--- a/asterix-app/src/test/resources/metadata/queries/custord_q9.aql
+++ b/asterix-app/src/test/resources/metadata/queries/transaction/failure_previous_success.aql
@@ -1,3 +1,9 @@
+/*
+ * Description  : Cause a failure by creating an existing type. Verify that rollback does not affect the pre-existing types.
+ *                Verification is done in a separate session (compilation unit).
+ * Expected Res : Success
+ * Date         : 24 Nov 2012
+ */
 drop dataverse custord if exists;
 
 create dataverse custord;
@@ -41,12 +47,8 @@
        } ]
 }
 
-create external dataset Customers(CustomerType)
-using "edu.uci.ics.asterix.external.dataset.adapter.HDFSAdapter"
-      (("hdfs"="hdfs://temp1/data1"),("n1"="v1"),("n2"="v2"), ("n3"="v3"));
-  
-create external dataset Orders(OrderType)
-using "edu.uci.ics.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1:///tmp1/data1,nc2:///tmp2/data2"));
 
-
+create type StreetType as closed {
+  number: int32?,
+  name: string
+}
diff --git a/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql b/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql
new file mode 100644
index 0000000..d4678f2
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/transaction/failure_subsequent_no_execution.aql
@@ -0,0 +1,47 @@
+/*
+ * Description  : Create dataverse, types, nodegroup and a dataset. Cause exception by re-creating nodegroup. 
+ *                Subsequent statement(s) should not executed. This is verified in a separate session (compilation unit)
+ * Expected Res : Exception
+ * Date         : 24 Nov 2012
+ */
+drop dataverse custord if exists;
+
+create dataverse custord;
+
+use dataverse custord;
+
+create type StreetType as closed {
+  number: int32?,
+  name: string
+}
+
+create type AddressType as open {
+  street: StreetType,
+  city: string,
+  state: string,
+  zip: int16
+}
+
+create type CustomerType as closed {
+  cid: int32, 
+  name: string,
+  age: int32?,
+  address: AddressType?,
+  interests: {{string}},
+  children: [ {
+             name : string,
+             dob : string
+             } ]
+}
+
+create nodegroup group1 if not exists on nc1, nc2;
+
+create dataset Customers(CustomerType)
+  partitioned by key cid, name on group1;
+
+create nodegroup group1 on nc1, nc2;
+
+// the following statement should not get executed 
+// as the above statement causes an exception
+create index custName on Customers(name, cid);
+  
diff --git a/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.aql b/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.aql
new file mode 100644
index 0000000..351a9e4
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_previous_success.aql
@@ -0,0 +1,12 @@
+/*
+ * Description  : Verify the state of the Metadata adter the failure caused in failure_previous_success.aql 
+ * Expected Res : Success
+ * Date         : 24 Nov 2012
+ */
+use dataverse custord;
+
+write output to nc1:"mdtest/transaction_verify_failure_previous_success.adm";
+
+for $x in dataset('Metadata.Datatype')
+where $x.DataverseName='custord'
+return $x
diff --git a/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.aql b/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.aql
new file mode 100644
index 0000000..6505903
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/queries/transaction/verify_failure_subsequent_no_execution.aql
@@ -0,0 +1,13 @@
+/*
+ * Description  : Verify the state of the metadata after the failure caused by failure_subsequent_no_execution.aql
+ * Expected Res : Success
+ * Date         : 24 Nov 2012
+ */
+
+use dataverse custord;
+
+write output to nc1:"mdtest/transaction_verify_failure_subsequent_no_execution.adm";
+
+for $x in dataset('Metadata.Index')
+where $x.DataverseName='custord'
+return $x
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta01.adm b/asterix-app/src/test/resources/metadata/results/basic/meta01.adm
new file mode 100644
index 0000000..e878a54
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta01.adm
@@ -0,0 +1,2 @@
+{ "DataverseName": "Metadata", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Sat Nov 24 14:44:45 PST 2012" }
+{ "DataverseName": "testdv", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Sat Nov 24 14:45:14 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/meta02.adm b/asterix-app/src/test/resources/metadata/results/basic/meta02.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/meta02.adm
rename to asterix-app/src/test/resources/metadata/results/basic/meta02.adm
diff --git a/asterix-app/src/test/resources/metadata/results/meta03.adm b/asterix-app/src/test/resources/metadata/results/basic/meta03.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/meta03.adm
rename to asterix-app/src/test/resources/metadata/results/basic/meta03.adm
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta04.adm b/asterix-app/src/test/resources/metadata/results/basic/meta04.adm
new file mode 100644
index 0000000..8f892be
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta04.adm
@@ -0,0 +1 @@
+{ "DataverseName": "testdv", "DatatypeName": "testtype", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "id", "FieldType": "int32" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 14:27:13 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/meta05.adm b/asterix-app/src/test/resources/metadata/results/basic/meta05.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/meta05.adm
rename to asterix-app/src/test/resources/metadata/results/basic/meta05.adm
diff --git a/asterix-app/src/test/resources/metadata/results/meta06.adm b/asterix-app/src/test/resources/metadata/results/basic/meta06.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/meta06.adm
rename to asterix-app/src/test/resources/metadata/results/basic/meta06.adm
diff --git a/asterix-app/src/test/resources/metadata/results/meta07.adm b/asterix-app/src/test/resources/metadata/results/basic/meta07.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/meta07.adm
rename to asterix-app/src/test/resources/metadata/results/basic/meta07.adm
diff --git a/asterix-app/src/test/resources/metadata/results/meta08.adm b/asterix-app/src/test/resources/metadata/results/basic/meta08.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/meta08.adm
rename to asterix-app/src/test/resources/metadata/results/basic/meta08.adm
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta09.adm b/asterix-app/src/test/resources/metadata/results/basic/meta09.adm
new file mode 100644
index 0000000..b85737d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta09.adm
@@ -0,0 +1 @@
+{ "DataverseName": "test", "DatasetName": "t1", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Sat Nov 24 14:28:44 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta10.adm b/asterix-app/src/test/resources/metadata/results/basic/meta10.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta10.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta11.adm b/asterix-app/src/test/resources/metadata/results/basic/meta11.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta11.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/metadata/results/meta12.adm b/asterix-app/src/test/resources/metadata/results/basic/meta12.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/meta12.adm
rename to asterix-app/src/test/resources/metadata/results/basic/meta12.adm
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta13.adm b/asterix-app/src/test/resources/metadata/results/basic/meta13.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta13.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta14.adm b/asterix-app/src/test/resources/metadata/results/basic/meta14.adm
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta14.adm
@@ -0,0 +1 @@
+0
diff --git a/asterix-app/src/test/resources/metadata/results/basic/meta15.adm b/asterix-app/src/test/resources/metadata/results/basic/meta15.adm
new file mode 100644
index 0000000..4414ed0
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/basic/meta15.adm
@@ -0,0 +1,6 @@
+{ "DataverseName": "Metadata", "Name": "cnn_feed", "Classname": "edu.uci.ics.asterix.external.adapter.factory.CNNFeedAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "hdfs", "Classname": "edu.uci.ics.asterix.external.adapter.factory.HDFSAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "hive", "Classname": "edu.uci.ics.asterix.external.adapter.factory.HiveAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "localfs", "Classname": "edu.uci.ics.asterix.external.adapter.factory.NCFileSystemAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "pull_twitter", "Classname": "edu.uci.ics.asterix.external.adapter.factory.PullBasedTwitterAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
+{ "DataverseName": "Metadata", "Name": "rss_feed", "Classname": "edu.uci.ics.asterix.external.adapter.factory.RSSFeedAdapterFactory", "Type": "INTERNAL", "Timestamp": "Sun Nov 25 20:55:22 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_dataset.adm b/asterix-app/src/test/resources/metadata/results/basic/meta16.adm
similarity index 100%
copy from asterix-app/src/test/resources/metadata/results/metadata_dataset.adm
copy to asterix-app/src/test/resources/metadata/results/basic/meta16.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_datatype.adm b/asterix-app/src/test/resources/metadata/results/basic/meta17.adm
similarity index 100%
copy from asterix-app/src/test/resources/metadata/results/metadata_datatype.adm
copy to asterix-app/src/test/resources/metadata/results/basic/meta17.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_dataverse.adm b/asterix-app/src/test/resources/metadata/results/basic/meta18.adm
similarity index 100%
copy from asterix-app/src/test/resources/metadata/results/metadata_dataverse.adm
copy to asterix-app/src/test/resources/metadata/results/basic/meta18.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_index.adm b/asterix-app/src/test/resources/metadata/results/basic/meta19.adm
similarity index 100%
copy from asterix-app/src/test/resources/metadata/results/metadata_index.adm
copy to asterix-app/src/test/resources/metadata/results/basic/meta19.adm
diff --git a/asterix-app/src/test/resources/metadata/results/meta07.adm b/asterix-app/src/test/resources/metadata/results/basic/meta20.adm
similarity index 100%
copy from asterix-app/src/test/resources/metadata/results/meta07.adm
copy to asterix-app/src/test/resources/metadata/results/basic/meta20.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_nodegroup.adm b/asterix-app/src/test/resources/metadata/results/basic/meta21.adm
similarity index 100%
copy from asterix-app/src/test/resources/metadata/results/metadata_nodegroup.adm
copy to asterix-app/src/test/resources/metadata/results/basic/meta21.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_dataset.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_dataset.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/metadata_dataset.adm
rename to asterix-app/src/test/resources/metadata/results/basic/metadata_dataset.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_datatype.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_datatype.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/metadata_datatype.adm
rename to asterix-app/src/test/resources/metadata/results/basic/metadata_datatype.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_dataverse.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_dataverse.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/metadata_dataverse.adm
rename to asterix-app/src/test/resources/metadata/results/basic/metadata_dataverse.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_index.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_index.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/metadata_index.adm
rename to asterix-app/src/test/resources/metadata/results/basic/metadata_index.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_node.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_node.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/metadata_node.adm
rename to asterix-app/src/test/resources/metadata/results/basic/metadata_node.adm
diff --git a/asterix-app/src/test/resources/metadata/results/metadata_nodegroup.adm b/asterix-app/src/test/resources/metadata/results/basic/metadata_nodegroup.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/metadata_nodegroup.adm
rename to asterix-app/src/test/resources/metadata/results/basic/metadata_nodegroup.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_dataset.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_dataset.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_dataset.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_dataset.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_datatype.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_datatype.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_datatype.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_datatype.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_dataverse.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_dataverse.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_dataverse.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_dataverse.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_index.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_index.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_index.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_index.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_nodegroup.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_nodegroup.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_nodegroup.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_nodegroup.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_q10.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_q10.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_q10.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_q10.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_q2.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_q2.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_q2.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_q2.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_q3.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_q3.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_q3.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_q3.adm
diff --git a/asterix-app/src/test/resources/metadata/results/custord_q4.adm b/asterix-app/src/test/resources/metadata/results/custord/custord_q4.adm
similarity index 100%
rename from asterix-app/src/test/resources/metadata/results/custord_q4.adm
rename to asterix-app/src/test/resources/metadata/results/custord/custord_q4.adm
diff --git a/asterix-app/src/test/resources/metadata/results/meta01.adm b/asterix-app/src/test/resources/metadata/results/meta01.adm
deleted file mode 100644
index 90ef844..0000000
--- a/asterix-app/src/test/resources/metadata/results/meta01.adm
+++ /dev/null
@@ -1,2 +0,0 @@
-taverseName": "Metadata", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Sat Sep 15 14:30:48 PDT 2012" }
-{ "DataverseName": "testdv", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Sat Sep 15 14:31:34 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/meta04.adm b/asterix-app/src/test/resources/metadata/results/meta04.adm
deleted file mode 100644
index 7ad95e2..0000000
--- a/asterix-app/src/test/resources/metadata/results/meta04.adm
+++ /dev/null
@@ -1 +0,0 @@
-{ "DataverseName": "testdv", "DatatypeName": "testtype", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "id", "FieldType": "int32" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Sep 15 14:56:51 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/meta09.adm b/asterix-app/src/test/resources/metadata/results/meta09.adm
deleted file mode 100644
index bddffc2..0000000
--- a/asterix-app/src/test/resources/metadata/results/meta09.adm
+++ /dev/null
@@ -1 +0,0 @@
-taverseName": "test", "DatasetName": "t1", "DataTypeName": "testtype", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "id" ], "PrimaryKey": [ "id" ], "GroupName": "DEFAULT_NG_ALL_NODES" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Sep 17 12:47:50 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/meta10.adm b/asterix-app/src/test/resources/metadata/results/meta10.adm
deleted file mode 100644
index 7dce05f..0000000
--- a/asterix-app/src/test/resources/metadata/results/meta10.adm
+++ /dev/null
@@ -1 +0,0 @@
-{ "DataverseName": "Metadata", "DataFormat": "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat", "Timestamp": "Mon Sep 17 12:46:38 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/meta11.adm b/asterix-app/src/test/resources/metadata/results/meta11.adm
deleted file mode 100644
index ed8670f..0000000
--- a/asterix-app/src/test/resources/metadata/results/meta11.adm
+++ /dev/null
@@ -1,8 +0,0 @@
-{ "DataverseName": "Metadata", "DatasetName": "Adapter", "DataTypeName": "AdapterRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name" ], "PrimaryKey": [ "DataverseName", "Name" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Sep 17 13:09:22 PDT 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Dataset", "DataTypeName": "DatasetRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName" ], "PrimaryKey": [ "DataverseName", "DatasetName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Sep 17 13:09:22 PDT 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Datatype", "DataTypeName": "DatatypeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatatypeName" ], "PrimaryKey": [ "DataverseName", "DatatypeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Sep 17 13:09:22 PDT 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Dataverse", "DataTypeName": "DataverseRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName" ], "PrimaryKey": [ "DataverseName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Sep 17 13:09:22 PDT 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Function", "DataTypeName": "FunctionRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "Name", "Arity" ], "PrimaryKey": [ "DataverseName", "Name", "Arity" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Sep 17 13:09:22 PDT 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Index", "DataTypeName": "IndexRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "DataverseName", "DatasetName", "IndexName" ], "PrimaryKey": [ "DataverseName", "DatasetName", "IndexName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Sep 17 13:09:22 PDT 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Node", "DataTypeName": "NodeRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "NodeName" ], "PrimaryKey": [ "NodeName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Sep 17 13:09:22 PDT 2012" }
-{ "DataverseName": "Metadata", "DatasetName": "Nodegroup", "DataTypeName": "NodeGroupRecordType", "DatasetType": "INTERNAL", "InternalDetails": { "FileStructure": "BTREE", "PartitioningStrategy": "HASH", "PartitioningKey": [ "GroupName" ], "PrimaryKey": [ "GroupName" ], "GroupName": "MetadataGroup" }, "ExternalDetails": null, "FeedDetails": null, "Timestamp": "Mon Sep 17 13:09:22 PDT 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_previous_success.adm b/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_previous_success.adm
new file mode 100644
index 0000000..3d0da4d
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_previous_success.adm
@@ -0,0 +1,13 @@
+{ "DataverseName": "custord", "DatatypeName": "AddressType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "street", "FieldType": "StreetType" }, { "FieldName": "city", "FieldType": "string" }, { "FieldName": "state", "FieldType": "string" }, { "FieldName": "zip", "FieldType": "int16" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "CustomerType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "name", "FieldType": "string" }, { "FieldName": "age", "FieldType": "Field_age_in_CustomerType" }, { "FieldName": "address", "FieldType": "Field_address_in_CustomerType" }, { "FieldName": "interests", "FieldType": "Field_interests_in_CustomerType" }, { "FieldName": "children", "FieldType": "Field_children_in_CustomerType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_address_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "AddressType" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_age_in_CustomerType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_children_in_CustomerType_ItemType" }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_children_in_CustomerType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "name", "FieldType": "string" }, { "FieldName": "dob", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_interests_in_CustomerType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "string", "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType", "Derived": { "Tag": "ORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": null, "OrderedList": "Field_items_in_OrderType_ItemType" }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_items_in_OrderType_ItemType", "Derived": { "Tag": "RECORD", "IsAnonymous": true, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "number", "FieldType": "int64" }, { "FieldName": "storeIds", "FieldType": "Field_storeIds_in_Field_items_in_OrderType_ItemType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_number_in_StreetType", "Derived": { "Tag": "UNION", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": [ "null", "int32" ], "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "Field_storeIds_in_Field_items_in_OrderType_ItemType", "Derived": { "Tag": "UNORDEREDLIST", "IsAnonymous": true, "EnumValues": null, "Record": null, "Union": null, "UnorderedList": "int8", "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "OrderType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": true, "Fields": [ { "FieldName": "oid", "FieldType": "int32" }, { "FieldName": "cid", "FieldType": "int32" }, { "FieldName": "orderstatus", "FieldType": "string" }, { "FieldName": "orderpriority", "FieldType": "string" }, { "FieldName": "clerk", "FieldType": "string" }, { "FieldName": "total", "FieldType": "float" }, { "FieldName": "items", "FieldType": "Field_items_in_OrderType" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
+{ "DataverseName": "custord", "DatatypeName": "StreetType", "Derived": { "Tag": "RECORD", "IsAnonymous": false, "EnumValues": null, "Record": { "IsOpen": false, "Fields": [ { "FieldName": "number", "FieldType": "Field_number_in_StreetType" }, { "FieldName": "name", "FieldType": "string" } ] }, "Union": null, "UnorderedList": null, "OrderedList": null }, "Timestamp": "Sat Nov 24 17:20:04 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_subsequent_no_execution.adm b/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_subsequent_no_execution.adm
new file mode 100644
index 0000000..7ba26bd
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/results/transaction/verify_failure_subsequent_no_execution.adm
@@ -0,0 +1 @@
+{ "DataverseName": "custord", "DatasetName": "Customers", "IndexName": "Customers", "IndexStructure": "BTREE", "SearchKey": [ "cid", "name" ], "IsPrimary": true, "Timestamp": "Sat Nov 24 17:23:18 PST 2012" }
diff --git a/asterix-app/src/test/resources/metadata/testsuite.xml b/asterix-app/src/test/resources/metadata/testsuite.xml
new file mode 100644
index 0000000..78dc3b5
--- /dev/null
+++ b/asterix-app/src/test/resources/metadata/testsuite.xml
@@ -0,0 +1,173 @@
+<test-suite xmlns="urn:xml.testframework.asterix.ics.uci.edu" ResultOffsetPath="results" QueryOffsetPath="queries" QueryFileExtension=".aql">
+  <test-group name="basic">
+    <test-case FilePath="basic">
+      <compilation-unit name="meta01">
+        <output-file compare="Text">meta01.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta02">
+        <output-file compare="Text">meta02.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta03">
+        <output-file compare="Text">meta03.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta04">
+        <output-file compare="Text">meta04.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta05">
+        <output-file compare="Text">meta05.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta06">
+        <output-file compare="Text">meta06.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta07">
+        <output-file compare="Text">meta07.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta08">
+        <output-file compare="Text">meta08.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta09">
+        <output-file compare="Text">meta09.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta10">
+        <output-file compare="Text">meta10.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta11">
+        <output-file compare="Text">meta11.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta12">
+        <output-file compare="Text">meta12.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta13">
+        <output-file compare="Text">meta13.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta14">
+        <output-file compare="Text">meta14.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta15">
+        <output-file compare="Text">meta15.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta16">
+        <output-file compare="Text">meta16.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta17">
+        <output-file compare="Text">meta17.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta18">
+        <output-file compare="Text">meta18.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta19">
+        <output-file compare="Text">meta19.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta20">
+        <output-file compare="Text">meta20.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="basic">
+      <compilation-unit name="meta21">
+        <output-file compare="Text">meta21.adm</output-file>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="exception">
+    <test-case FilePath="exception">
+      <compilation-unit name="exception_drop_dataset"> 
+        <expected-error>MetadataException</expected-error>
+        <output-file compare="Text">none.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="exception">
+      <compilation-unit name="exception_drop_dataverse"> 
+        <expected-error>MetadataException</expected-error>
+        <output-file compare="Text">none.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="exception">
+      <compilation-unit name="exception_drop_index"> 
+        <expected-error>MetadataException</expected-error>
+        <output-file compare="Text">none.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="exception">
+      <compilation-unit name="exception_drop_nodegroup"> 
+        <expected-error>MetadataException</expected-error>
+        <output-file compare="Text">none.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="exception">
+      <compilation-unit name="exception_drop_type1"> 
+        <expected-error>MetadataException</expected-error>
+        <output-file compare="Text">none.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="exception">
+      <compilation-unit name="exception_drop_type2"> 
+        <expected-error>MetadataException</expected-error>
+        <output-file compare="Text">none.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="exception">
+      <compilation-unit name="exception_drop_type3"> 
+        <output-file compare="Text">none.adm</output-file>
+        <expected-error>MetadataException</expected-error>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+  <test-group name="transaction">
+    <test-case FilePath="transaction">
+      <compilation-unit name="failure_previous_success">
+        <output-file compare="Text">failure_previous_success.adm</output-file>
+        <expected-error>MetadataException</expected-error>
+      </compilation-unit>
+      <compilation-unit name="verify_failure_previous_success">
+        <output-file compare="Text">verify_failure_previous_success.adm</output-file>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="transaction">
+      <compilation-unit name="failure_subsequent_no_execution">
+        <output-file compare="Text">failure_subsequent_no_execution.adm</output-file>
+        <expected-error>MetadataException</expected-error>
+      </compilation-unit>
+      <compilation-unit name="verify_failure_subsequent_no_execution">
+        <output-file compare="Text">verify_failure_subsequent_no_execution.adm</output-file>
+      </compilation-unit>
+    </test-case>
+  </test-group>
+</test-suite>