How to use getUrl method of org.cerberus.crud.entity.Environment class

Best Cerberus-source code snippet using org.cerberus.crud.entity.Environment.getUrl

Source:ExecutionStartService.java Github

copy

Full Screen

...220 CountryEnvironmentParameters cea;221 cea = this.factorycountryEnvironmentParameters.create(tCExecution.getApplicationObj().getSystem(), tCExecution.getCountry(), tCExecution.getEnvironment(), tCExecution.getApplicationObj().getApplication(), tCExecution.getMyHost(), "", tCExecution.getMyContextRoot(), tCExecution.getMyLoginRelativeURL(), "", "", "", "", CountryEnvironmentParameters.DEFAULT_POOLSIZE);222 cea.setIp(tCExecution.getMyHost());223 cea.setUrl(tCExecution.getMyContextRoot());224 tCExecution.setUrl(StringUtil.getURLFromString(cea.getIp(), cea.getUrl(), "", ""));225 cea.setUrlLogin(tCExecution.getMyLoginRelativeURL());226 tCExecution.setCountryEnvironmentParameters(cea);227 LOG.debug(" -> Execution will be done with manual application connectivity setting. IP/URL/LOGIN : " + cea.getIp() + "-" + cea.getUrl() + "-" + cea.getUrlLogin());228 }229 /**230 * If execution is manual, we force the env at 'MANUAL-ENVDATA'231 * string. We keep envData information in order to trace the env232 * data that has been used.233 */234 tCExecution.setEnvironment("MANUAL-" + tCExecution.getEnvironmentData());235 } else {236 /**237 * Automatic application configuration execution.238 */239 LOG.debug("Execution will be done with automatic application connectivity setting.");240 /**241 * Load Country/Environment/Application information and set them to242 * the TestCaseExecution object243 */244 LOG.debug("Loading Country/Environment/Application Information. " + tCExecution.getCountry() + "-" + tCExecution.getEnvironment() + "-" + tCExecution.getApplicationObj().getApplication());245 CountryEnvironmentParameters cea;246 try {247 cea = this.countryEnvironmentParametersService.convert(this.countryEnvironmentParametersService.readByKey(248 tCExecution.getApplicationObj().getSystem(), tCExecution.getCountry(), tCExecution.getEnvironment(), tCExecution.getApplicationObj().getApplication()));249 if (cea != null) {250 tCExecution.setCountryEnvironmentParameters(cea);251// tCExecution.setUrl(cea.getIp()+ cea.getUrl());252 tCExecution.setUrl(StringUtil.getURLFromString(cea.getIp(), cea.getUrl(), "", ""));253 } else {254 MessageGeneral mes = new MessageGeneral(MessageGeneralEnum.VALIDATION_FAILED_COUNTRYENVAPP_NOT_FOUND);255 mes.setDescription(mes.getDescription().replace("%COUNTRY%", tCExecution.getCountry()));256 mes.setDescription(mes.getDescription().replace("%ENV%", tCExecution.getEnvironment()));257 mes.setDescription(mes.getDescription().replace("%APPLI%", tCExecution.getTestCaseObj().getApplication()));258 LOG.error(mes.getDescription());259 throw new CerberusException(mes);260 }261 /**262 * Forcing the IP URL and Login config from DevIP, DevURL and263 * DevLogin parameter only if DevURL is defined.264 */265 } catch (CerberusException ex) {266 MessageGeneral mes = new MessageGeneral(MessageGeneralEnum.VALIDATION_FAILED_COUNTRYENVAPP_NOT_FOUND);267 mes.setDescription(mes.getDescription().replace("%COUNTRY%", tCExecution.getCountry()));268 mes.setDescription(mes.getDescription().replace("%ENV%", tCExecution.getEnvironment()));269 mes.setDescription(mes.getDescription().replace("%APPLI%", tCExecution.getTestCaseObj().getApplication()));270 LOG.error(mes.getDescription());271 throw new CerberusException(mes);272 }273 LOG.debug("Country/Environment/Application Information Loaded. " + tCExecution.getCountry() + " - " + tCExecution.getEnvironment() + " - " + tCExecution.getApplicationObj().getApplication());274 LOG.debug(" -> Execution will be done with automatic application connectivity setting. IP/URL/LOGIN : " + cea.getIp() + "-" + cea.getUrl() + "-" + cea.getUrlLogin());275 tCExecution.setEnvironmentData(tCExecution.getEnvironment());276 }277 /**278 * Load Environment object from invariant table.279 */280 LOG.debug("Loading Environment Information. " + tCExecution.getEnvironmentData());281 try {282 tCExecution.setEnvironmentDataObj(invariantService.convert(invariantService.readByKey("ENVIRONMENT", tCExecution.getEnvironmentData())));283 } catch (CerberusException ex) {284 if (tCExecution.isManualURL()) {285 MessageGeneral mes = new MessageGeneral(MessageGeneralEnum.VALIDATION_FAILED_ENVIRONMENT_DOESNOTEXIST_MAN);286 mes.setDescription(mes.getDescription().replace("%ENV%", tCExecution.getEnvironmentData()));287 LOG.debug(mes.getDescription());288 throw new CerberusException(mes);...

Full Screen

Full Screen

Source:ServiceService.java Github

copy

Full Screen

...106 // the data from tCExecution of related database.107 if (StringUtil.isNullOrEmpty(database)) {108 // We reformat servicePath in order to add the context from the application execution.109 servicePath = StringUtil.getURLFromString(tCExecution.getCountryEnvironmentParameters().getIp(),110 tCExecution.getCountryEnvironmentParameters().getUrl(), appService.getServicePath(), "http://");111 } else {112 // We reformat servicePath in order to add the context from the databaseUrl definition and corresponding from the country and environment of the execution.113 try {114 CountryEnvironmentDatabase countryEnvironmentDatabase;115 countryEnvironmentDatabase = countryEnvironmentDatabaseService.convert(this.countryEnvironmentDatabaseService.readByKey(system,116 country, environment, database));117 if (countryEnvironmentDatabase == null) {118 message = new MessageEvent(MessageEventEnum.PROPERTY_FAILED_GETFROMDATALIB_SERVICE_URLKOANDDATABASESOAPURLNOTEXIST);119 message.setDescription(message.getDescription()120 .replace("%SERVICEURL%", appService.getServicePath())121 .replace("%SYSTEM%", system)122 .replace("%COUNTRY%", country)123 .replace("%ENV%", environment)124 .replace("%DATABASE%", database));...

Full Screen

Full Screen

Source:CountryEnvParamService.java Github

copy

Full Screen

...76 jsonObject.put("environment", ce.getEnvironment());77 jsonObject.put("build", ce.getBuild());78 jsonObject.put("revision", ce.getRevision());79 jsonObject.put("ip", cea.getIp());80 jsonObject.put("url", cea.getUrl());81 result.add(jsonObject);82 }83 }84 }85 } catch (JSONException ex) {86 LOG.warn(ex);87 }88 return result;89 }90 @Override91 public AnswerItem readByKey(String system, String country, String environment) {92 return countryEnvParamDao.readByKey(system, country, environment);93 }94 @Override...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful