From d5625f8b51cd7a59b2ef08b344ea4b86b700f464 Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Mon, 7 Sep 2015 15:01:34 +0200 Subject: [PATCH] Fixed: problem if the last test did not exist (it would have repeated all the tests). --- plugins/TestingList.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 40b65ff..e65721b 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -1415,9 +1415,6 @@ public class TestingList extends Panel { //collect tests to be launched in parallel //the test must be: selected, set as start with previous, pending. //alternatively, the test must be: selected, first of the list. - //if the user pressed Stop, exit from run: - if(!isTestRunAllowed()) - return; //System.out.println(String.valueOf(row) + "\t" + String.valueOf(bSelected) + "\t" + String.valueOf(selectedTestsRows.length) + "\t" + sStartSequence + "\t" + sStatus); if (bSelected && sStatus.equals(TestStatus.PENDING.toString()) @@ -1431,6 +1428,9 @@ public class TestingList extends Panel { break; } } + //if the user pressed Stop, or error, exit from run: + if(!isTestRunAllowed()) + return; if (selectedTestsRows.length > 0) { //at least one test is selected: launch it (or them) System.out.println("\n===================================================\n"); executeParallelTestsGroup(selectedTestsRows); //last execution did not find a test file. Continue with next execution @@ -1522,7 +1522,7 @@ public class TestingList extends Panel { RunTest runTest; String sTestName = "", sDeviceName = "", sTestPath = ""; for (int row : rowsToExecute) { - //System.out.println(String.valueOf(row) + "\t" + sDeviceName + "\t" + sTestName + "\t" + sTestCaseName + "\t" + String.valueOf(rowsToExecute.length)); + //System.out.println(String.valueOf(row) + "\t" + sDeviceName + "\t" + sTestName + "\t" + sTestCaseName + "\t" + String.valueOf(rowsToExecute.length)); try { testArgs = buildMapFromTableRow(row); sTestName = (String) testArgs.get(testArgNames.TEST.toString()); @@ -1533,6 +1533,7 @@ public class TestingList extends Panel { if (!f.exists() || f.isDirectory()) { logger.log(Level.SEVERE, "Cannot find test script: " + sTestPath); showResult(sDeviceName, sTestPath, "Cannot find test script: " + sTestPath, TestStatus.FAILURE.toString()); + hTests = args2; continue; } //if the user pressed Stop, exit from run: @@ -1568,6 +1569,8 @@ public class TestingList extends Panel { int i = 0; int iTotalEntries = hTests.entrySet().size(); HashMap args = new HashMap(); + System.out.println("hTests: "+hTests.entrySet().toString()); + if(hTests.isEmpty()) return iRet; for (Map.Entry hTest : hTests.entrySet()) { sTestPath = hTest.getKey().toString(); sTestPath = sTestPath.replace("\\", "\\\\"); @@ -1585,8 +1588,6 @@ public class TestingList extends Panel { } } //System.out.println(sParallelizeCommand); - if(!isTestRunAllowed()) - return iRet; Object ret = eval(sParallelizeCommand); //System.out.println(ret); String sTestResult, sTestStatus;