before merge
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 59b34dd..de68bef 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
@@ -487,6 +487,21 @@
}
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());
}
@@ -499,4 +514,13 @@
}
}
}
+
+ 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/testsuite.xml b/asterix-installer/src/test/resources/transactionts/testsuite.xml
index 8e7fd4a..1fcdc1e 100644
--- a/asterix-installer/src/test/resources/transactionts/testsuite.xml
+++ b/asterix-installer/src/test/resources/transactionts/testsuite.xml
@@ -14,7 +14,7 @@
!-->
<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>
@@ -62,7 +62,30 @@
<output-dir compare="Text">secondary_index_recovery</output-dir>
</compilation-unit>
</test-case>
+
+ <test-case FilePath="recovery_ddl">
+ <compilation-unit name="load_after_recovery">
+ <output-dir compare="Text">secondary_index_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>
+ </compilation-unit>
+ </test-case>
+ <test-case FilePath="recovery_ddl">
+ <compilation-unit name="delete_after_recovery">
+ <output-dir compare="Text">secondary_index_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>
+ </compilation-unit>
+ </test-case>
</test-group>
</test-suite>