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.bo;
17:
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: import org.kuali.core.util.KualiInteger;
22: import org.kuali.kfs.context.KualiTestBase;
23: import org.kuali.module.kra.budget.bo.BudgetNonpersonnel;
24: import org.kuali.module.kra.budget.bo.NonpersonnelObjectCode;
25: import org.kuali.test.ConfigureContext;
26:
27: /**
28: * This class tests methods in BudgetNonpersonnelCopyOverFormHelper.
29: */
30: @ConfigureContext
31: public class BudgetNonpersonnelTest extends KualiTestBase {
32:
33: public void testBudgetNonpersonnel() {
34: assertTrue(true);
35: }
36:
37: public static List createBudgetNonpersonnel(
38: String[] nonpersonnelCategories, String[] subCategories,
39: String[] subcontractorNumber) {
40: List budgetNonpersonnelList = new ArrayList();
41:
42: if (nonpersonnelCategories.length != subCategories.length) {
43: throw new IllegalArgumentException(
44: "nonpersonnelCategories and subCategories must equal in length");
45: }
46:
47: for (int i = 0; i < nonpersonnelCategories.length; i++) {
48: BudgetNonpersonnel budgetNonpersonnel = new BudgetNonpersonnel();
49: budgetNonpersonnel
50: .setBudgetNonpersonnelSequenceNumber(new Integer(i));
51: budgetNonpersonnel
52: .setBudgetPeriodSequenceNumber(new Integer(0));
53: budgetNonpersonnel.setBudgetTaskSequenceNumber(new Integer(
54: 0));
55:
56: budgetNonpersonnel
57: .setSubcontractorNumber(subcontractorNumber[i]);
58:
59: budgetNonpersonnel
60: .setBudgetNonpersonnelCategoryCode(nonpersonnelCategories[i]);
61: budgetNonpersonnel
62: .setBudgetNonpersonnelSubCategoryCode(subCategories[i]);
63: budgetNonpersonnel
64: .setNonpersonnelObjectCode(new NonpersonnelObjectCode(
65: nonpersonnelCategories[i], subCategories[i]));
66:
67: budgetNonpersonnel.setCopyToFuturePeriods(false);
68: budgetNonpersonnel.setAgencyCopyIndicator(false);
69: budgetNonpersonnel
70: .setBudgetInstitutionCostShareCopyIndicator(false);
71: budgetNonpersonnel
72: .setBudgetThirdPartyCostShareCopyIndicator(false);
73:
74: budgetNonpersonnel.setAgencyRequestAmount(new KualiInteger(
75: 1000));
76: budgetNonpersonnel
77: .setBudgetInstitutionCostShareAmount(new KualiInteger(
78: 2000));
79: budgetNonpersonnel
80: .setBudgetThirdPartyCostShareAmount(new KualiInteger(
81: 3000));
82:
83: budgetNonpersonnel.setBudgetOriginSequenceNumber(null);
84:
85: budgetNonpersonnelList.add(budgetNonpersonnel);
86: }
87:
88: return budgetNonpersonnelList;
89: }
90: }
|