Skip to content

Commit

Permalink
refactor(robot-executor): rename host_user to HostUser and host_passw…
Browse files Browse the repository at this point in the history
…ord to HostPassword.
  • Loading branch information
lucashimpens committed Feb 13, 2025
1 parent 28adbd4 commit 4d20b4a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ public AnswerList<RobotExecutor> readByVariousByCriteria(List<String> robot, Str
searchSQL.append(" or rbe.`rank` like ?");
searchSQL.append(" or rbe.`host` like ?");
searchSQL.append(" or rbe.`port` like ?");
searchSQL.append(" or rbe.`host_user` like ?");
searchSQL.append(" or rbe.`host_password` like ?");
searchSQL.append(" or rbe.`HostUser` like ?");
searchSQL.append(" or rbe.`HostPassword` like ?");
searchSQL.append(" or rbe.`deviceudid` like ?");
searchSQL.append(" or rbe.`devicename` like ?");
searchSQL.append(" or rbe.`usrCreated` like ?");
Expand Down Expand Up @@ -269,7 +269,7 @@ public AnswerList<RobotExecutor> readByVariousByCriteria(List<String> robot, Str
public Answer create(RobotExecutor object) {
MessageEvent msg = null;
StringBuilder query = new StringBuilder();
query.append("INSERT INTO robotexecutor (`robot`, `executor`, `isactive`, `rank`, `host`, `port`, `host_user`, `host_password`, `deviceudid`, `devicename`, `deviceport`, `isdevicelockunlock`, `ExecutorProxyServiceHost`, `ExecutorProxyServicePort`, `ExecutorBrowserProxyHost`, `ExecutorBrowserProxyPort`, `executorproxytype`, `description`, `usrcreated`) ");
query.append("INSERT INTO robotexecutor (`robot`, `executor`, `isactive`, `rank`, `host`, `port`, `HostUser`, `HostPassword`, `deviceudid`, `devicename`, `deviceport`, `isdevicelockunlock`, `ExecutorProxyServiceHost`, `ExecutorProxyServicePort`, `ExecutorBrowserProxyHost`, `ExecutorBrowserProxyPort`, `executorproxytype`, `description`, `usrcreated`) ");
query.append("VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");

// Debug message on SQL.
Expand Down Expand Up @@ -367,7 +367,7 @@ public Answer delete(RobotExecutor object) {
@Override
public Answer update(String robot, String executor, RobotExecutor object) {
MessageEvent msg = null;
final String query = "UPDATE robotexecutor SET `robot` = ?, `executor` = ?, description = ?, isactive = ?, `rank` = ?, `host` = ?, `port` = ?, `host_user` = ?, `host_password` = ?, `deviceudid` = ?, `devicename` = ?, `deviceport` = ?, `isdevicelockunlock` = ?, `ExecutorProxyServiceHost` = ?, `ExecutorProxyServicePort` = ?, `ExecutorBrowserProxyHost` = ?, `ExecutorBrowserProxyPort` = ?, `executorproxytype` = ?, "
final String query = "UPDATE robotexecutor SET `robot` = ?, `executor` = ?, description = ?, isactive = ?, `rank` = ?, `host` = ?, `port` = ?, `HostUser` = ?, `HostPassword` = ?, `deviceudid` = ?, `devicename` = ?, `deviceport` = ?, `isdevicelockunlock` = ?, `ExecutorProxyServiceHost` = ?, `ExecutorProxyServicePort` = ?, `ExecutorBrowserProxyHost` = ?, `ExecutorBrowserProxyPort` = ?, `executorproxytype` = ?, "
+ "dateModif = NOW(), usrModif= ? WHERE `robot` = ? and `executor` = ?";

// Debug message on SQL.
Expand Down Expand Up @@ -466,8 +466,8 @@ public RobotExecutor loadFromResultSet(ResultSet rs) throws SQLException {
String host = ParameterParserUtil.parseStringParam(rs.getString("rbe.host"), "");
String port = ParameterParserUtil.parseStringParam(rs.getString("rbe.port"), "");
int executorExtensionProxyPort = ParameterParserUtil.parseIntegerParam(rs.getString("rbe.ExecutorExtensionProxyPort"), 0);
String host_user = ParameterParserUtil.parseStringParam(rs.getString("rbe.host_user"), "");
String host_password = ParameterParserUtil.parseStringParam(rs.getString("rbe.host_password"), "");
String hostUser = ParameterParserUtil.parseStringParam(rs.getString("rbe.HostUser"), "");
String hostPassword = ParameterParserUtil.parseStringParam(rs.getString("rbe.HostPassword"), "");
String deviceudid = ParameterParserUtil.parseStringParam(rs.getString("rbe.deviceudid"), "");
String devicename = ParameterParserUtil.parseStringParam(rs.getString("rbe.devicename"), "");
Integer deviceport = rs.getInt("rbe.deviceport");
Expand All @@ -489,7 +489,7 @@ public RobotExecutor loadFromResultSet(ResultSet rs) throws SQLException {

//TODO remove when working in test with mockito and autowired
factoryRobotExecutor = new FactoryRobotExecutor();
return factoryRobotExecutor.create(id, robot, executor, isActive, rank, host, port, host_user, host_password, executorExtensionProxyPort, deviceudid, devicename, deviceport, isDevicelockunlock, executorProxyServiceHost, executorProxyServicePort, executorBrowserProxyHost, executorBrowserProxyPort, executorProxyType, description, usrCreated, dateCreated, usrModif, dateModif);
return factoryRobotExecutor.create(id, robot, executor, isActive, rank, host, port, hostUser, hostPassword, executorExtensionProxyPort, deviceudid, devicename, deviceport, isDevicelockunlock, executorProxyServiceHost, executorProxyServicePort, executorBrowserProxyHost, executorBrowserProxyPort, executorProxyType, description, usrCreated, dateCreated, usrModif, dateModif);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,12 +768,12 @@ public ArrayList<String> getSqlDocumentation() {
b.append(",('robotexecutor','Port','','en','Port','Port number of the Executor.',NULL)");
b.append(",('robotexecutor','Port','','fr','Port','Numéro de port de l\\'Executor.',NULL)");
b.append(",('robotexecutor','Port','','fa','درگاه','شماره درگاه مجری.',NULL)");
b.append(",('robotexecutor','host_user','','en','Host User','In case of authentication this is the username that will be used.',NULL)");
b.append(",('robotexecutor','host_user','','fr','Nom d\\'Utilisateur pour l\\'hote','En cas d\\'authentification, Nom de l\\'utilisateur à utiliser pour l\\'Executor.',NULL)");
b.append(",('robotexecutor','host_user','','fa','کاربر میزبان','درصورت احراز هویت این نام کاربری است که استفاده می شود.',NULL)");
b.append(",('robotexecutor','host_password','','en','Host Password','In case of authentification this is the user password that will be used.',NULL)");
b.append(",('robotexecutor','host_password','','fr','Mot de passe de l\\'utilisateur','En cas d\\'authentification, Mot de passe à utiliser pour l\\'Executor.',NULL)");
b.append(",('robotexecutor','host_password','','fa','رمز عبور میزبان','در صورت احراز هویت این رمز عبور استفاده می شود.',NULL)");
b.append(",('robotexecutor','hostUser','','en','Host User','In case of authentication this is the username that will be used.',NULL)");
b.append(",('robotexecutor','hostUser','','fr','Nom d\\'Utilisateur pour l\\'hote','En cas d\\'authentification, Nom de l\\'utilisateur à utiliser pour l\\'Executor.',NULL)");
b.append(",('robotexecutor','hostUser','','fa','کاربر میزبان','درصورت احراز هویت این نام کاربری است که استفاده می شود.',NULL)");
b.append(",('robotexecutor','hostPassword','','en','Host Password','In case of authentification this is the user password that will be used.',NULL)");
b.append(",('robotexecutor','hostPassword','','fr','Mot de passe de l\\'utilisateur','En cas d\\'authentification, Mot de passe à utiliser pour l\\'Executor.',NULL)");
b.append(",('robotexecutor','hostPassword','','fa','رمز عبور میزبان','در صورت احراز هویت این رمز عبور استفاده می شود.',NULL)");
b.append(",('robotexecutor','deviceUdid','','en','Device UDID','When defined, it feed the \\'deviceUdid\\' capability..',NULL)");
b.append(",('robotexecutor','deviceUdid','','fr','UDID du Device','Lorsque défini, renseigne automatiquement la capability \\'deviceUdid\\.',NULL)");
b.append(",('robotexecutor','deviceUdid','','fa','دستگاه UDID','زمانیکه تعریف شود, قابلیت \\'deviceUdid\\' را تغذیه می کند.',NULL)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private List<RobotExecutor> getExecutorsFromParameter(String robot, HttpServletR
Integer rank = reJson.getInt("rank");
String host = reJson.getString("host");
String port = reJson.getString("port");
String host_user = reJson.getString("hostUser");
String hostUser = reJson.getString("hostUser");
String deviceName = reJson.getString("deviceName");
String deviceUdid = reJson.getString("deviceUdid");
Integer devicePort = null;
Expand All @@ -263,19 +263,19 @@ private List<RobotExecutor> getExecutorsFromParameter(String robot, HttpServletR
}
String description = reJson.getString("description");

String host_password = reJson.getString("hostPassword");
if (host_password.equals(StringUtil.SECRET_STRING)) {
host_password = "";
String hostPassword = reJson.getString("hostPassword");
if (hostPassword.equals(StringUtil.SECRET_STRING)) {
hostPassword = "";
for (RobotExecutor robotExecutor : reList1) {
if (robotExecutor.getID() == id) {
host_password = robotExecutor.getHostPassword();
hostPassword = robotExecutor.getHostPassword();
LOG.debug("Password not changed so reset to original value : " + robotExecutor.getHostPassword());
}
}
}

if (!delete) {
RobotExecutor reo = reFactory.create(i, robot, executor, isActive, rank, host, port, host_user, host_password, 0, deviceUdid, deviceName, devicePort, false, executorProxyServiceHost, executorProxyServicePort, executorBrowserProxyHost, executorBrowserProxyPort, executorProxyType, description, "", null, "", null);
RobotExecutor reo = reFactory.create(i, robot, executor, isActive, rank, host, port, hostUser, hostPassword, 0, deviceUdid, deviceName, devicePort, false, executorProxyServiceHost, executorProxyServicePort, executorBrowserProxyHost, executorBrowserProxyPort, executorProxyType, description, "", null, "", null);
reList.add(reo);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private List<RobotExecutor> getExecutorsFromParameter(String robot, HttpServletR
Integer rank = reJson.getInt("rank");
String host = reJson.getString("host");
String port = reJson.getString("port");
String host_user = reJson.getString("hostUser");
String hostUser = reJson.getString("hostUser");
String deviceName = reJson.getString("deviceName");
String deviceUdid = reJson.getString("deviceUdid");
boolean isDeviceLockUnlock = reJson.getBoolean("isDeviceLockUnlock");
Expand Down Expand Up @@ -295,19 +295,19 @@ private List<RobotExecutor> getExecutorsFromParameter(String robot, HttpServletR

String description = reJson.getString("description");

String host_password = reJson.getString("hostPassword");
if (host_password.equals(StringUtil.SECRET_STRING)) {
host_password = "";
String hostPassword = reJson.getString("hostPassword");
if (hostPassword.equals(StringUtil.SECRET_STRING)) {
hostPassword = "";
for (RobotExecutor robotExecutor : reList1) {
if (robotExecutor.getID() == id) {
host_password = robotExecutor.getHostPassword();
hostPassword = robotExecutor.getHostPassword();
LOG.debug("Password not changed so reset to original value : " + robotExecutor.getHostPassword());
}
}
}

if (!delete) {
RobotExecutor reo = reFactory.create(i, robot, executor, isActive, rank, host, port, host_user, host_password, 0, deviceUdid, deviceName, devicePort, isDeviceLockUnlock, executorProxyServiceHost, executorProxyServicePort, executorBrowserProxyHost, executorBrowserProxyPort, executorProxyType, description, "", null, "", null);
RobotExecutor reo = reFactory.create(i, robot, executor, isActive, rank, host, port, hostUser, hostPassword, 0, deviceUdid, deviceName, devicePort, isDeviceLockUnlock, executorProxyServiceHost, executorProxyServicePort, executorBrowserProxyHost, executorBrowserProxyPort, executorProxyType, description, "", null, "", null);
reList.add(reo);
}
}
Expand Down
6 changes: 4 additions & 2 deletions source/src/main/resources/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6609,9 +6609,11 @@ UPDATE testcaseexecutionqueuedep SET `Type`='TCEXEENDOK' where `Type`='TCEXEEND'
-- 1882
ALTER TABLE testcaseexecutionqueue MODIFY COLUMN `State` VARCHAR(20) NOT NULL DEFAULT 'QUEUED';

-- 1883-1887
-- 1883-1889
ALTER TABLE robotexecutor RENAME COLUMN executorExtensionHost TO ExecutorProxyServiceHost;
ALTER TABLE robotexecutor RENAME COLUMN executorExtensionPort TO ExecutorProxyServicePort;
ALTER TABLE robotexecutor RENAME COLUMN executorProxyHost TO ExecutorBrowserProxyHost;
ALTER TABLE robotexecutor RENAME COLUMN executorProxyPort TO ExecutorBrowserProxyPort;
ALTER TABLE robotexecutor RENAME COLUMN NodeProxyPort TO ExecutorExtensionProxyPort;
ALTER TABLE robotexecutor RENAME COLUMN NodeProxyPort TO ExecutorExtensionProxyPort;
ALTER TABLE robotexecutor RENAME COLUMN host_user TO HostUser;
ALTER TABLE robotexecutor RENAME COLUMN host_password TO HostPassword;
12 changes: 6 additions & 6 deletions source/src/main/webapp/js/transversalobject/Robot.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ function appendExecutorRow(tableBody, executor) {
var rankInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "rank") + " --\">").addClass("form-control input-sm").val(executor.rank);
var hostInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "host") + " --\">").addClass("form-control input-sm").val(executor.host);
var portInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "Port") + " --\">").addClass("form-control input-sm").val(executor.port);
var hostUserInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "host_user") + " --\">").addClass("form-control input-sm").val(executor.hostUser);
var hostPasswordInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "host_password") + " --\">").addClass("form-control input-sm").val(executor.hostPassword);
var hostUserInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "hostUser") + " --\">").addClass("form-control input-sm").val(executor.hostUser);
var hostPasswordInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "hostPassword") + " --\">").addClass("form-control input-sm").val(executor.hostPassword);
var deviceUdidInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "deviceUdid") + " --\">").addClass("form-control input-sm").val(executor.deviceUdid);
var deviceNameInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "deviceName") + " --\">").addClass("form-control input-sm").val(executor.deviceName);
var devicePortInput = $("<input placeholder=\"-- " + doc.getDocLabel("robotexecutor", "devicePort") + " --\">").addClass("form-control input-sm").val(executor.devicePort);
Expand Down Expand Up @@ -688,8 +688,8 @@ function appendExecutorRow(tableBody, executor) {
var expandName = $("<div class='form-group col-sm-2'></div>").append("<button class='btn btn-primary' type='button' data-toggle='collapse' data-target='#col" + nbRow + "' aria-expanded='false' aria-controls='col" + nbRow + "'><span class='glyphicon glyphicon-chevron-down'></span></button>");
var host = $("<div class='form-group col-sm-4'></div>").append("<label for='host'>" + doc.getDocOnline("robotexecutor", "host") + "</label>").append(hostInput);
var port = $("<div class='form-group col-sm-2'></div>").append("<label for='port'>" + doc.getDocOnline("robotexecutor", "Port") + "</label>").append(portInput);
var hostuser = $("<div class='form-group col-sm-3'></div>").append("<label for='hostuser'>" + doc.getDocOnline("robotexecutor", "host_user") + "</label>").append(hostUserInput);
var hostpass = $("<div class='form-group col-sm-3'></div>").append("<label for='hostpassword'>" + doc.getDocOnline("robotexecutor", "host_password") + "</label>").append(hostPasswordInput);
var hostUser = $("<div class='form-group col-sm-3'></div>").append("<label for='hostUser'>" + doc.getDocOnline("robotexecutor", "hostUser") + "</label>").append(hostUserInput);
var hostPassword = $("<div class='form-group col-sm-3'></div>").append("<label for='hostPassword'>" + doc.getDocOnline("robotexecutor", "hostPassword") + "</label>").append(hostPasswordInput);
var dudid = $("<div class='form-group col-sm-4'></div>").append("<label for='deviceudid'>" + doc.getDocOnline("robotexecutor", "deviceUdid") + "</label>").append(deviceUdidInput);
var dname = $("<div class='form-group col-sm-4'></div>").append("<label for='devicename'>" + doc.getDocOnline("robotexecutor", "deviceName") + "</label>").append(deviceNameInput);
var dport = $("<div class='form-group col-sm-2'></div>").append("<label for='deviceport'>" + doc.getDocOnline("robotexecutor", "devicePort") + "</label>").append(devicePortInput);
Expand All @@ -700,8 +700,8 @@ function appendExecutorRow(tableBody, executor) {
var ephost = $("<div class='form-group col-sm-3'></div>").append("<label for='executorBrowserProxyHost'>" + doc.getDocOnline("robotexecutor", "executorBrowserProxyHost") + "</label>").append(executorBrowserProxyHostInput);
var epport = $("<div class='form-group col-sm-2'></div>").append("<label for='executorBrowserProxyPort'>" + doc.getDocOnline("robotexecutor", "executorBrowserProxyPort") + "</label>").append(executorBrowserProxyPortInput);
var drow1 = $("<div class='row'></div>").append(active).append(rank).append(expandName);
var drow2 = $("<div class='row'></div>").append(host).append(port).append(hostuser).append(hostpass);
// var drow3 = $("<div class='row'></div>").append(hostuser).append(hostpass);
var drow2 = $("<div class='row'></div>").append(host).append(port).append(hostUser).append(hostPassword);
// var drow3 = $("<div class='row'></div>").append(hostUser).append(hostPassword);
var drow4 = $("<div class='row alert alert-warning'></div>").append(dudid).append(dname).append(dport).append(dLockUnlock);
var drow5 = $("<div class='row alert alert-warning'></div>").append(epType).append(eehost).append(eeport).append(ephost).append(epport);
var panelExtra = $("<div class='collapse' id='col" + nbRow + "'></div>").append(drow4).append(drow5);
Expand Down

0 comments on commit 4d20b4a

Please sign in to comment.