1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.job.service;
17
18 import java.sql.Date;
19 import java.util.List;
20
21 import junit.framework.Assert;
22
23 import org.joda.time.DateTime;
24 import org.joda.time.DateTimeZone;
25 import org.junit.Before;
26 import org.junit.Test;
27 import org.kuali.hr.job.Job;
28 import org.kuali.hr.test.KPMETestCase;
29 import org.kuali.hr.time.service.base.TkServiceLocator;
30 import org.kuali.hr.time.util.TKUtils;
31
32 public class JobServiceImplTest extends KPMETestCase {
33
34 public static final String TEST_USER = "admin";
35
36 JobService jobService = null;
37
38
39 @Before
40 public void setUp() throws Exception {
41 super.setUp();
42 jobService=TkServiceLocator.getJobService();
43 }
44
45 @Test
46 public void testGetJobs() {
47 Date payPeriodEndDate = new Date((new DateTime(2010,7,30,1,0,0,0, TKUtils.getSystemDateTimeZone())).getMillis());
48 List<Job> jobs = jobService.getJobs(TEST_USER, payPeriodEndDate);
49 Assert.assertNotNull("Jobs was null", jobs);
50 Assert.assertEquals("Incorrect number of jobs", 2, jobs.size());
51 }
52
53 @Test
54 public void testGetMaxJob() {
55 Job aJob = jobService.getMaxJob("admin");
56 Assert.assertNotNull("Max Job should not be null", aJob);
57 Assert.assertEquals("Max job number of admin should be 30", new Long("30"), aJob.getJobNumber());
58 }
59 }