Closedown

This commit is contained in:
boccioli_m
2015-06-10 10:08:10 +02:00
parent ec8be4cb2f
commit 744759f07e

View File

@@ -52,6 +52,7 @@ public class TestingList extends Panel {
//listen to script end of execution and get return value
@Override
protected void onExecutedFile(String fileName) {
int iCurrentTestPos = 0;
try {
Object ret = eval("ret");
boolean success = (boolean) eval("success");
@@ -60,7 +61,12 @@ public class TestingList extends Panel {
String sSuccess = (success == true) ? "Success" : "Failed";
if (ret != null) {
//SwingUtils.showMessage(getComponent(), "", ret.toString() + " - " + ret.getClass().getName());
testingList.showResult(deviceName.toString(), fileName, ret.toString(), sSuccess);
iCurrentTestPos = testingList.showResult(deviceName.toString(), fileName, ret.toString(), sSuccess);
//start next test
if(iCurrentTestPos>0)
{
testingList.executeTest(iCurrentTestPos+1);
}
}
} catch (Exception ex) {
SwingUtils.showException(getComponent(), ex);
@@ -116,7 +122,7 @@ public class TestingList extends Panel {
@SuppressWarnings("unchecked")
//show test result in table
public void showResult(String deviceName, String testName, String res, String status) {
public int showResult(String deviceName, String testName, String res, String status) {
int rowD = -1, colT = -1;
//search for device name in table
for (int row = 0; row <= jTable1.getRowCount() - 1; row++) {
@@ -154,6 +160,7 @@ public class TestingList extends Panel {
jTable1.setValueAt(res, rowD, COL_RESULT);
jTable1.setValueAt(status, rowD, COL_STATUS);
}
return rowD;
}
//returns the status of the specified test name for specified device name
@@ -281,7 +288,7 @@ public class TestingList extends Panel {
}// </editor-fold>//GEN-END:initComponents
private void jButtonRunActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRunActionPerformed
this.executeTests();
this.executeTest(0);
/*
try {
boolean var1 = true;
@@ -378,14 +385,15 @@ public class TestingList extends Panel {
private javax.swing.JTextArea jTextField1;
// End of variables declaration//GEN-END:variables
//execute the selected tests in the list
public void executeTests(){
//execute the selected tests in the list, starting from the position
public void executeTest(int position){
boolean bSelected = false;
String sDeviceName;
String sTestName;
HashMap args = new HashMap();
//scan through the table and execute the selected tests
for (int row = 0; row <= jTable1.getRowCount() - 1; row++) {
int row = position;
if (row <= jTable1.getRowCount() ) {
bSelected = (boolean) jTable1.getValueAt(row, COL_CHECK);
if (bSelected) {
sDeviceName = jTable1.getValueAt(row, COL_DEVICENAME).toString();
@@ -395,15 +403,11 @@ public class TestingList extends Panel {
try{
args.put("DEVICE", sDeviceName);
run(sTestName, args);
Thread.sleep(50);
while(getResult(sDeviceName, sTestName) == "Running"){
Thread.sleep(100);
}
} catch (Exception ex) {
SwingUtils.showMessage(this, "", ex.toString());
}
}
}
}
}
//table management