    001package org.apache.turbine.services.schedule;
    002
    003import static org.junit.Assert.assertEquals;
    004import static org.junit.Assert.assertNotEquals;
    005
    006import org.junit.Before;
    007import org.junit.Test;
    008
    009/*
    010 * Licensed to the Apache Software Foundation (ASF) under one
    011 * or more contributor license agreements.  See the NOTICE file
    012 * distributed with this work for additional information
    013 * regarding copyright ownership.  The ASF licenses this file
    014 * to you under the Apache License, Version 2.0 (the
    015 * "License"); you may not use this file except in compliance
    016 * with the License.  You may obtain a copy of the License at
    017 *
    018 *   http://www.apache.org/licenses/LICENSE-2.0
    019 *
    020 * Unless required by applicable law or agreed to in writing,
    021 * software distributed under the License is distributed on an
    022 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    023 * KIND, either express or implied.  See the License for the
    024 * specific language governing permissions and limitations
    025 * under the License.
    026 */
    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 */
    035public class JobEntryTest
    036{
    037
    038    private JobEntry je1;
    039    private JobEntry je2;
    040
    041    @Before
    042    public void setUpBefore() throws Exception
    043    {
    044
    045        // Add a new job entry
    046        je1 = new JobEntryNonPersistent();
    047        je1.setJobId(1);
    048
    049        je2 = new JobEntryNonPersistent();
    050        je2.setJobId(2);
    051    }
    052
    053
    054    /**
    055     * Tests if the job entries are comparable
    056     */
    057    @Test public void testCompareTo()
    058    {
    059        assertNotEquals(je1.compareTo(je2), 0);
    060        je2.setJobId(je1.getJobId());
    061        assertEquals(je1.compareTo(je2), 0);
    062
    063    }
    064
    065}