1 package org.apache.turbine.services.schedule;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import junit.framework.Test;
23 import junit.framework.TestSuite;
24
25 import org.apache.turbine.test.BaseTestCase;
26
27 /***
28 * Unit testing for Job Entries. Ensure that removing NumberKey from TurbineNonPersistentScheduler
29 * still works.
30 *
31 * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
32 * @version $Id: JobEntryTest.java 534527 2007-05-02 16:10:59Z tv $
33 */
34 public class JobEntryTest extends BaseTestCase
35 {
36 private JobEntry je1;
37 private JobEntry je2;
38
39 public JobEntryTest(String name)
40 throws Exception
41 {
42 super(name);
43
44
45 je1 = new JobEntry();
46 je1.setJobId(1);
47 je1.setSecond(0);
48 je1.setMinute(1);
49 je1.setHour(-1);
50 je1.setDayOfMonth(-1);
51 je1.setWeekDay(-1);
52 je1.setTask("SimpleJob");
53
54 je2 = new JobEntry();
55 je2.setJobId(2);
56 je2.setSecond(0);
57 je2.setMinute(1);
58 je2.setHour(-1);
59 je2.setDayOfMonth(-1);
60 je2.setWeekDay(-1);
61 je2.setTask("SimpleJob");
62 }
63
64 public static Test suite()
65 {
66 return new TestSuite(JobEntryTest.class);
67 }
68
69 /***
70 * Tests the ability to enable and disable the service.
71 */
72 public void testCompareTo()
73 {
74 assertFalse(je1.equals(je2));
75 je2.setJobId(je1.getJobId());
76 assertTrue(je1.equals(je2));
77
78 }
79
80 }