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