Closedown

This commit is contained in:
boccioli_m
2017-06-07 15:37:48 +02:00
parent c497de1604
commit 36483019f2
2 changed files with 15 additions and 14 deletions

View File

@@ -1335,7 +1335,7 @@ public class TestingList extends Panel {
int rows[] = jTable1.getSelectedRows();
for(int row=0 ; row<rows.length ; row++){
try {
String sTestPath = String.valueOf(jTable1.getValueAt(rows[row], COL.TESTPATH.ordinal()));
String sTestPath = String.valueOf(jTable1.getValueAt(rows[row], COL.TESTPATH.ordinal())).replace("\\", File.separator);
System.out.println(sTestPath);
((View)App.getInstance().getMainFrame()).openScript(sTestPath);
} catch (IOException ex) {
@@ -1585,7 +1585,7 @@ public class TestingList extends Panel {
int row = jTable1.getSelectedRow();
String sDeviceName = jTable1.getValueAt(row, COL.DEVICENAME.ordinal()).toString();
String sTestName = jTable1.getValueAt(row, COL.TESTNAME.ordinal()).toString();
String sTestPath = String.valueOf(jTable1.getValueAt(row, COL.TESTPATH.ordinal()));
String sTestPath = String.valueOf(jTable1.getValueAt(row, COL.TESTPATH.ordinal())).replace("\\", File.separator);
String sTestCaseName = jTable1.getValueAt(row, COL.TESTSUITE.ordinal()).toString();
String sTestDescription = getTestDescription(sTestPath);
String sDeviceDescription = jTable1.getValueAt(row, COL.DEVICEDESCR.ordinal()).toString();
@@ -1664,7 +1664,7 @@ public class TestingList extends Panel {
//search for device name in table
for (int row = 0; row <= jTable1.getRowCount() - 1; row++) {
if (deviceName.equals(jTable1.getValueAt(row, COL.DEVICENAME.ordinal()))
&& testPath.equals(jTable1.getValueAt(row, COL.TESTPATH.ordinal()))) {
&& testPath.equals(String.valueOf(jTable1.getValueAt(row, COL.TESTPATH.ordinal())).replace("\\", File.separator))) {
rowD = row;
sTestName = jTable1.getValueAt(rowD, COL.TESTNAME.ordinal()).toString();
break;
@@ -1769,7 +1769,7 @@ public class TestingList extends Panel {
for (int row = 0; row <= jTable1.getRowCount() - 1; row++) {
if (jTable1.getValueAt(row, COL.STATUS.ordinal()).toString().equals(TestStatus.RUNNING.toString())) {
dsTestProperties[0] = jTable1.getValueAt(row, COL.DEVICENAME.ordinal()).toString();
dsTestProperties[1] = jTable1.getValueAt(row, COL.TESTPATH.ordinal()).toString();
dsTestProperties[1] = jTable1.getValueAt(row, COL.TESTPATH.ordinal()).toString().replace("\\", File.separator);
break;
}
}
@@ -1819,7 +1819,7 @@ public class TestingList extends Panel {
}
if (rowD >= 0) {
//search for test in table
if (testPath.equals(jTable1.getValueAt(rowD, COL.TESTPATH.ordinal()))) {
if (testPath.equals(String.valueOf(jTable1.getValueAt(rowD, COL.TESTPATH.ordinal())).replace("\\", File.separator))) {
colT = COL.TESTNAME.ordinal();
}
}
@@ -1930,7 +1930,7 @@ public class TestingList extends Panel {
if(!isTestRunAllowed())
return;
if (selectedTestsRows.length > 0) { //at least one test is selected: launch it (or them)
System.out.println("\n===================================================\n");
System.out.println("\n===================================================\n");
executeParallelTestsGroup(selectedTestsRows); //last execution did not find a test file. Continue with next execution
executeTest(position + 1);
} else {//no tests were selected. end.
@@ -1949,9 +1949,10 @@ public class TestingList extends Panel {
String sDeviceName = jTable1.getValueAt(row, COL.DEVICENAME.ordinal()).toString();
String sTestName = jTable1.getValueAt(row, COL.TESTNAME.ordinal()).toString();
String sTestCaseName = jTable1.getValueAt(row, COL.TESTSUITE.ordinal()).toString();
String sTestPath = jTable1.getValueAt(row, COL.TESTPATH.ordinal()).toString();
String sTestPath = jTable1.getValueAt(row, COL.TESTPATH.ordinal()).toString().replace("\\", File.separator);
// HashMap mParameters = buildParametersMap(String.valueOf(jTable1.getValueAt(row, COL.TESTPARAMS.ordinal())));
//get the parameters directly frm he config file
System.out.println("sTestPath: " + sTestPath);
HashMap mParameters = getTestParameters(sTestPath);
HashMap testArgs = new HashMap();
//args.put("ret", "");
@@ -2014,7 +2015,7 @@ public class TestingList extends Panel {
* @return return value: 0 means ok, <0 means problem
*/
private int executeParallelTestsGroup(int[] rowsToExecute) throws InterruptedException {
System.out.println(Convert.arrayToString(rowsToExecute, " - " , 10));
System.out.println("Rows = " + Convert.arrayToString(rowsToExecute, " - " , 10));
hTests = new HashMap();
int iRet = -1;
HashMap args2 = new HashMap(); //this is the global map that will contain one map per test.
@@ -2031,7 +2032,6 @@ System.out.println(Convert.arrayToString(rowsToExecute, " - " , 10));
mParameters = (HashMap) testArgs.get(testArgNames.PARAMETERS.toString());
sTestID = sDeviceName+"|"+sTestPath;
File f = new File(sTestPath);
System.out.println("Path = " + sTestPath);
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());
@@ -2187,7 +2187,7 @@ System.out.println(hTests);
jTable1.getColumnModel().getColumn(COL.DEVICENAME.ordinal()).setPreferredWidth(30);
jTable1.getColumnModel().getColumn(COL.STATUS.ordinal()).setPreferredWidth(20);
hideColumn(COL.DEVICEDESCR);
hideColumn(COL.TESTPATH);
//hideColumn(COL.TESTPATH);
hideColumn(COL.TESTDESCR);
hideColumn(COL.TESTPARAMS);
hideColumn(COL.TESTHELP);
@@ -2233,6 +2233,7 @@ System.out.println(hTests);
DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
//String testPath = FilenameUtils.separatorsToSystem(TESTS_TESTS_DEFAULT_DIR + testSuite + "/" + testName + "/" + testName + ".py");
String testPath = Paths.get(TESTS_TESTS_DEFAULT_DIR.toString(), testSuite, testName, testName + ".py").toString();
System.out.println("PAth = " + testPath);
Object rowData[] = new Object[]{false, "", sDate, deviceName, deviceDescription, testSuite, testName, testPath, testParams, testDescription, testHelp, "", "Pending", icon};
//vedify that this test is not already in the table
int totalRows = model.getRowCount();
@@ -2241,7 +2242,7 @@ System.out.println(hTests);
bTestAlreadyInTable = (model.getValueAt(row, COL.DEVICENAME.ordinal()).toString().equals(deviceName)
&& model.getValueAt(row, COL.TESTSUITE.ordinal()).toString().equals(testSuite)
&& model.getValueAt(row, COL.TESTNAME.ordinal()).toString().equals(testName)
&& model.getValueAt(row, COL.TESTPATH.ordinal()).toString().equals(testPath));
&& model.getValueAt(row, COL.TESTPATH.ordinal()).toString().replace("\\", File.separator).equals(testPath));
if (bTestAlreadyInTable) {
break;
}
@@ -2405,7 +2406,7 @@ System.out.println(hTests);
deviceNameTable = model.getValueAt(row, COL.DEVICENAME.ordinal()).toString();
//testSuiteTable = model.getValueAt(row, COL.TESTSUITE.ordinal()).toString();
//testNameTable = model.getValueAt(row, COL.TESTNAME.ordinal()).toString();
testPathTable = model.getValueAt(row, COL.TESTPATH.ordinal()).toString();
testPathTable = model.getValueAt(row, COL.TESTPATH.ordinal()).toString().replace("\\", File.separator);
//loop to compare current test in table with all tests in directory
for (int i = 0; i < testsInDir.size(); i++) {
deviceNameDir = testsInDir.get(i).get(0).toString();