01: package org.apache.turbine.services.schedule;
02:
03: /*
04: * Licensed to the Apache Software Foundation (ASF) under one
05: * or more contributor license agreements. See the NOTICE file
06: * distributed with this work for additional information
07: * regarding copyright ownership. The ASF licenses this file
08: * to you under the Apache License, Version 2.0 (the
09: * "License"); you may not use this file except in compliance
10: * with the License. You may obtain a copy of the License at
11: *
12: * http://www.apache.org/licenses/LICENSE-2.0
13: *
14: * Unless required by applicable law or agreed to in writing,
15: * software distributed under the License is distributed on an
16: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17: * KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations
19: * under the License.
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: private JobEntry je1;
36: private JobEntry je2;
37:
38: public JobEntryTest(String name) throws Exception {
39: super (name);
40:
41: // Add a new job entry
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: return new TestSuite(JobEntryTest.class);
63: }
64:
65: /**
66: * Tests the ability to enable and disable the service.
67: */
68: public void testCompareTo() {
69: assertFalse(je1.equals(je2));
70: je2.setJobId(je1.getJobId());
71: assertTrue(je1.equals(je2));
72:
73: }
74:
75: }
|