View Javadoc

1   /**
2    * Copyright 2004-2013 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.kpme.tklm.time.summary;
17  
18  import java.math.BigDecimal;
19  import java.util.Map;
20  
21  import org.joda.time.DateTime;
22  import org.junit.Assert;
23  import org.junit.Test;
24  import org.kuali.kpme.core.IntegrationTest;
25  import org.kuali.kpme.tklm.TKLMIntegrationTestCase;
26  import org.kuali.kpme.tklm.time.timeblock.TimeBlock;
27  import org.kuali.kpme.tklm.time.timehourdetail.TimeHourDetail;
28  import org.kuali.kpme.tklm.utils.TkTestUtils;
29  
30  @IntegrationTest
31  public class TimeSummaryTest extends TKLMIntegrationTestCase {
32  
33  	@Test
34  	public void testTimeBlockTimeHourDetailBreakup() throws Exception{
35  		DateTime beginTime = new DateTime(2010, 1, 2, 1, 0, 0, 0);
36  		DateTime endTime = new DateTime(2010, 1, 4, 2, 0, 0, 0);
37  		
38  		TimeBlock timeBlock = new TimeBlock();
39  		timeBlock.setBeginDateTime(beginTime);
40  		timeBlock.setEndDateTime(endTime);
41  		
42  		TimeHourDetail timeHourDetail = new TimeHourDetail();
43  		
44  		Map<DateTime, BigDecimal> timeToHrs = TkTestUtils.getDateToHoursMap(timeBlock, timeHourDetail);
45  		Assert.assertTrue(timeToHrs!=null);
46  	}
47  	
48  }