1
2
3
4
5
6
7
8
9
10
11
12
13
14
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 }