|
|
@@ -1,78 +1,78 @@
|
|
1
|
|
-package com.xxl.job.dao.impl;
|
|
2
|
|
-
|
|
3
|
|
-import com.xxl.job.admin.core.model.XxlJobInfo;
|
|
4
|
|
-import com.xxl.job.admin.dao.XxlJobInfoDao;
|
|
5
|
|
-import org.junit.Test;
|
|
6
|
|
-import org.junit.runner.RunWith;
|
|
7
|
|
-import org.springframework.test.context.ContextConfiguration;
|
|
8
|
|
-import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
9
|
|
-
|
|
10
|
|
-import javax.annotation.Resource;
|
|
11
|
|
-import java.util.Date;
|
|
12
|
|
-import java.util.List;
|
|
13
|
|
-
|
|
14
|
|
-@RunWith(SpringJUnit4ClassRunner.class)
|
|
15
|
|
-@ContextConfiguration(locations = "classpath*:spring/applicationcontext-*.xml")
|
|
16
|
|
-public class XxlJobInfoTest {
|
|
17
|
|
-
|
|
18
|
|
- @Resource
|
|
19
|
|
- private XxlJobInfoDao xxlJobInfoDao;
|
|
20
|
|
-
|
|
21
|
|
- @Test
|
|
22
|
|
- public void pageList(){
|
|
23
|
|
- List<XxlJobInfo> list = xxlJobInfoDao.pageList(0, 20, 0, null);
|
|
24
|
|
- int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, null);
|
|
25
|
|
-
|
|
26
|
|
- System.out.println(list);
|
|
27
|
|
- System.out.println(list_count);
|
|
28
|
|
-
|
|
29
|
|
- List<XxlJobInfo> list2 = xxlJobInfoDao.getJobsByGroup(1);
|
|
30
|
|
- }
|
|
31
|
|
-
|
|
32
|
|
- @Test
|
|
33
|
|
- public void save_load(){
|
|
34
|
|
- XxlJobInfo info = new XxlJobInfo();
|
|
35
|
|
- info.setJobGroup(1);
|
|
36
|
|
- info.setJobCron("jobCron");
|
|
37
|
|
- info.setJobDesc("desc");
|
|
38
|
|
- info.setAuthor("setAuthor");
|
|
39
|
|
- info.setAlarmEmail("setAlarmEmail");
|
|
40
|
|
- info.setExecutorRouteStrategy("setExecutorRouteStrategy");
|
|
41
|
|
- info.setExecutorHandler("setExecutorHandler");
|
|
42
|
|
- info.setExecutorParam("setExecutorParam");
|
|
43
|
|
- info.setExecutorBlockStrategy("setExecutorBlockStrategy");
|
|
44
|
|
- info.setExecutorFailStrategy("setExecutorFailStrategy");
|
|
45
|
|
- info.setGlueType("setGlueType");
|
|
46
|
|
- info.setGlueSource("setGlueSource");
|
|
47
|
|
- info.setGlueRemark("setGlueRemark");
|
|
48
|
|
- info.setChildJobKey("setChildJobKey");
|
|
49
|
|
-
|
|
50
|
|
- int count = xxlJobInfoDao.save(info);
|
|
51
|
|
-
|
|
52
|
|
- XxlJobInfo info2 = xxlJobInfoDao.loadById(info.getId());
|
|
53
|
|
- info2.setJobCron("jobCron2");
|
|
54
|
|
- info2.setJobDesc("desc2");
|
|
55
|
|
- info2.setAuthor("setAuthor2");
|
|
56
|
|
- info2.setAlarmEmail("setAlarmEmail2");
|
|
57
|
|
- info2.setExecutorRouteStrategy("setExecutorRouteStrategy2");
|
|
58
|
|
- info2.setExecutorHandler("setExecutorHandler2");
|
|
59
|
|
- info2.setExecutorParam("setExecutorParam2");
|
|
60
|
|
- info2.setExecutorBlockStrategy("setExecutorBlockStrategy2");
|
|
61
|
|
- info2.setExecutorFailStrategy("setExecutorFailStrategy2");
|
|
62
|
|
- info2.setGlueType("setGlueType2");
|
|
63
|
|
- info2.setGlueSource("setGlueSource2");
|
|
64
|
|
- info2.setGlueRemark("setGlueRemark2");
|
|
65
|
|
- info2.setGlueUpdatetime(new Date());
|
|
66
|
|
- info2.setChildJobKey("setChildJobKey2");
|
|
67
|
|
-
|
|
68
|
|
- int item2 = xxlJobInfoDao.update(info2);
|
|
69
|
|
-
|
|
70
|
|
- xxlJobInfoDao.delete(info2.getId());
|
|
71
|
|
-
|
|
72
|
|
- List<XxlJobInfo> list2 = xxlJobInfoDao.getJobsByGroup(1);
|
|
73
|
|
-
|
|
74
|
|
- int ret3 = xxlJobInfoDao.findAllCount();
|
|
75
|
|
-
|
|
76
|
|
- }
|
|
77
|
|
-
|
|
78
|
|
-}
|
|
|
1
|
+package com.xxl.job.admin.dao;
|
|
|
2
|
+
|
|
|
3
|
+import com.xxl.job.admin.core.model.XxlJobInfo;
|
|
|
4
|
+import com.xxl.job.admin.dao.XxlJobInfoDao;
|
|
|
5
|
+import org.junit.Test;
|
|
|
6
|
+import org.junit.runner.RunWith;
|
|
|
7
|
+import org.springframework.test.context.ContextConfiguration;
|
|
|
8
|
+import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|
|
9
|
+
|
|
|
10
|
+import javax.annotation.Resource;
|
|
|
11
|
+import java.util.Date;
|
|
|
12
|
+import java.util.List;
|
|
|
13
|
+
|
|
|
14
|
+@RunWith(SpringJUnit4ClassRunner.class)
|
|
|
15
|
+@ContextConfiguration(locations = "classpath*:spring/applicationcontext-*.xml")
|
|
|
16
|
+public class XxlJobInfoDaoTest {
|
|
|
17
|
+
|
|
|
18
|
+ @Resource
|
|
|
19
|
+ private XxlJobInfoDao xxlJobInfoDao;
|
|
|
20
|
+
|
|
|
21
|
+ @Test
|
|
|
22
|
+ public void pageList(){
|
|
|
23
|
+ List<XxlJobInfo> list = xxlJobInfoDao.pageList(0, 20, 0, null);
|
|
|
24
|
+ int list_count = xxlJobInfoDao.pageListCount(0, 20, 0, null);
|
|
|
25
|
+
|
|
|
26
|
+ System.out.println(list);
|
|
|
27
|
+ System.out.println(list_count);
|
|
|
28
|
+
|
|
|
29
|
+ List<XxlJobInfo> list2 = xxlJobInfoDao.getJobsByGroup(1);
|
|
|
30
|
+ }
|
|
|
31
|
+
|
|
|
32
|
+ @Test
|
|
|
33
|
+ public void save_load(){
|
|
|
34
|
+ XxlJobInfo info = new XxlJobInfo();
|
|
|
35
|
+ info.setJobGroup(1);
|
|
|
36
|
+ info.setJobCron("jobCron");
|
|
|
37
|
+ info.setJobDesc("desc");
|
|
|
38
|
+ info.setAuthor("setAuthor");
|
|
|
39
|
+ info.setAlarmEmail("setAlarmEmail");
|
|
|
40
|
+ info.setExecutorRouteStrategy("setExecutorRouteStrategy");
|
|
|
41
|
+ info.setExecutorHandler("setExecutorHandler");
|
|
|
42
|
+ info.setExecutorParam("setExecutorParam");
|
|
|
43
|
+ info.setExecutorBlockStrategy("setExecutorBlockStrategy");
|
|
|
44
|
+ info.setExecutorFailStrategy("setExecutorFailStrategy");
|
|
|
45
|
+ info.setGlueType("setGlueType");
|
|
|
46
|
+ info.setGlueSource("setGlueSource");
|
|
|
47
|
+ info.setGlueRemark("setGlueRemark");
|
|
|
48
|
+ info.setChildJobKey("setChildJobKey");
|
|
|
49
|
+
|
|
|
50
|
+ int count = xxlJobInfoDao.save(info);
|
|
|
51
|
+
|
|
|
52
|
+ XxlJobInfo info2 = xxlJobInfoDao.loadById(info.getId());
|
|
|
53
|
+ info2.setJobCron("jobCron2");
|
|
|
54
|
+ info2.setJobDesc("desc2");
|
|
|
55
|
+ info2.setAuthor("setAuthor2");
|
|
|
56
|
+ info2.setAlarmEmail("setAlarmEmail2");
|
|
|
57
|
+ info2.setExecutorRouteStrategy("setExecutorRouteStrategy2");
|
|
|
58
|
+ info2.setExecutorHandler("setExecutorHandler2");
|
|
|
59
|
+ info2.setExecutorParam("setExecutorParam2");
|
|
|
60
|
+ info2.setExecutorBlockStrategy("setExecutorBlockStrategy2");
|
|
|
61
|
+ info2.setExecutorFailStrategy("setExecutorFailStrategy2");
|
|
|
62
|
+ info2.setGlueType("setGlueType2");
|
|
|
63
|
+ info2.setGlueSource("setGlueSource2");
|
|
|
64
|
+ info2.setGlueRemark("setGlueRemark2");
|
|
|
65
|
+ info2.setGlueUpdatetime(new Date());
|
|
|
66
|
+ info2.setChildJobKey("setChildJobKey2");
|
|
|
67
|
+
|
|
|
68
|
+ int item2 = xxlJobInfoDao.update(info2);
|
|
|
69
|
+
|
|
|
70
|
+ xxlJobInfoDao.delete(info2.getId());
|
|
|
71
|
+
|
|
|
72
|
+ List<XxlJobInfo> list2 = xxlJobInfoDao.getJobsByGroup(1);
|
|
|
73
|
+
|
|
|
74
|
+ int ret3 = xxlJobInfoDao.findAllCount();
|
|
|
75
|
+
|
|
|
76
|
+ }
|
|
|
77
|
+
|
|
|
78
|
+}
|