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.test.fixtures;
17:
18: import org.kuali.core.service.BusinessObjectService;
19: import org.kuali.module.chart.bo.ObjectCode;
20:
21: public enum ObjectCodeFixture {
22: OBJECT_CODE_NON_BUDGET_OBJECT_CODE("BL", "3500", 2004), OBJECT_CODE_BUDGETED_OBJECT_CODE(
23: "BL", "3000", 2004);
24:
25: public final Integer universityFiscalYear;
26: public final String chartOfAccountsCode;
27: public final String financialObjectCode;
28:
29: private ObjectCodeFixture(String chartOfAccountsCode,
30: String financialObjectCode, Integer universityFiscalYear) {
31: this .universityFiscalYear = universityFiscalYear;
32: this .chartOfAccountsCode = chartOfAccountsCode;
33: this .financialObjectCode = financialObjectCode;
34: }
35:
36: public ObjectCode createObjectCode() {
37: ObjectCode objectCode = new ObjectCode();
38: objectCode.setUniversityFiscalYear(this .universityFiscalYear);
39: objectCode.setChartOfAccountsCode(this .chartOfAccountsCode);
40: objectCode.setFinancialObjectCode(this .financialObjectCode);
41: return objectCode;
42: }
43:
44: public ObjectCode createObjectCode(
45: BusinessObjectService businessObjectService) {
46: return (ObjectCode) businessObjectService.retrieve(this
47: .createObjectCode());
48: }
49: }
|