View Javadoc

1   /**
2    * Copyright 2004-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.hr.time.calendar.service;
17  
18  import java.util.List;
19  
20  import org.junit.After;
21  import org.junit.Assert;
22  import org.junit.Before;
23  import org.junit.Test;
24  import org.kuali.hr.test.KPMETestCase;
25  import org.kuali.hr.time.calendar.CalendarEntries;
26  import org.kuali.hr.time.service.base.TkServiceLocator;
27  
28  public class CalendarEntriesServiceImplTest extends KPMETestCase {
29  	private CalendarEntriesService ceService;
30  	@Before
31  	public void setUp() throws Exception{
32  		super.setUp();
33  		ceService = TkServiceLocator.getCalendarEntriesService();
34  	}
35  
36  	@After
37  	public void tearDown() throws Exception {
38  		super.tearDown();
39  	}
40  
41  	@Test
42  	public void testGetAllCalendarEntriesForCalendarId() {
43  		List<CalendarEntries> ceList= ceService.getAllCalendarEntriesForCalendarId("2");
44  		Assert.assertNotNull("Calendar entries not found for Calendar Id '2'" , ceList);
45  		Assert.assertTrue("Calendar entries not found for Calendar Id '2'", ceList.size() != 0);
46  	}
47  	@Test
48  	public void testGetAllCalendarEntriesForCalendarIdAndYear() {
49  		List<CalendarEntries> ceList= ceService.getAllCalendarEntriesForCalendarIdAndYear("2", "2012");
50  		Assert.assertNotNull("Calendar entries not found for Calendar Id '2' and year '2012'", ceList);
51  		Assert.assertTrue("Calendar entries not found for Calendar Id 2", ceList.size() != 0);
52  	}
53  }