use 'query' case to compare query results with expected results
diff --git a/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java b/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
index 92bd1fc..3d51be1 100644
--- a/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
+++ b/asterix-common/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
@@ -432,8 +432,12 @@
+ cUnit.getName() + "_qar.adm");
qarFile.getParentFile().mkdirs();
TestsUtils.writeResultsToFile(qarFile, resultStream);
+
+
TestsUtils.runScriptAndCompareWithResult(testFile, new PrintWriter(System.err),
qbcFile, qarFile);
+
+
LOGGER.info("[TEST]: " + testCaseCtx.getTestCase().getFilePath() + "/"
+ cUnit.getName() + " PASSED ");
} catch (JsonMappingException e) {
@@ -468,22 +472,7 @@
// expected error happens
}
break;
-
- case "equalassert" :
- /* assert the query outcome and expected result
- * the last line in aql is the respected result. and the lines before it is the query.
- * an Exception will be thrown if query result is different from expected result.
- */
-
- InputStream resultStream = executeQuery(getQueryStatement(statement));
- StringWriter writer = new StringWriter();
- IOUtils.copy(resultStream, writer);
-
- if (!writer.toString().contains(getExpectedResult(statement))) {
- throw new Exception("Test \"" + testFile + "\" FAILED!\n");
- }
- break;
-
+
default:
throw new IllegalArgumentException("No statements of type " + ctx.getType());
}
@@ -497,12 +486,4 @@
}
}
- private static String getQueryStatement(String statement) {
- return statement.substring(0, statement.lastIndexOf(";") + 1).trim();
- }
-
- private static String getExpectedResult(String statement) {
- return statement.substring(statement.lastIndexOf(";") + 1).trim();
-
- }
}
diff --git a/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/delete_after_recovery/delete_after_recovery.7.equalassert.aql b/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/delete_after_recovery/delete_after_recovery.7.equalassert.aql
deleted file mode 100644
index 585a83f..0000000
--- a/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/delete_after_recovery/delete_after_recovery.7.equalassert.aql
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Test case Name : primary_index_only.aql
- * Description : Check that abort from duplicate key exception works and crash recovery works after the abort.
- * Expected Result : Success
- * Date : September 25 2013
- */
-
-use dataverse recovery;
-
-count (for $x in dataset Fragile_raw return $x);
-129088
diff --git a/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/function_recovery/function_recovery.5.equalassert.aql b/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/function_recovery/function_recovery.5.equalassert.aql
deleted file mode 100644
index 1e9296d..0000000
--- a/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/function_recovery/function_recovery.5.equalassert.aql
+++ /dev/null
@@ -1,12 +0,0 @@
-/*
- * Test case Name : primary_index_only.aql
- * Description : Check that abort from duplicate key exception works and crash recovery works after the abort.
- * Expected Result : Success
- * Date : September 25 2013
- */
-
-use dataverse recovery;
-let $a := 1
-let $b := 2
-return add($a, $b);
-3
diff --git a/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/insert_after_recovery/insert_after_recovery.7.equalassert.aql b/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/insert_after_recovery/insert_after_recovery.7.equalassert.aql
deleted file mode 100644
index c9e1009..0000000
--- a/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/insert_after_recovery/insert_after_recovery.7.equalassert.aql
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Test case Name : primary_index_only.aql
- * Description : Check that abort from duplicate key exception works and crash recovery works after the abort.
- * Expected Result : Success
- * Date : September 25 2013
- */
-
-use dataverse recovery;
-
-count (for $x in dataset Fragile return $x);
-258176
diff --git a/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/load_after_recovery/load_after_recovery.6.equalassert.aql b/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/load_after_recovery/load_after_recovery.6.equalassert.aql
deleted file mode 100644
index d8e4ba7..0000000
--- a/asterix-installer/src/test/resources/transactionts/queries/recovery_ddl/load_after_recovery/load_after_recovery.6.equalassert.aql
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * Test case Name : primary_index_only.aql
- * Description : Check that abort from duplicate key exception works and crash recovery works after the abort.
- * Expected Result : Success
- * Date : September 25 2013
- */
-
-use dataverse recovery;
-
-count (for $x in dataset Fragile_raw return $x);
-258176
\ No newline at end of file
diff --git a/asterix-installer/src/test/resources/transactionts/testsuite.xml b/asterix-installer/src/test/resources/transactionts/testsuite.xml
index d0406e6..8469729 100644
--- a/asterix-installer/src/test/resources/transactionts/testsuite.xml
+++ b/asterix-installer/src/test/resources/transactionts/testsuite.xml
@@ -15,12 +15,13 @@
<test-suite xmlns="urn:xml.testframework.asterix.ics.uci.edu" ResultOffsetPath="results" QueryOffsetPath="queries" QueryFileExtension=".aql">
<test-group name="recover_after_abort">
+
<test-case FilePath="recover_after_abort">
<compilation-unit name="primary_index_only">
<output-dir compare="Text">primary_index_only</output-dir>
</compilation-unit>
</test-case>
- <!--
+
<test-case FilePath="recover_after_abort">
<compilation-unit name="primary_plus_default_secondary_index">
<output-dir compare="Text">primary_plus_default_secondary_index</output-dir>
@@ -65,27 +66,27 @@
<test-case FilePath="recovery_ddl">
<compilation-unit name="load_after_recovery">
- <output-dir compare="Text">secondary_index_recovery</output-dir>
+ <output-dir compare="Text">load_after_recovery</output-dir>
</compilation-unit>
</test-case>
-
+
<test-case FilePath="recovery_ddl">
<compilation-unit name="insert_after_recovery">
- <output-dir compare="Text">secondary_index_recovery</output-dir>
+ <output-dir compare="Text">insert_after_recovery</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="recovery_ddl">
<compilation-unit name="delete_after_recovery">
- <output-dir compare="Text">secondary_index_recovery</output-dir>
+ <output-dir compare="Text">delete_after_recovery</output-dir>
</compilation-unit>
</test-case>
<test-case FilePath="recovery_ddl">
<compilation-unit name="function_recovery">
- <output-dir compare="Text">secondary_index_recovery</output-dir>
+ <output-dir compare="Text">function_recovery</output-dir>
</compilation-unit>
</test-case>
- -->
+
</test-group>
</test-suite>