01: /*
02: * Copyright 2005-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.bo;
17:
18: import java.sql.Date;
19:
20: import org.kuali.core.service.DateTimeService;
21: import org.kuali.kfs.context.KualiTestBase;
22: import org.kuali.kfs.context.SpringContext;
23: import org.kuali.module.chart.bo.AccountingPeriod;
24: import org.kuali.test.ConfigureContext;
25:
26: /**
27: * This class tests the AccountingPeriod business object.
28: */
29: @ConfigureContext
30: public class AccountingPeriodTest extends KualiTestBase {
31: AccountingPeriod ap;
32: public static final boolean BUDGET_ROLLOVER_IND = true;
33: public static final String GUID = "123456789012345678901234567890123456";
34: public static final String UNIV_FISC_PERD_CODE = "BB";
35: public static Date univFiscPerdEndDate;
36: public static final Integer UNIV_FISC_YEAR = new Integer(2005);
37: public static final String UNIV_FISC_PRD_NAME = "JAN. 1776";
38: public static final String UNIV_FISC_PRD_STATUS_CODE = "C";
39: public static final Long VER_NBR = new Long(1);
40:
41: @Override
42: protected void setUp() throws Exception {
43: super .setUp();
44: univFiscPerdEndDate = new java.sql.Date(SpringContext.getBean(
45: DateTimeService.class).getCurrentDate().getTime());
46: ap = new AccountingPeriod();
47: ap.setBudgetRolloverIndicator(BUDGET_ROLLOVER_IND);
48: ap.setObjectId(GUID);
49: ap.setUniversityFiscalPeriodCode(UNIV_FISC_PERD_CODE);
50: ap.setUniversityFiscalPeriodEndDate(univFiscPerdEndDate);
51: ap.setUniversityFiscalPeriodName(UNIV_FISC_PRD_NAME);
52: ap
53: .setUniversityFiscalPeriodStatusCode(UNIV_FISC_PRD_STATUS_CODE);
54: ap.setUniversityFiscalYear(UNIV_FISC_YEAR);
55: ap.setVersionNumber(VER_NBR);
56: }
57:
58: public void testAccountingPeriodPojo() {
59: assertEquals(BUDGET_ROLLOVER_IND, ap
60: .isBudgetRolloverIndicator());
61: assertEquals(GUID, ap.getObjectId());
62: assertEquals(UNIV_FISC_PERD_CODE, ap
63: .getUniversityFiscalPeriodCode());
64: assertEquals(univFiscPerdEndDate, ap
65: .getUniversityFiscalPeriodEndDate());
66: assertEquals(UNIV_FISC_PRD_NAME, ap
67: .getUniversityFiscalPeriodName());
68: assertEquals(UNIV_FISC_PRD_STATUS_CODE, ap
69: .getUniversityFiscalPeriodStatusCode());
70: assertEquals(UNIV_FISC_YEAR, ap.getUniversityFiscalYear());
71: assertEquals(VER_NBR, ap.getVersionNumber());
72: }
73:
74: }
|