improvements
This commit is contained in:
@@ -272,10 +272,12 @@ public class NewTest extends javax.swing.JPanel {
|
||||
public static Path TEMPLATES_TESTCONFIG_FILEPATH = Paths.get(".", "home", "script", "tests","templates","testTemplate.config");
|
||||
public static Path TEMPLATES_DEVICECONFIG_FILEPATH = Paths.get(".", "home", "script", "tests","templates","deviceTemplate.config");
|
||||
public static String ALLOWED_CHARS = "[a-zA-Z0-9._\\-\\]\\[(){} ]*";
|
||||
public static String NEW_TYPE_DEVICE = "Device";
|
||||
public static String NEW_TYPE_TEST = "Test";
|
||||
|
||||
/**
|
||||
* fill table with example parameters
|
||||
* @param newType the new can be Device or Test.
|
||||
* @param newType the new can be NEW_TYPE_DEVICE or NEW_TYPE_TEST.
|
||||
*/
|
||||
private void fillComponents(String newType) {
|
||||
|
||||
@@ -288,8 +290,8 @@ public class NewTest extends javax.swing.JPanel {
|
||||
}
|
||||
});
|
||||
|
||||
//adapt labels according to type (Device or Test)
|
||||
if(newType == "Device"){
|
||||
//adapt labels according to type (NEW_TYPE_DEVICE or NEW_TYPE_TEST)
|
||||
if(newType == NEW_TYPE_DEVICE){
|
||||
this.lblDescr.setText(newType + " "+ this.lblDescr.getText());
|
||||
this.lblName.setText( newType + " "+ this.lblName.getText());
|
||||
lblParams.setVisible(false);
|
||||
@@ -452,7 +454,7 @@ public class NewTest extends javax.swing.JPanel {
|
||||
*/
|
||||
public void generateTestFiles(){
|
||||
HashMap hmTestParams = (HashMap) getParametersFromTable();
|
||||
if(sType.equals("Device")){
|
||||
if(sType.equals(NEW_TYPE_DEVICE)){
|
||||
generateDeviceFiles(this.txtTestName.getText(),
|
||||
this.txtTestDescription.getText(),
|
||||
this.jComboBoxTestSuites.getSelectedItem().toString(),
|
||||
@@ -668,7 +670,7 @@ public class NewTest extends javax.swing.JPanel {
|
||||
props.load(in);
|
||||
in.close();
|
||||
FileOutputStream out = new FileOutputStream(configFile);
|
||||
if(sType.equals("Devices")){
|
||||
if(sType.equals(NEW_TYPE_DEVICE)){
|
||||
//creation of device config
|
||||
props.setProperty("name", sTestName);
|
||||
props.setProperty("description", sTestDescription);
|
||||
|
||||
Reference in New Issue
Block a user