    001    package org.apache.turbine.services.schedule;
    002
    003    /*
    004     * Licensed to the Apache Software Foundation (ASF) under one
    005     * or more contributor license agreements.  See the NOTICE file
    006     * distributed with this work for additional information
    007     * regarding copyright ownership.  The ASF licenses this file
    008     * to you under the Apache License, Version 2.0 (the
    009     * "License"); you may not use this file except in compliance
    010     * with the License.  You may obtain a copy of the License at
    011     *
    012     *   http://www.apache.org/licenses/LICENSE-2.0
    013     *
    014     * Unless required by applicable law or agreed to in writing,
    015     * software distributed under the License is distributed on an
    016     * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    017     * KIND, either express or implied.  See the License for the
    018     * specific language governing permissions and limitations
    019     * under the License.
    020     */
    021
    022    import junit.framework.Test;
    023    import junit.framework.TestCase;
    024    import junit.framework.TestSuite;
    025
    026    //import org.apache.turbine.test.BaseTestCase;
    027
    028    /**
    029     * Unit testing for Job Entries.  Ensure that removing NumberKey from TurbineNonPersistentScheduler
    030     * still works.
    031     *
    032     * @author <a href="mailto:epugh@upstate.com">Eric Pugh</a>
    033     * @version $Id: JobEntryTest.java 615328 2008-01-25 20:25:05Z tv $
    034     */
    035    public class JobEntryTest extends TestCase
    036    {
    037
    038        private JobEntry je1;
    039        private JobEntry je2;
    040
    041        public JobEntryTest(String name)
    042                throws Exception
    043        {
    044            super(name);
    045
    046            // Add a new job entry
    047            je1 = new JobEntry();
    048            je1.setJobId(1);
    049            je1.setSecond(0);
    050            je1.setMinute(1);
    051            je1.setHour(-1);
    052            je1.setDayOfMonth(-1);
    053            je1.setWeekDay(-1);
    054            je1.setTask("SimpleJob");
    055
    056            je2 = new JobEntry();
    057            je2.setJobId(2);
    058            je2.setSecond(0);
    059            je2.setMinute(1);
    060            je2.setHour(-1);
    061            je2.setDayOfMonth(-1);
    062            je2.setWeekDay(-1);
    063            je2.setTask("SimpleJob");
    064        }
    065
    066        public static Test suite()
    067        {
    068            return new TestSuite(JobEntryTest.class);
    069        }
    070
    071        /**
    072         * Tests the ability to enable and disable the service.
    073         */
    074        public void testCompareTo()
    075        {
    076            assertFalse(je1.equals(je2));
    077            je2.setJobId(je1.getJobId());
    078            assertTrue(je1.equals(je2));
    079
    080        }
    081
    082    }