use of com.ibeiliao.deployment.admin.vo.deploy.DeployHistory in project Corgi by kevinYin.
the class DeployHistoryServiceImplTest method testAudit.
/**
* 测试审核发布
* @param accountId
* @param historyId
*/
private void testAudit(long accountId, int historyId) {
DeployHistory history = deployHistoryService.getByHistoryId(historyId);
assertTrue(history.getDeployStatus() == DeployStatus.WAITING_FOR_AUDIT.getValue());
deployHistoryService.audit(accountId, historyId);
history = deployHistoryService.getByHistoryId(historyId);
assertTrue(history.getDeployStatus() == DeployStatus.WAITING_FOR_DEPLOYMENT.getValue());
}
use of com.ibeiliao.deployment.admin.vo.deploy.DeployHistory in project Corgi by kevinYin.
the class DeployHistoryServiceImplTest method testCreateRestartHistory.
/**
* 测试 restart
* 期望:测试通过
*/
@Test
public void testCreateRestartHistory() {
InitTestDataService.InitData data = initTestDataService.init();
long accountId = data.account.getUid();
int serverId = data.module.getServerGroups().get(0).getServers().get(0).getServerId();
DeployHistory deployHistory = deployHistoryService.createRestartHistory(accountId, serverId);
validateStopRestart(data, deployHistory.getHistoryId(), serverId);
}
use of com.ibeiliao.deployment.admin.vo.deploy.DeployHistory in project Corgi by kevinYin.
the class DeployHistoryServiceImplTest method testGetDeployHistory.
private void testGetDeployHistory(int historyId, DeploymentOrder order) {
DeployHistory history = deployHistoryService.getByHistoryId(historyId);
assertNotNull(history);
assertNotNull(history.getServerDeployHistories());
assertTrue(history.getServerDeployHistories().size() == order.getServerId().length);
Set<Integer> serverSet = new HashSet<>();
for (int serverId : order.getServerId()) {
serverSet.add(serverId);
}
for (ServerDeployHistory sdh : history.getServerDeployHistories()) {
assertTrue(sdh.getHistoryId() == historyId);
assertTrue(StringUtils.isNotEmpty(sdh.getServerIp()));
assertTrue(StringUtils.isNotEmpty(sdh.getServerName()));
assertTrue(sdh.getDeployStatus() == ServerDeployResult.WAITING_FOR_DEPLOYMENT.getValue());
assertTrue(serverSet.contains(sdh.getServerId()));
}
}
use of com.ibeiliao.deployment.admin.vo.deploy.DeployHistory in project Corgi by kevinYin.
the class DeployHistoryServiceImplTest method testCancel.
/**
* 测试取消发布的功能
* 期望:测试通过
*/
@Test
public void testCancel() {
DeployHistory history = createDeployHistory();
deployHistoryService.cancel(history.getAccountId(), history.getHistoryId());
DeployHistory newHistory = deployHistoryService.getByHistoryId(history.getHistoryId());
assertTrue(newHistory.getDeployStatus() == DeployStatus.CANCELLED.getValue());
}
use of com.ibeiliao.deployment.admin.vo.deploy.DeployHistory in project Corgi by kevinYin.
the class DeployHistoryServiceImplTest method testQueryUnfinished.
/**
* 仅测试SQL语法
* 期望:测试通过
*/
@Test
public void testQueryUnfinished() {
Date now = new Date();
Date endTime = DateUtils.addSeconds(now, Constants.DEPLOY_TASK_TIMEOUT);
Date startTime = DateUtils.addSeconds(now, Constants.DEPLOY_TASK_TIMEOUT * 12);
final int MAX = 1000;
List<DeployHistory> list = deployHistoryService.queryUnfinished(startTime, endTime, MAX);
assertNotNull(list);
}
Aggregations