Murtadha Hubail has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/779

Change subject: Fix Expected Results File For Recovery Test Cases
......................................................................

Fix Expected Results File For Recovery Test Cases

Change-Id: Ic2125ad72e862e2d97605300378ff847524b4aaa
---
M asterix-common/src/test/java/org/apache/asterix/test/aql/TestExecutor.java
1 file changed, 13 insertions(+), 8 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/79/779/1

diff --git 
a/asterix-common/src/test/java/org/apache/asterix/test/aql/TestExecutor.java 
b/asterix-common/src/test/java/org/apache/asterix/test/aql/TestExecutor.java
index 493fde7..e23837b 100644
--- a/asterix-common/src/test/java/org/apache/asterix/test/aql/TestExecutor.java
+++ b/asterix-common/src/test/java/org/apache/asterix/test/aql/TestExecutor.java
@@ -473,8 +473,7 @@
     public void executeTest(TestCaseContext testCaseCtx, TestFileContext ctx, 
String statement,
             boolean isDmlRecoveryTest, ProcessBuilder pb, CompilationUnit 
cUnit, MutableInt queryCount,
             List<TestFileContext> expectedResultFileCtxs, File testFile, 
String actualPath) throws Exception {
-        File qbcFile = null;
-        File qarFile;
+        File qbcFile;
         boolean failed = false;
         File expectedResultFile;
         switch (ctx.getType()) {
@@ -552,20 +551,19 @@
             case "txnqbc": // qbc represents query before crash
                 resultStream = executeQuery(statement, 
OutputFormat.forCompilationUnit(cUnit),
                         "http://"; + host + ":" + port + 
Servlets.AQL_QUERY.getPath(), cUnit.getParameter());
-                qbcFile = new File(actualPath + File.separator
-                        + 
testCaseCtx.getTestCase().getFilePath().replace(File.separator, "_") + "_" + 
cUnit.getName()
-                        + "_qbc.adm");
+                qbcFile = getTestCaseQueryBeforeCrashFile(actualPath, 
testCaseCtx, cUnit);
                 qbcFile.getParentFile().mkdirs();
                 writeOutputToFile(qbcFile, resultStream);
                 break;
             case "txnqar": // qar represents query after recovery
                 resultStream = executeQuery(statement, 
OutputFormat.forCompilationUnit(cUnit),
                         "http://"; + host + ":" + port + 
Servlets.AQL_QUERY.getPath(), cUnit.getParameter());
-                qarFile = new File(actualPath + File.separator
+                File qarFile = new File(actualPath + File.separator
                         + 
testCaseCtx.getTestCase().getFilePath().replace(File.separator, "_") + "_" + 
cUnit.getName()
                         + "_qar.adm");
                 qarFile.getParentFile().mkdirs();
                 writeOutputToFile(qarFile, resultStream);
+                qbcFile = getTestCaseQueryBeforeCrashFile(actualPath, 
testCaseCtx, cUnit);
                 runScriptAndCompareWithResult(testFile, new 
PrintWriter(System.err), qbcFile, qarFile);
                 break;
             case "txneu": // eu represents erroneous update
@@ -652,7 +650,7 @@
                 }
                 break;
             case "server": // (start <test server name> <port>
-                               // [<arg1>][<arg2>][<arg3>]...|stop 
(<port>|all))
+                           // [<arg1>][<arg2>][<arg3>]...|stop (<port>|all))
                 try {
                     lines = statement.trim().split("\n");
                     String[] command = lines[lines.length - 1].trim().split(" 
");
@@ -700,7 +698,7 @@
                 }
                 break;
             case "lib": // expected format <dataverse-name> <library-name>
-                            // <library-directory>
+                        // <library-directory>
                         // TODO: make this case work well with entity names 
containing spaces by
                         // looking for \"
                 lines = statement.split("\n");
@@ -794,4 +792,11 @@
             }
         }
     }
+
+    private static File getTestCaseQueryBeforeCrashFile(String actualPath, 
TestCaseContext testCaseCtx,
+            CompilationUnit cUnit) {
+        return new File(
+                actualPath + File.separator + 
testCaseCtx.getTestCase().getFilePath().replace(File.separator, "_") + "_"
+                        + cUnit.getName() + "_qbc.adm");
+    }
 }

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/779
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2125ad72e862e2d97605300378ff847524b4aaa
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Murtadha Hubail <[email protected]>

Reply via email to