Issue 548: Initial implementation of CSV output method.

Can be selected via the HTTP interface by setting the Accept: header to
text/csv.

Displays strings, numerics, booleans, and a couple duration types. Detects
situations that cannot be respresented as CSV (list values, nested records)
and throws an exception.

Introduces "outputRecordType" set option to define a fixed RecordType that
all results will be coerced to, to ensure consistent CSV output.

Added test support for CSV output, with one test case for now.

Change-Id: Ib53da6b3c69e38095bdc684b0e8cd53b9f4b1543
Reviewed-on: http://fulliautomatix.ics.uci.edu:8443/165
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <westmann@gmail.com>
diff --git a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
index b3e4de9e..e2e4cb4 100644
--- a/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
+++ b/asterix-test-framework/src/main/java/edu/uci/ics/asterix/testframework/context/TestCaseContext.java
@@ -34,8 +34,9 @@
      */
     public enum OutputFormat {
         NONE  ("", ""),
-        ADM   ("adm", "application/adm"),
-        JSON  ("json", "application/json");
+        ADM   ("adm", "application/x-adm"),
+        JSON  ("json", "application/json"),
+        CSV   ("csv", "text/csv");
 
         private final String extension;
         private final String mimetype;
@@ -59,6 +60,8 @@
                 return OutputFormat.ADM;
             case JSON:
                 return OutputFormat.JSON;
+            case CSV:
+                return OutputFormat.CSV;
             case INSPECT:
             case IGNORE:
                 return OutputFormat.NONE;
diff --git a/asterix-test-framework/src/main/resources/Catalog.xsd b/asterix-test-framework/src/main/resources/Catalog.xsd
index 78c401e..a33399c 100644
--- a/asterix-test-framework/src/main/resources/Catalog.xsd
+++ b/asterix-test-framework/src/main/resources/Catalog.xsd
@@ -187,6 +187,7 @@
          <xs:enumeration value="Inspect"/>

          <xs:enumeration value="Ignore"/>

          <xs:enumeration value="JSON"/>

+         <xs:enumeration value="CSV"/>

       </xs:restriction>

    </xs:simpleType>