use of io.elastest.etm.model.external.ExternalTJob in project elastest-torm by elastest.
the class TestLinkService method syncProjectTestPlan.
public void syncProjectTestPlan(TestPlan testPlan, ExternalProject externalProject) {
ExternalTJob externalTJob = new ExternalTJob(new Long(0));
externalTJob.setExProject(externalProject);
externalTJob.setName(testPlan.getName());
externalTJob.setExternalId(testPlan.getId().toString());
externalTJob.setExternalSystemId(this.getSystemId());
try {
externalTJob = externalTJobRepository.save(externalTJob);
} catch (DataIntegrityViolationException existException) {
ExternalTJob savedTJob = externalTJobRepository.findByExternalIdAndExternalSystemId(externalTJob.getExternalId(), externalTJob.getExternalSystemId());
externalTJob.setId(savedTJob.getId());
externalTJob.setSut(savedTJob.getSut());
externalTJob.setExecDashboardConfig(savedTJob.getExecDashboardConfig());
externalTJob = externalTJobRepository.save(externalTJob);
}
this.syncTestPlanCases(testPlan.getId(), externalTJob);
}
use of io.elastest.etm.model.external.ExternalTJob in project elastest-torm by elastest.
the class ExternalService method createExternalTJobExecutionByExternalTJobId.
public ExternalTJobExecution createExternalTJobExecutionByExternalTJobId(Long exTJobId) {
ExternalTJob exTJob = this.externalTJobRepository.findById(exTJobId);
ExternalTJobExecution exec = new ExternalTJobExecution();
exec.setExTJob(exTJob);
exec.setStartDate(new Date());
this.externalTJobExecutionRepository.save(exec);
exec.generateMonitoringIndex();
exec = this.externalTJobExecutionRepository.save(exec);
SupportService eus = this.startEus();
if (eus != null) {
String instanceId = utilTools.generateUniqueId();
esmService.provisionExternalTJobExecServiceInstanceAsync(eus.getId(), exec, instanceId);
exec.getEnvVars().put("EUS_ID", eus.getId());
exec.getEnvVars().put("EUS_INSTANCE_ID", instanceId);
exec = this.externalTJobExecutionRepository.save(exec);
}
elasticsearchService.createMonitoringIndex(exec.getMonitoringIndicesList());
return exec;
}
Aggregations