View Javadoc

1   /**
2    * Copyright 2004-2014 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
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.kpme.tklm.leave.transfer;
17  
18  import static org.junit.Assert.assertTrue;
19  
20  import java.util.HashMap;
21  
22  import org.junit.After;
23  import org.junit.Before;
24  import org.junit.Test;
25  import org.kuali.kpme.core.IntegrationTest;
26  import org.kuali.kpme.tklm.TKLMIntegrationTestCase;
27  import org.kuali.rice.krad.service.BusinessObjectService;
28  import org.kuali.rice.krad.service.KRADServiceLocator;
29  
30  @IntegrationTest
31  public class BalanceTransferValidationTest extends TKLMIntegrationTestCase {
32  
33  	private BusinessObjectService boService;
34  	
35  	@Before
36  	public void setUp() throws Exception {
37  		super.setUp();
38      	boService = KRADServiceLocator.getBusinessObjectService();
39      	clearBusinessObjects(BalanceTransfer.class);
40  	}
41  	
42  	@After
43  	public void tearDown() throws Exception {
44  		super.tearDown();
45  	}
46  	
47  	@Test
48  	public void testOverMaxCarryOver() throws Exception{
49  		assertTrue("Dummy assertion", true);
50  	}
51  	
52  	/*
53  	@Test
54  	public void testAtMaxCarryOver() throws Exception{
55  		assertTrue(true);
56  	}
57  	
58  	@Test
59  	public void testUnderMaxBalanceBalanceTransfer() throws Exception{
60  		//ensure that balance transfer isn't triggered by accrual categories whose balance is
61  		//less than the max balance.
62  		//Exception could be balance transfers for termination/retirement where max balance
63  		//is not yet reached.
64  		assertTrue(true);
65  	}
66  	
67  	@Test
68  	public void testOverMaxBalanceBalanceTransfer() throws Exception{
69  		assertTrue(true);
70  	}
71  	
72  	@Test
73  	public void testAtMaxBalanceBalanceTransfer() throws Exception{
74  		assertTrue(true);
75  	}
76  	
77  	@Test
78  	public void testBalanceTransferOfPartialFTE() throws Exception{
79  		//TODO: Balance transfer test of employee having more than one leave eligible job
80  		// but whose FTE is less than one.
81  		assertTrue(true);
82  	}
83  	
84  	@Test
85  	public void testBalanceTransferOfPartialFTECase2() throws Exception{
86  		//TODO: Balance transfer test of employee having more than one leave eligible job
87  		// and whose FTE is 1
88  		assertTrue(true);
89  	}
90  	
91  	@Test
92  	public void testBalanceTransferOfNonFTEEmployee() throws Exception{
93  		//TODO: Balance transfer should not be available for employee having no leave
94  		// eligible job (FTE=0)
95  		assertTrue(true);
96  	}
97  	*/
98  	
99  //	/**
100 //	 * Following tests should be moved to leave calendar to test on-demand balance transfers and payouts.
101 //	 */
102 //	@Test
103 //	public void testOnDemandBalanceTransfer() throws Exception{
104 //		//TODO: Check to make sure that the "Transfer" button appears when max balance
105 //		// is reached for a transfer with action frequency "On-Demand" and action "Transfer"
106 //		// is in effect for accrual category.
107 //		assertTrue(true);
108 //	}
109 //	
110 //	@Test
111 //	public void testOnDemandBalancePayout() throws Exception{
112 //		//TODO: Check to make sure that the "Payout" button appears when max balance
113 //		// is reached for a transfer with action frequency "On-Demand" and action "payout"
114 //		// is in effect for accrual category.
115 //		assertTrue(true);
116 //	}
117 //	
118 //	@Test
119 //	public void testOnDemandBalanceTransferForMultipleAccrualCategories() throws Exception{
120 //		//TODO: Test that the "Transfer" button correctly displays when more than one accrual
121 //		// category reach max balance simultaneously.
122 //		assertTrue(true);
123 //	}
124 //	
125 //	@Test
126 //	public void testOnDemandBalancePayoutForMultipleAccrualCategories() throws Exception{
127 //		//TODO: Test that the "Payout" button displays correctly when more than one accrual
128 //		// category reach max balance simultaneously.
129 //		assertTrue(true);
130 //	}
131 //	
132 //	/**
133 //	 * The following tests require setting up scenarios that occur on the set
134 //	 * of possible max balance action frequencies. The result of each test should
135 //	 * be dependent upon a balance transfer document correctly being created for each
136 //	 * scenario.
137 //	 */
138 //	@Test
139 //	public void testLeaveApproveBalanceTransferService() throws Exception{
140 //		/**
141 //		 * TODO: Create the scenario where a balance TRANSFER should occur
142 //		 * on max balance action frequency of "leave approval".
143 //		 * Upon submitting a leave calendar document for approval,
144 //		 * the user should be prompted for approval of balance TRANSFER
145 //		 * according to the accrual categories max balance rules.
146 //		 * A successful test would check that, upon affirmative action by the
147 //		 * user, a balance transfer document should be created, and the
148 //		 * balances of the respective accrual categories should reflect
149 //		 * values in-line with the transfer AND accrual category rules.
150 //		 * (i.e. the max balance conversion factor ).
151 //		 */
152 //		assertTrue(true);
153 //	}
154 //	
155 //	@Test
156 //	public void testLeaveApprovalBalancePayoutService() throws Exception{
157 //		/**
158 //		 * TODO: Create the scenario where a balance PAYOUT should occur
159 //		 * on max balance action frequency of "leave approval".
160 //		 * Upon submitting a leave calendar document for approval,
161 //		 * the user should be prompted for approval of balance PAYOUT
162 //		 * according to the accrual categories max balance rules.
163 //		 * A successful test would check that, upon affirmative action by the
164 //		 * user, a balance transfer document is created, and the
165 //		 * balances of the respective accrual categories should reflect
166 //		 * values in-line with the transfer AND accrual category rules.
167 //		 * (i.e. the max balance conversion factor ).
168 //		 */	
169 //		assertTrue(true);
170 //	}
171 //	
172 //	@Test
173 //	public void testYearEndBalanceTransferService() throws Exception{
174 //		/**
175 //		 * TODO: Create the scenario where a balance transfer should occur
176 //		 * on max balance action frequency of "YEAR END".
177 //		 * Upon submitting the final leave calendar document for approval,
178 //		 * the user should be prompted for approval of balance transfer
179 //		 * according to the accrual categories max balance rules.
180 //		 * A successful test would check that, upon affirmative action by the
181 //		 * user, a balance transfer document should be created, and the
182 //		 * balances of the respective accrual categories should reflect
183 //		 * values in-line with the transfer AND accrual category rules.
184 //		 * (i.e. the max balance conversion factor ).
185 //		 */
186 //		assertTrue(true);
187 //	}
188 //	
189 //	@Test
190 //	public void testYearEndBalancePayoutService() throws Exception {
191 //		/**
192 //		 * TODO: Create the scenario where a balance PAYOUT should occur
193 //		 * on max balance action frequency of "YEAR END".
194 //		 * Upon submitting a leave calendar document for approval,
195 //		 * the user should be prompted for approval of balance PAYOUT
196 //		 * according to the accrual categories max balance rules.
197 //		 * A successful test would check that, upon affirmative action by the
198 //		 * user, a balance transfer document should be created, and the
199 //		 * balances of the respective accrual categories should reflect
200 //		 * values in-line with the transfer AND accrual category rules.
201 //		 * (i.e. the max balance conversion factor ).
202 //		 * For successful payout, the test must check that a new, previously defined earn code
203 //		 * should exist for the user, and that this earn code is available for use.
204 //		 */
205 //		assertTrue(true);
206 //	}
207 	
208     @SuppressWarnings("unchecked")
209     public void clearBusinessObjects(Class clazz) {
210     	boService.deleteMatching(clazz, new HashMap());
211     }
212 }