From 65c5ffb74b975cbe83d797a2b845b8fb86cb62ea Mon Sep 17 00:00:00 2001 From: boccioli_m Date: Fri, 4 Sep 2015 13:59:06 +0200 Subject: [PATCH] Closedown --- plugins/TestingList.java | 27 ++++++++++++++++++++------- script/tests/config/LabTests | Bin 10771 -> 6158 bytes 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 2c42bc2..25b8fd6 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -4,6 +4,7 @@ // import ch.psi.pshell.core.Controller; +import ch.psi.pshell.scripting.StatementException; import ch.psi.pshell.security.AccessLevel; import ch.psi.pshell.ui.App; import ch.psi.pshell.ui.Panel; @@ -1146,10 +1147,12 @@ public class TestingList extends Panel { */ public int showResult(String deviceName, String testPath, String res, String status) { int rowD = -1; + testPath = testPath.replace("\\\\", "\\"); String sTestName = testPath; //getController().getDataManager().appendLog(str(log)); - getLogger().log(Level.FINE, "Looking for: deviceName: " + deviceName + "; testPath: " + testPath + " in table."); + System.out.println("Looking for: deviceName: " + deviceName + "; testPath: " + testPath + " in table."); + String sStatus; if (status == "true") { sStatus = TestStatus.SUCCESS.toString(); @@ -1257,7 +1260,7 @@ public class TestingList extends Panel { /** * get the first test currently in progress * - * @return properties of the test in progress + * @return properties of the test in progress: {deviceName,testPath} */ public String[] getTestInProgress() { String[] dsTestProperties = {"", ""}; @@ -1277,6 +1280,14 @@ public class TestingList extends Panel { return dsTestProperties; } } + + public void stopAll(String resultMessage){ + String testInProgress[] = getTestInProgress(); + while(testInProgress[0]!=""){ + showResult(testInProgress[0], testInProgress[1], resultMessage, "false"); + } + setToStopped(); + } /** * return the status of the specified test name for specified device name @@ -1587,6 +1598,12 @@ public class TestingList extends Panel { System.out.println("Result: " + sDeviceName + "|" + sTestPath + "|" + sTestResult + "|" + sTestStatus); iLastExecutedTestIndex = showResult(sDeviceName, sTestPath, sTestResult, sTestStatus); } + } catch (StatementException intEx) { + Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, intEx); + System.out.println("User interrupted test! |"+ sDeviceName+"|"+ sTestPath+"|"+ String.valueOf(intEx)); + stopAll("User interrupted test"); + //showResult(sDeviceName, sTestPath, "User interrupted test", "false"); + //setToStopped(); } catch (ClassCastException ccex) { Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ccex); SwingUtils.showMessage(TestingList.this, "executeParallelTestsGroup()", ccex.toString()); @@ -1594,11 +1611,7 @@ public class TestingList extends Panel { if (!sDeviceName.isEmpty()) { showResult(sDeviceName, sTestPath, ccex.toString(), TestStatus.FAILURE.toString()); } - } catch (InterruptedException intEx) { - Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, intEx); - System.out.println(String.valueOf(intEx)); - showResult(sDeviceName, sTestPath, "User interrupted test", TestStatus.FAILURE.toString()); - } catch (Exception ex) { + }catch (Exception ex) { Logger.getLogger(TestingList.class.getName()).log(Level.SEVERE, null, ex); SwingUtils.showMessage(TestingList.this, "executeParallelTestsGroup()", ex.toString()); System.out.println(String.valueOf(ex)); diff --git a/script/tests/config/LabTests b/script/tests/config/LabTests index 2daadc8a94bbe7be06c954f2b92edcf11e57bd55..5721c11c8c07fea5b1edbcf94ec2ca18ee6c1f14 100644 GIT binary patch delta 161 zcmbOn(q}MXHlx5~M>dI#Tm0EL8A=!!3K{AcxF+{0dTmZ&uVk7$ky(ARpA7%zEdEZW z$sbwdfE@14Q^k}Rp&Wj03y=;=5MebrL#7faE;act8|UO;exb>|irY5d<}791d|%Cn dkvj~eC>%sYOg7V4j>3PTF%N}5QL~V-0sz%XGHw6> delta 278 zcmeA(m>e=;HlxC1M>dI#Tm0F?8A}-W9MeitixdiqQp+;)ON$E`>KM2tAK>%a9L8SB zw7HzWm{m}tgn>6avm^tqX!9S=Nla{DwT6>@1hQB`y39A95Kv-a(*UupH*exmXT+{z z@){m)evl#;5a9|U+$Ib1Rbp4os4;mp-zjd8Dg!JQ=CN`og5;7wMDk=uvE?ZI&tmgX N_;bVy1q;wX1ps>2R3iWY