提交 | 用户 | 时间
|
e7c126
|
1 |
package com.xxl.job.admin.dao; |
H |
2 |
|
|
3 |
import com.xxl.job.admin.core.model.XxlJobLog; |
|
4 |
import org.junit.jupiter.api.Test; |
|
5 |
import org.springframework.boot.test.context.SpringBootTest; |
|
6 |
|
|
7 |
import javax.annotation.Resource; |
|
8 |
import java.util.Date; |
|
9 |
import java.util.List; |
|
10 |
|
|
11 |
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) |
|
12 |
public class XxlJobLogDaoTest { |
|
13 |
|
|
14 |
@Resource |
|
15 |
private XxlJobLogDao xxlJobLogDao; |
|
16 |
|
|
17 |
@Test |
|
18 |
public void test(){ |
|
19 |
List<XxlJobLog> list = xxlJobLogDao.pageList(0, 10, 1, 1, null, null, 1); |
|
20 |
int list_count = xxlJobLogDao.pageListCount(0, 10, 1, 1, null, null, 1); |
|
21 |
|
|
22 |
XxlJobLog log = new XxlJobLog(); |
|
23 |
log.setJobGroup(1); |
|
24 |
log.setJobId(1); |
|
25 |
|
|
26 |
long ret1 = xxlJobLogDao.save(log); |
|
27 |
XxlJobLog dto = xxlJobLogDao.load(log.getId()); |
|
28 |
|
|
29 |
log.setTriggerTime(new Date()); |
|
30 |
log.setTriggerCode(1); |
|
31 |
log.setTriggerMsg("1"); |
|
32 |
log.setExecutorAddress("1"); |
|
33 |
log.setExecutorHandler("1"); |
|
34 |
log.setExecutorParam("1"); |
|
35 |
ret1 = xxlJobLogDao.updateTriggerInfo(log); |
|
36 |
dto = xxlJobLogDao.load(log.getId()); |
|
37 |
|
|
38 |
|
|
39 |
log.setHandleTime(new Date()); |
|
40 |
log.setHandleCode(2); |
|
41 |
log.setHandleMsg("2"); |
|
42 |
ret1 = xxlJobLogDao.updateHandleInfo(log); |
|
43 |
dto = xxlJobLogDao.load(log.getId()); |
|
44 |
|
|
45 |
|
|
46 |
List<Long> ret4 = xxlJobLogDao.findClearLogIds(1, 1, new Date(), 100, 100); |
|
47 |
|
|
48 |
int ret2 = xxlJobLogDao.delete(log.getJobId()); |
|
49 |
|
|
50 |
} |
|
51 |
|
|
52 |
} |