Closedown
This commit is contained in:
@@ -557,17 +557,9 @@ public class NewTest extends javax.swing.JPanel {
|
||||
HashMap hmTestParams){
|
||||
if (TESTS_TESTS_DEFAULT_DIR.toFile().isDirectory()) {
|
||||
//check that the tests suite dir exists. If not, create it
|
||||
Path testSuiteDir = Paths.get(TESTS_TESTS_DEFAULT_DIR.toString(),cleanFileName(sTestSuite));
|
||||
if( !testSuiteDir.toFile().isDirectory()){
|
||||
boolean success = testSuiteDir.toFile().mkdirs();
|
||||
if (!success) {
|
||||
// Directory creation failed
|
||||
SwingUtils.showMessage(this, "generateTestFiles()", "Cannot create directory " + testSuiteDir.toString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
String testSuiteDir = generateTestSuite(sTestSuite);
|
||||
//new test directory inside tests suite dir
|
||||
Path testDir = Paths.get(testSuiteDir.toString(),cleanFileName(sTestName));
|
||||
Path testDir = Paths.get(testSuiteDir,cleanFileName(sTestName));
|
||||
if( testDir.toFile().isDirectory()){
|
||||
//test already exists: ask to overwrite
|
||||
OptionResult res = SwingUtils.showOption(this, "Overwrite Test?", "Test already exists. Overwrite with this new one?", OptionType.YesNo);
|
||||
@@ -632,7 +624,9 @@ public class NewTest extends javax.swing.JPanel {
|
||||
String sTestSuite,
|
||||
HashMap hmTestParams){
|
||||
if (TESTS_DEVICES_DEFAULT_DIR.toFile().isDirectory()) {
|
||||
//new device directory inside tests suite dir
|
||||
//check that the tests suite dir exists. If not, create it
|
||||
String testSuiteDir = generateTestSuite(sTestSuite);
|
||||
//new device directory inside devices dir
|
||||
Path testDir = Paths.get(TESTS_DEVICES_DEFAULT_DIR.toString(),cleanFileName(sTestName));
|
||||
if( testDir.toFile().isDirectory()){
|
||||
//device already exists: ask to overwrite
|
||||
@@ -666,6 +660,20 @@ public class NewTest extends javax.swing.JPanel {
|
||||
return Paths.get(testDir.toString(), cleanFileName(sTestName+".py"));
|
||||
}
|
||||
|
||||
private String generateTestSuite(String sTestSuite){
|
||||
//check that the tests suite dir exists. If not, create it
|
||||
Path testSuiteDir = Paths.get(TESTS_TESTS_DEFAULT_DIR.toString(),cleanFileName(sTestSuite));
|
||||
if( !testSuiteDir.toFile().isDirectory()){
|
||||
boolean success = testSuiteDir.toFile().mkdirs();
|
||||
if (!success) {
|
||||
// Directory creation failed
|
||||
SwingUtils.showMessage(this, "generateTestFiles()", "Cannot create directory " + testSuiteDir.toString());
|
||||
return testSuiteDir.toString();
|
||||
}
|
||||
}
|
||||
return testSuiteDir.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* generate the python script that runs the test
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user