Skip to content

Commit c3ed04a

Browse files
committed
refactor(robot-proxy): renaming executorExtensionPort to executorProxyServicePort
1 parent 153caa0 commit c3ed04a

File tree

15 files changed

+56
-55
lines changed

15 files changed

+56
-55
lines changed

source/src/main/java/org/cerberus/core/crud/dao/impl/RobotExecutorDAO.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ public AnswerList<RobotExecutor> readByVariousByCriteria(List<String> robot, Str
269269
public Answer create(RobotExecutor object) {
270270
MessageEvent msg = null;
271271
StringBuilder query = new StringBuilder();
272-
query.append("INSERT INTO robotexecutor (`robot`, `executor`, `isactive`, `rank`, `host`, `port`, `host_user`, `host_password`, `deviceudid`, `devicename`, `deviceport`, `isdevicelockunlock`, `ExecutorProxyServiceHost`, `executorextensionport`, `executorproxyhost`, `executorproxyport`, `executorproxytype`, `description`, `usrcreated`) ");
272+
query.append("INSERT INTO robotexecutor (`robot`, `executor`, `isactive`, `rank`, `host`, `port`, `host_user`, `host_password`, `deviceudid`, `devicename`, `deviceport`, `isdevicelockunlock`, `ExecutorProxyServiceHost`, `ExecutorProxyServicePort`, `executorproxyhost`, `executorproxyport`, `executorproxytype`, `description`, `usrcreated`) ");
273273
query.append("VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
274274

275275
// Debug message on SQL.
@@ -298,8 +298,8 @@ public Answer create(RobotExecutor object) {
298298
}
299299
preStat.setBoolean(i++, object.isDeviceLockUnlock());
300300
preStat.setString(i++, object.getExecutorProxyServiceHost());
301-
if (object.getExecutorExtensionPort() != null) {
302-
preStat.setInt(i++, object.getExecutorExtensionPort());
301+
if (object.getExecutorProxyServicePort() != null) {
302+
preStat.setInt(i++, object.getExecutorProxyServicePort());
303303
} else {
304304
preStat.setNull(i++, Types.INTEGER);
305305
}
@@ -367,7 +367,7 @@ public Answer delete(RobotExecutor object) {
367367
@Override
368368
public Answer update(String robot, String executor, RobotExecutor object) {
369369
MessageEvent msg = null;
370-
final String query = "UPDATE robotexecutor SET `robot` = ?, `executor` = ?, description = ?, isactive = ?, `rank` = ?, `host` = ?, `port` = ?, `host_user` = ?, `host_password` = ?, `deviceudid` = ?, `devicename` = ?, `deviceport` = ?, `isdevicelockunlock` = ?, `ExecutorProxyServiceHost` = ?, `executorextensionport` = ?, `executorproxyhost` = ?, `executorproxyport` = ?, `executorproxytype` = ?, "
370+
final String query = "UPDATE robotexecutor SET `robot` = ?, `executor` = ?, description = ?, isactive = ?, `rank` = ?, `host` = ?, `port` = ?, `host_user` = ?, `host_password` = ?, `deviceudid` = ?, `devicename` = ?, `deviceport` = ?, `isdevicelockunlock` = ?, `ExecutorProxyServiceHost` = ?, `ExecutorProxyServicePort` = ?, `executorproxyhost` = ?, `executorproxyport` = ?, `executorproxytype` = ?, "
371371
+ "dateModif = NOW(), usrModif= ? WHERE `robot` = ? and `executor` = ?";
372372

373373
// Debug message on SQL.
@@ -398,8 +398,8 @@ public Answer update(String robot, String executor, RobotExecutor object) {
398398
}
399399
preStat.setBoolean(i++, object.isDeviceLockUnlock());
400400
preStat.setString(i++, object.getExecutorProxyServiceHost());
401-
if (object.getExecutorExtensionPort() != null) {
402-
preStat.setInt(i++, object.getExecutorExtensionPort());
401+
if (object.getExecutorProxyServicePort() != null) {
402+
preStat.setInt(i++, object.getExecutorProxyServicePort());
403403
} else {
404404
preStat.setNull(i++, Types.INTEGER);
405405
}
@@ -473,7 +473,7 @@ public RobotExecutor loadFromResultSet(ResultSet rs) throws SQLException {
473473
Integer deviceport = rs.getInt("rbe.deviceport");
474474
boolean isDevicelockunlock = rs.getBoolean("rbe.isdevicelockunlock");
475475
String executorProxyServiceHost = rs.getString("rbe.ExecutorProxyServiceHost");
476-
Integer executorExtensionPort = rs.getInt("rbe.executorextensionport");
476+
Integer executorProxyServicePort = rs.getInt("rbe.ExecutorProxyServicePort");
477477
String executorProxyHost = rs.getString("rbe.executorproxyhost");
478478
Integer executorProxyPort = rs.getInt("rbe.executorproxyport");
479479
String executorProxyType = rs.getString("rbe.executorproxytype");
@@ -489,7 +489,7 @@ public RobotExecutor loadFromResultSet(ResultSet rs) throws SQLException {
489489

490490
//TODO remove when working in test with mockito and autowired
491491
factoryRobotExecutor = new FactoryRobotExecutor();
492-
return factoryRobotExecutor.create(id, robot, executor, isActive, rank, host, port, host_user, host_password, nodeProxyPort, deviceudid, devicename, deviceport, isDevicelockunlock, executorProxyServiceHost, executorExtensionPort, executorProxyHost, executorProxyPort, executorProxyType, description, usrCreated, dateCreated, usrModif, dateModif);
492+
return factoryRobotExecutor.create(id, robot, executor, isActive, rank, host, port, host_user, host_password, nodeProxyPort, deviceudid, devicename, deviceport, isDevicelockunlock, executorProxyServiceHost, executorProxyServicePort, executorProxyHost, executorProxyPort, executorProxyType, description, usrCreated, dateCreated, usrModif, dateModif);
493493
}
494494

495495
@Override

source/src/main/java/org/cerberus/core/crud/entity/RobotExecutor.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class RobotExecutor {
5252
private long dateLastExeSubmitted;
5353
private String executorProxyType;
5454
private String executorProxyServiceHost;
55-
private Integer executorExtensionPort;
55+
private Integer executorProxyServicePort;
5656
private String executorProxyHost;
5757
private Integer executorProxyPort;
5858
private String UsrCreated;
@@ -223,12 +223,12 @@ public void setExecutorProxyServiceHost(String executorProxyServiceHost) {
223223
this.executorProxyServiceHost = executorProxyServiceHost;
224224
}
225225

226-
public Integer getExecutorExtensionPort() {
227-
return executorExtensionPort;
226+
public Integer getExecutorProxyServicePort() {
227+
return executorProxyServicePort;
228228
}
229229

230-
public void setExecutorExtensionPort(Integer executorExtensionPort) {
231-
this.executorExtensionPort = executorExtensionPort;
230+
public void setExecutorProxyServicePort(Integer executorProxyServicePort) {
231+
this.executorProxyServicePort = executorProxyServicePort;
232232
}
233233

234234
public String getExecutorProxyHost() {
@@ -368,7 +368,7 @@ public boolean equals(Object obj) {
368368
if ((this.executorProxyServiceHost == null) ? (other.executorProxyServiceHost != null) : !this.executorProxyServiceHost.equals(other.executorProxyServiceHost)) {
369369
return false;
370370
}
371-
if ((this.executorExtensionPort == null) ? (other.executorExtensionPort != null) : !this.executorExtensionPort.equals(other.executorExtensionPort)) {
371+
if ((this.executorProxyServicePort == null) ? (other.executorProxyServicePort != null) : !this.executorProxyServicePort.equals(other.executorProxyServicePort)) {
372372
return false;
373373
}
374374
if ((this.executorProxyHost == null) ? (other.executorProxyHost != null) : !this.executorProxyHost.equals(other.executorProxyHost)) {
@@ -400,7 +400,7 @@ public JSONObject toJson(boolean secured) {
400400
result.put("devicePort", this.getDevicePort());
401401
result.put("isDeviceLockUnlock", this.isDeviceLockUnlock());
402402
result.put("executorProxyServiceHost", this.getExecutorProxyServiceHost());
403-
result.put("executorExtensionPort", this.getExecutorExtensionPort());
403+
result.put("executorProxyServicePort", this.getExecutorProxyServicePort());
404404
result.put("executorProxyHost", this.getExecutorProxyHost());
405405
result.put("executorProxyPort", this.getExecutorProxyPort());
406406
result.put("executorProxyType", this.getExecutorProxyType());

source/src/main/java/org/cerberus/core/crud/factory/IFactoryRobotExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public interface IFactoryRobotExecutor {
4444
* @param devicePort
4545
* @param isDeviceLockUnlock
4646
* @param executorProxyServiceHost
47-
* @param executorExtensionPort
47+
* @param executorProxyServicePort
4848
* @param executorProxyHost
4949
* @param executorProxyPort
5050
* @param deviceUdid
@@ -57,6 +57,6 @@ public interface IFactoryRobotExecutor {
5757
*/
5858
RobotExecutor create(Integer ID, String robot, String executor, boolean isActive,
5959
Integer rank, String host, String port, String hostUser, String hostPassword, Integer nodeProxyPort, String deviceUdid,
60-
String deviceName, Integer devicePort, boolean isDeviceLockUnlock, String executorProxyServiceHost, Integer executorExtensionPort, String executorProxyHost, Integer executorProxyPort, String executorProxyType,
60+
String deviceName, Integer devicePort, boolean isDeviceLockUnlock, String executorProxyServiceHost, Integer executorProxyServicePort, String executorProxyHost, Integer executorProxyPort, String executorProxyType,
6161
String description, String UsrCreated, Timestamp DateCreated, String UsrModif, Timestamp DateModif);
6262
}

source/src/main/java/org/cerberus/core/crud/factory/impl/FactoryRobotExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class FactoryRobotExecutor implements IFactoryRobotExecutor {
3232

3333
@Override
3434
public RobotExecutor create(Integer ID, String robot, String executor, boolean isActive, Integer rank, String host, String port, String hostUser, String hostPassword,
35-
Integer nodeProxyPort, String deviceUdid, String deviceName, Integer devicePort, boolean isDeviceLockUnlock, String executorProxyServiceHost, Integer executorExtensionPort, String executorProxyHost, Integer executorProxyPort, String executorProxyType, String description,
35+
Integer nodeProxyPort, String deviceUdid, String deviceName, Integer devicePort, boolean isDeviceLockUnlock, String executorProxyServiceHost, Integer executorProxyServicePort, String executorProxyHost, Integer executorProxyPort, String executorProxyType, String description,
3636
String UsrCreated, Timestamp DateCreated, String UsrModif, Timestamp DateModif) {
3737
RobotExecutor newRobot = new RobotExecutor();
3838
newRobot.setID(ID);
@@ -49,7 +49,7 @@ public RobotExecutor create(Integer ID, String robot, String executor, boolean i
4949
newRobot.setDeviceName(deviceName);
5050
newRobot.setIsDeviceLockUnlock(isDeviceLockUnlock);
5151
newRobot.setExecutorProxyServiceHost(executorProxyServiceHost);
52-
newRobot.setExecutorExtensionPort(executorExtensionPort);
52+
newRobot.setExecutorProxyServicePort(executorProxyServicePort);
5353
newRobot.setExecutorProxyHost(executorProxyHost);
5454
newRobot.setExecutorProxyType(executorProxyType);
5555
newRobot.setExecutorProxyPort(executorProxyPort);

source/src/main/java/org/cerberus/core/database/DocumentationDatabaseService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,11 +795,11 @@ public ArrayList<String> getSqlDocumentation() {
795795
b.append(",('robotexecutor','dateLastExeSubmitted','','fa','مهر زمانی آخرین اجرای ارسال شده','',NULL)");
796796
b.append(",('robotexecutor','executorProxyServiceHost','','fr','Nom d\\'hote du service de proxy','Nom de la machine qui heberge le service Cerberus robot-proxy. Si vide, le host est le même que celui de l\\'executor.',NULL)");
797797
b.append(",('robotexecutor','executorProxyServiceHost','','en','Proxy service host', 'Host of the Cerberus robot-proxy service. If empty, the executor Host will be used.',NULL)");
798-
b.append(",('robotexecutor','executorExtensionPort','','fr','Port du service de proxy','Port d\\'écoute du service Cerberus robot-proxy.',NULL)");
798+
b.append(",('robotexecutor','executorProxyServicePort','','fr','Port du service de proxy','Port d\\'écoute du service Cerberus robot-proxy.',NULL)");
799799
b.append(",('robotexecutor','executorProxyServiceHost','','fa','میزبان سرویس پراکسی', 'میزبان سرویس پروکسی ربات Cerberus. اگر خالی باشد، میزبان مجری استفاده خواهد شد.',NULL)");
800-
b.append(",('robotexecutor','executorExtensionPort','','en','Proxy service port', 'Port of the robot-proxy service.',NULL)");
800+
b.append(",('robotexecutor','executorProxyServicePort','','en','Proxy service port', 'Port of the robot-proxy service.',NULL)");
801801
b.append(",('robotexecutor','executorProxyHost','','fr','Nom d\\'hote du proxy pour le navigateur', 'Nom d\\'hote qui sera donné au navigateur pour acceder au service de proxy. Si vide, le nom d\\'hote du service robot-proxy sera utilisé.',NULL)");
802-
b.append(",('robotexecutor','executorExtensionPort','','fa','درگاه سرویس پروکسی', 'درگاه سرویس ربات پروکسی.',NULL)");
802+
b.append(",('robotexecutor','executorProxyServicePort','','fa','درگاه سرویس پروکسی', 'درگاه سرویس ربات پروکسی.',NULL)");
803803
b.append(",('robotexecutor','executorProxyHost','','en','Browser Proxy Host', 'Host that will be given to the browser in order to connect to the proxy service. If empty, the host of robot-proxy service will be used.',NULL)");
804804
b.append(",('robotexecutor','executorProxyPort','','fr','Port du proxy pour le navigateur','Port qui sera utilisé par le navigateur pour acceder au proxy. Si 0, il sera determiné aléatoirement.',NULL)");
805805
b.append(",('robotexecutor','executorProxyHost','','fa','میزبان پروکسی مرورگر', 'میزبانی که برای اتصال به سرویس پروکسی به مرورگر داده می شود. اگر خالی باشد، میزبان سرویس ربات پروکسی استفاده خواهد شد.',NULL)");

source/src/main/java/org/cerberus/core/engine/execution/impl/ExecutionCheckService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ private boolean checkExecutorProxy(TestCaseExecution tce) {
374374
tce.getRobotExecutorObj().setExecutorProxyServiceHost(tce.getRobotExecutorObj().getHost());
375375
}
376376

377-
String urlString = "http://" + tce.getRobotExecutorObj().getExecutorProxyServiceHost() + ":" + tce.getRobotExecutorObj().getExecutorExtensionPort() + "/check";
377+
String urlString = "http://" + tce.getRobotExecutorObj().getExecutorProxyServiceHost() + ":" + tce.getRobotExecutorObj().getExecutorProxyServicePort() + "/check";
378378
LOG.debug("Url to check Proxy Executor : {}", urlString);
379379

380380
URL url;
@@ -399,16 +399,16 @@ private boolean checkExecutorProxy(TestCaseExecution tce) {
399399
return true;
400400
}
401401
} catch (Exception ex) {
402-
LOG.warn("Exception Reaching Cerberus Extension {}:{} Exception: {}", tce.getRobotExecutorObj().getExecutorProxyServiceHost(), tce.getRobotExecutorObj().getExecutorExtensionPort(), ex.toString());
402+
LOG.warn("Exception Reaching Cerberus Extension {}:{} Exception: {}", tce.getRobotExecutorObj().getExecutorProxyServiceHost(), tce.getRobotExecutorObj().getExecutorProxyServicePort(), ex.toString());
403403
}
404404

405405
} catch (IOException ex) {
406-
LOG.warn("Exception Reaching Cerberus Extension {}:{} Exception: {}", tce.getRobotExecutorObj().getExecutorProxyServiceHost(), tce.getRobotExecutorObj().getExecutorExtensionPort(), ex.toString());
406+
LOG.warn("Exception Reaching Cerberus Extension {}:{} Exception: {}", tce.getRobotExecutorObj().getExecutorProxyServiceHost(), tce.getRobotExecutorObj().getExecutorProxyServicePort(), ex.toString());
407407
}
408408

409409
message = new MessageGeneral(MessageGeneralEnum.VALIDATION_FAILED_CERBERUSEXECUTORNOTAVAILABLE);
410410
message.resolveDescription("HOST", tce.getRobotExecutorObj().getExecutorProxyServiceHost())
411-
.resolveDescription("PORT", String.valueOf(tce.getRobotExecutorObj().getExecutorExtensionPort()))
411+
.resolveDescription("PORT", String.valueOf(tce.getRobotExecutorObj().getExecutorProxyServicePort()))
412412
.resolveDescription("ROBOT", String.valueOf(tce.getRobotExecutorObj().getRobot()))
413413
.resolveDescription("ROBOTEXE", String.valueOf(tce.getRobotExecutorObj().getExecutor()));
414414
return false;

source/src/main/java/org/cerberus/core/engine/execution/impl/RobotServerService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,10 +1155,10 @@ public boolean stopServer(TestCaseExecution tce) {
11551155
&& tce.getVerbose() >= 1 && (parameterService.getParameterBooleanByKey("cerberus_networkstatsave_active", tce.getSystem(), false))) {
11561156

11571157
// Before collecting the stats, we wait the network idles for few minutes
1158-
executorService.waitForIdleNetwork(tce.getRobotExecutorObj().getExecutorProxyServiceHost(), tce.getRobotExecutorObj().getExecutorExtensionPort(), tce.getRemoteProxyUUID(), tce.getSystem());
1158+
executorService.waitForIdleNetwork(tce.getRobotExecutorObj().getExecutorProxyServiceHost(), tce.getRobotExecutorObj().getExecutorProxyServicePort(), tce.getRemoteProxyUUID(), tce.getSystem());
11591159

11601160
// We now get the har data.
1161-
JSONObject har = executorService.getHar(null, false, tce.getRobotExecutorObj().getExecutorProxyServiceHost(), tce.getRobotExecutorObj().getExecutorExtensionPort(), tce.getRemoteProxyUUID(), tce.getSystem(), 0);
1161+
JSONObject har = executorService.getHar(null, false, tce.getRobotExecutorObj().getExecutorProxyServiceHost(), tce.getRobotExecutorObj().getExecutorProxyServicePort(), tce.getRemoteProxyUUID(), tce.getSystem(), 0);
11621162

11631163
// and enrich it with stat entry.
11641164
har = harService.enrichWithStats(har, tce.getCountryEnvApplicationParam().getDomain(), tce.getSystem(), tce.getNetworkTrafficIndexList());

source/src/main/java/org/cerberus/core/engine/gwt/impl/ActionService.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1644,7 +1644,7 @@ private MessageEvent doActionWaitVanish(TestCaseExecution tCExecution, String va
16441644
private MessageEvent doActionWaitNetworkTrafficIdle(TestCaseExecution tCExecution) {
16451645
try {
16461646

1647-
return executorService.waitForIdleNetwork(tCExecution.getRobotExecutorObj().getExecutorProxyServiceHost(), tCExecution.getRobotExecutorObj().getExecutorExtensionPort(),
1647+
return executorService.waitForIdleNetwork(tCExecution.getRobotExecutorObj().getExecutorProxyServiceHost(), tCExecution.getRobotExecutorObj().getExecutorProxyServicePort(),
16481648
tCExecution.getRemoteProxyUUID(), tCExecution.getSystem());
16491649

16501650
} catch (CerberusEventException ex) {
@@ -1965,7 +1965,7 @@ private MessageEvent doActionSetNetworkTrafficContent(TestCaseExecution exe, Tes
19651965

19661966
// We now get the har data.
19671967
boolean doWithResponse = ParameterParserUtil.parseBooleanParam(withResponseContent, false);
1968-
JSONObject har = executorService.getHar(urlToFilter, doWithResponse, exe.getRobotExecutorObj().getExecutorProxyServiceHost(), exe.getRobotExecutorObj().getExecutorExtensionPort(), exe.getRemoteProxyUUID(), exe.getSystem(), indexFrom);
1968+
JSONObject har = executorService.getHar(urlToFilter, doWithResponse, exe.getRobotExecutorObj().getExecutorProxyServiceHost(), exe.getRobotExecutorObj().getExecutorProxyServicePort(), exe.getRemoteProxyUUID(), exe.getSystem(), indexFrom);
19691969

19701970
har = harService.enrichWithStats(har, exe.getCountryEnvApplicationParam().getDomain(), exe.getSystem(), exe.getNetworkTrafficIndexList());
19711971

@@ -2013,7 +2013,7 @@ private MessageEvent doActionIndexNetworkTraffic(TestCaseExecution exe, TestCase
20132013
/**
20142014
* Building the url to get the Latest index from cerberus-executor
20152015
*/
2016-
Integer nbHits = executorService.getHitsNb(exe.getRobotExecutorObj().getExecutorProxyServiceHost(), exe.getRobotExecutorObj().getExecutorExtensionPort(), exe.getRemoteProxyUUID());
2016+
Integer nbHits = executorService.getHitsNb(exe.getRobotExecutorObj().getExecutorProxyServiceHost(), exe.getRobotExecutorObj().getExecutorProxyServicePort(), exe.getRemoteProxyUUID());
20172017

20182018
NetworkTrafficIndex nti = new NetworkTrafficIndex();
20192019
if (StringUtil.isEmptyOrNull(value1)) {

0 commit comments

Comments
 (0)