01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
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.module.kra.service;
17:
18: import java.sql.Date;
19: import java.text.SimpleDateFormat;
20:
21: import org.kuali.core.util.KualiDecimal;
22: import org.kuali.kfs.context.KualiTestBase;
23: import org.kuali.module.kra.budget.bo.BudgetPeriod;
24: import org.kuali.module.kra.budget.bo.BudgetUser;
25: import org.kuali.test.ConfigureContext;
26:
27: /**
28: * This class...
29: */
30: @ConfigureContext
31: public class BudgetPersonnelServiceTest extends KualiTestBase {
32:
33: private SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy");
34:
35: public void testPeriodFullFiscalYear() throws Exception {
36: KualiDecimal periodSalary;
37: BudgetUser dummyUser = new BudgetUser();
38: // dummyUser.setBaseSalary(new Long(100000));
39:
40: BudgetPeriod dummyPeriod = new BudgetPeriod();
41: dummyPeriod.setBudgetPeriodBeginDate(new Date(sdf.parse(
42: "07/01/2006").getTime()));
43: dummyPeriod.setBudgetPeriodEndDate(new Date(sdf.parse(
44: "06/30/2007").getTime()));
45:
46: // Fiscal year is the same as the period dates
47: // periodSalary =
48: // budgetPersonnelService.calculatePeriodSalary(dummyUser, dummyPeriod, new KualiDecimal(3));
49: // assertEquals(dummyUser.getBaseSalary(), periodSalary);
50:
51: // Fiscal year is in the future, relative to the period dates
52: // periodSalary =
53: // budgetPersonnelService.calculatePeriodSalary(dummyUser, dummyPeriod, new KualiDecimal(3));
54: // assertEquals(new KualiDecimal(103000), periodSalary);
55:
56: // Fiscal year is in the pase, relative to the period dates
57: // periodSalary = budgetPersonnelService.calculatePeriodSalary(dummyUser, dummyPeriod, new KualiDecimal(3));
58: // assertEquals(new KualiDecimal(97087.38), periodSalary);
59: }
60: }
|