use of io.elastest.etm.model.external.ExternalTestExecution in project elastest-torm by elastest.
the class ExternalService method setExternalTJobExecToTestExecutionByExecutionId.
public ExternalTestExecution setExternalTJobExecToTestExecutionByExecutionId(Integer execId, Long exTJobExecId) {
ExternalTJobExecution exTJobExec = this.externalTJobExecutionRepository.findById(exTJobExecId);
ExternalTestExecution exTestExec = this.externalTestExecutionRepository.findByExternalIdAndExternalSystemId(execId.toString(), exTJobExec.getExTJob().getExternalSystemId());
exTestExec.setExTJobExec(exTJobExec);
return this.externalTestExecutionRepository.save(exTestExec);
}
use of io.elastest.etm.model.external.ExternalTestExecution in project elastest-torm by elastest.
the class TestLinkService method syncTestCaseExec.
public void syncTestCaseExec(Execution exec, ExternalTestCase externalTestCase) {
ExternalTestExecution externalTestExec = new ExternalTestExecution(new Long(0));
externalTestExec.setExTestCase(externalTestCase);
externalTestExec.setFields(this.getTestExecFields(exec));
externalTestExec.setResult(exec.getStatus().name());
externalTestExec.setExternalId(exec.getId().toString());
externalTestExec.setExternalSystemId(this.getSystemId());
try {
externalTestExec = externalTestExecutionRepository.save(externalTestExec);
} catch (DataIntegrityViolationException existException) {
ExternalTestExecution savedTestExec = externalTestExecutionRepository.findByExternalIdAndExternalSystemId(externalTestExec.getExternalId(), externalTestExec.getExternalSystemId());
externalTestExec.setId(savedTestExec.getId());
externalTestExec.setExTJobExec(savedTestExec.getExTJobExec());
externalTestExec.setMonitoringIndex(savedTestExec.getMonitoringIndex());
externalTestExec = externalTestExecutionRepository.save(externalTestExec);
}
}
Aggregations