diff --git a/plugins/TestingList.java b/plugins/TestingList.java index 4df0c79..55e6f17 100644 --- a/plugins/TestingList.java +++ b/plugins/TestingList.java @@ -40,6 +40,7 @@ import javax.swing.JComboBox; import javax.swing.JDialog; import javax.swing.JFileChooser; import javax.swing.table.DefaultTableCellRenderer; +import javax.swing.table.TableModel; import org.apache.commons.io.FilenameUtils; import org.python.core.PyList; import static org.python.bouncycastle.util.Arrays.append; @@ -69,50 +70,6 @@ public class TestingList extends Panel { } } - //delete this - @Override - public void onExecutedFile(String fileName, Object result) { - int iCurrentTestPos = 0; - try { - Object ret = eval("ret"); - boolean status = (boolean) eval("status"); - Object deviceName = eval("DEVICE"); - String sStatus = (status == true) ? TestStatus.SUCCESS.toString() : TestStatus.FAILURE.toString(); - System.out.println("onExecutedFile: received end of test for test " + fileName); -// if (ret != "") { - //start next test - if (isTestRunAllowed() && runningTestsCount() == 0) { - // executeTests(iCurrentTestPos); - } - /* } else { // ret empty means that either the test script does not have variable ret, or that the script could not be started at all - ret = "Could not start test script or script doea not contain default variables"; - sStatus = TestStatus.FAILURE.toString(); - String[] dsDeviceName = getTestInProgress(); - //SwingUtils.showException(this, ex ); - if (dsDeviceName[0] != "") { - iCurrentTestPos = showResult(dsDeviceName[0], fileName, ret.toString(), sStatus); - //start next test - if (isTestRunAllowed() && runningTestsCount()==0) { - executeTest(iCurrentTestPos); - } - } - } - */ } catch (Exception ex) { - String ret = "Could not start test script"; - String sStatus = TestStatus.FAILURE.toString(); - String[] dsDeviceName = getTestInProgress(); - //SwingUtils.showException(this, ex ); - SwingUtils.showMessage(this, "onExecutedFile()", ex.toString() + " " + dsDeviceName[0]); - if (dsDeviceName[0] != "") { - iCurrentTestPos = showResult(dsDeviceName[0], fileName, ret, sStatus); - //start next test - if (isTestRunAllowed()) { - // executeTests(iCurrentTestPos + 1); - } - } - } - } - /** * enumeration of table column indexes */ @@ -281,14 +238,7 @@ public class TestingList extends Panel { }; Logger logger = Logger.getLogger("TestsLog"); - //these paths are converted to unix or win path according to host OS - // private final String TESTS_DEVICES_DEFAULT_DIR = new java.io.File(".").getCanonicalPath() - // + FilenameUtils.separatorsToSystem("/home/script/tests/devices/"); - // private final String TESTS_TESTS_DEFAULT_DIR = new java.io.File(".").getCanonicalPath() - // + FilenameUtils.separatorsToSystem("/home/script/tests/tests/"); - // private final String TESTS_LOG_DEFAULT_DIR = new java.io.File(".").getCanonicalPath() - // + FilenameUtils.separatorsToSystem("/home/script/tests/log/TestsLog" + getnow() + ".txt"); - + //these paths are converted to unix or win path according to host OS private final Path TESTS_DEVICES_DEFAULT_DIR = Paths.get(".","home", "script", "tests", "devices"); private final Path TESTS_TESTS_DEFAULT_DIR = Paths.get(".","home", "script", "tests", "tests"); private final Path TESTS_LOG_DEFAULT_DIR = Paths.get(".","home", "script", "tests", "log", "TestsLog"+ getnow() + ".txt"); @@ -736,7 +686,7 @@ public class TestingList extends Panel { JDialog dlg = new JDialog(getView(), "Add/remove tests", true); //create a class to visualise the details panel Class editTestingListClass = getController().getClassByName("EditTestingList"); - JPanel detailsPanel = (JPanel) editTestingListClass.getConstructor(new Class[]{HashMap.class}).newInstance(jTable1.getModel()); + JPanel detailsPanel = (JPanel) editTestingListClass.getConstructor(new Class[]{TableModel.class}).newInstance(jTable1.getModel()); dlg.getContentPane().add(detailsPanel); //dlg.add(new TestingListDetails());