Search in sources :

Example 1 with ExternalTJobExecution

use of io.elastest.etm.model.external.ExternalTJobExecution 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 ExternalTJobExecution

use of io.elastest.etm.model.external.ExternalTJobExecution 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;
}
Also used : SupportService(io.elastest.etm.model.SupportService) ExternalTJob(io.elastest.etm.model.external.ExternalTJob) ExternalTJobExecution(io.elastest.etm.model.external.ExternalTJobExecution) Date(java.util.Date)

Aggregations

ExternalTJobExecution (io.elastest.etm.model.external.ExternalTJobExecution)2 SupportService (io.elastest.etm.model.SupportService)1 ExternalTJob (io.elastest.etm.model.external.ExternalTJob)1 ExternalTestExecution (io.elastest.etm.model.external.ExternalTestExecution)1 Date (java.util.Date)1