Search in sources :

Example 31 with CeQueueDto

use of org.sonar.db.ce.CeQueueDto in project sonarqube by SonarSource.

the class PurgeCeActivitiesTest method insertWithDate.

private void insertWithDate(String uuid, long date) {
    CeQueueDto queueDto = new CeQueueDto();
    queueDto.setUuid(uuid);
    queueDto.setTaskType(CeTaskTypes.REPORT);
    CeActivityDto dto = new CeActivityDto(queueDto);
    dto.setStatus(CeActivityDto.Status.SUCCESS);
    when(system2.now()).thenReturn(date);
    dbTester.getDbClient().ceActivityDao().insert(dbTester.getSession(), dto);
    dbTester.getSession().commit();
}
Also used : CeActivityDto(org.sonar.db.ce.CeActivityDto) CeQueueDto(org.sonar.db.ce.CeQueueDto)

Example 32 with CeQueueDto

use of org.sonar.db.ce.CeQueueDto in project sonarqube by SonarSource.

the class CeQueueCleanerTest method insertInQueue.

private CeQueueDto insertInQueue(String taskUuid, CeQueueDto.Status status) throws IOException {
    CeQueueDto dto = new CeQueueDto();
    dto.setTaskType(CeTaskTypes.REPORT);
    dto.setComponentUuid("PROJECT_1");
    dto.setUuid(taskUuid);
    dto.setStatus(status);
    dbTester.getDbClient().ceQueueDao().insert(dbTester.getSession(), dto);
    dbTester.getSession().commit();
    return dto;
}
Also used : CeQueueDto(org.sonar.db.ce.CeQueueDto)

Aggregations

CeQueueDto (org.sonar.db.ce.CeQueueDto)32 Test (org.junit.Test)11 CeActivityDto (org.sonar.db.ce.CeActivityDto)11 DbSession (org.sonar.db.DbSession)8 WsCe (org.sonarqube.ws.WsCe)5 ComponentDto (org.sonar.db.component.ComponentDto)2 Date (java.util.Date)1 StringUtils.defaultString (org.apache.commons.lang.StringUtils.defaultString)1 CeTask (org.sonar.ce.queue.CeTask)1 Status (org.sonar.db.ce.CeQueueDto.Status)1 CeTaskQuery (org.sonar.db.ce.CeTaskQuery)1 OrganizationDto (org.sonar.db.organization.OrganizationDto)1 TestResponse (org.sonar.server.ws.TestResponse)1 ProjectResponse (org.sonarqube.ws.WsCe.ProjectResponse)1