diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 3dbcd27..61a85a2 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -714,7 +714,7 @@ public class TestingList extends Panel { //returns the amount of tests currently in Pending state public int successTestsCount(){ return testsStatusCount(TestStatus.SUCCESS); - } + } //returns the amount of tests currently in "status" state private int testsStatusCount(TestStatus status){ @@ -730,7 +730,13 @@ public class TestingList extends Panel { } return iPendingTestsCount; } - + + private void setToStopped(){ + //No more tests to play. Stop + setButtonToStop(); + logger.log(Level.INFO, "End of tests."); + } + /** * find the test currently in progress * @@ -900,16 +906,9 @@ public class TestingList extends Panel { executeTest(position + 1); } } - } + } + } - - } - - private void setToStopped(){ - //No more tests to play. Stop - setButtonToStop(); - logger.log(Level.INFO, "End of tests."); - } //start all the tests in the rowsToExecute private int executeParallelTestsGroup(int[] rowsToExecute) { @@ -975,8 +974,9 @@ public class TestingList extends Panel { } - - public class RunTest implements Runnable { + //delete this + /* + public class RunTest_old implements Runnable { private String sDeviceName, sTestPath; private HashMap mParameters; @@ -1058,6 +1058,91 @@ public class TestingList extends Panel { } } + */ + + + public class RunTest implements Runnable { + + private String sDeviceName, sTestPath; + private HashMap mParameters; + private HashMap args; + private HashMap hTests; + + public RunTest(String sTestPath, HashMap args) { + System.out.println("A1"); + this.sDeviceName = args.get("device").toString(); + System.out.println("A2"); + this.sTestPath = sTestPath; + System.out.println("A3"); + this.mParameters = (HashMap) args.get("parameters"); + this.args = args; + } + public RunTest(String sTestPath) { + this.sDeviceName = sTestPath; + this.sTestPath = sTestPath; + this.mParameters.put("a", 1); + } + public RunTest(HashMap args) { + System.out.println("A0"); + this.hTests = (HashMap) args; + } + + public void run() { + // code in the other thread, can reference "var" variable + int iLastExecutedTestIndex = -1; + final String sParallelizeBegin = "(run,(str('"; + final String sParallelizeEnd = "'),))"; + try { + System.out.println("A0.1"); + String sParallelizeCommand = "parallelize("; + int i = 0; + int iTotalEntries = hTests.entrySet().size(); + for(Map.Entry hTest : hTests.entrySet()){ + setGlobalsVars(hTest.getValue()); + sTestPath = hTest.getKey().toString(); + sTestPath = sTestPath.replace("\\","\\\\"); + sParallelizeCommand = sParallelizeCommand + "(run,(str('" + sTestPath; + i++; + System.out.println("Parameters passed: " + String.valueOf(hTest.getValue().get("parameters"))); + System.out.println("A"+i); + if (i