Search in sources :

Example 1 with ExternalTestExecution

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);
}
Also used : ExternalTestExecution(io.elastest.etm.model.external.ExternalTestExecution) ExternalTJobExecution(io.elastest.etm.model.external.ExternalTJobExecution)

Example 2 with ExternalTestExecution

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);
    }
}
Also used : ExternalTestExecution(io.elastest.etm.model.external.ExternalTestExecution) DataIntegrityViolationException(org.springframework.dao.DataIntegrityViolationException)

Aggregations

ExternalTestExecution (io.elastest.etm.model.external.ExternalTestExecution)2 ExternalTJobExecution (io.elastest.etm.model.external.ExternalTJobExecution)1 DataIntegrityViolationException (org.springframework.dao.DataIntegrityViolationException)1