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.module.financial.bo;
17:
18: import java.sql.Date;
19:
20: import org.kuali.core.service.DateTimeService;
21: import org.kuali.core.util.KualiDecimal;
22: import org.kuali.kfs.context.KualiTestBase;
23: import org.kuali.kfs.context.SpringContext;
24: import org.kuali.test.ConfigureContext;
25:
26: /**
27: * This class...
28: */
29: @ConfigureContext
30: public class CheckBaseTest extends KualiTestBase {
31: private CheckBase crchk = null;
32: private static final KualiDecimal AMOUNT = new KualiDecimal(
33: "100.27");
34: private static final String GUID = "123456789012345678901234567890123456";
35: private static final Long VER_NBR = new Long(1);
36: private static Date date;
37: private static final String CHECK_NUMBER = "123456";
38: private static final String DESCRIPTION = "Description 123.";
39: private static final String DOC_HDR_ID = "999999";
40: private static final Integer SEQ_ID = new Integer(1);
41: private static final Integer DEPOSIT_LINE_NUMBER = new Integer(1);
42: private static final String DOCUMENT_TYPE = "CR";
43: private static final String CASHIERING_SOURCE = "R";
44:
45: @Override
46: protected void setUp() throws Exception {
47: super .setUp();
48: date = new Date(SpringContext.getBean(DateTimeService.class)
49: .getCurrentDate().getTime());
50: crchk = new CheckBase();
51: crchk.setAmount(AMOUNT);
52: crchk.setCheckDate(date);
53: crchk.setCheckNumber(CHECK_NUMBER);
54: crchk.setDescription(DESCRIPTION);
55: crchk.setDocumentNumber(DOC_HDR_ID);
56: crchk
57: .setFinancialDocumentDepositLineNumber(DEPOSIT_LINE_NUMBER);
58: crchk.setObjectId(GUID);
59: crchk.setSequenceId(SEQ_ID);
60: crchk.setVersionNumber(VER_NBR);
61: crchk.setCashieringRecordSource(CASHIERING_SOURCE);
62: crchk.setFinancialDocumentTypeCode(DOCUMENT_TYPE);
63: }
64:
65: public void testCashReceiptCheckPojo() {
66: assertEquals(AMOUNT, crchk.getAmount());
67: assertEquals(date, crchk.getCheckDate());
68: assertEquals(CHECK_NUMBER, crchk.getCheckNumber());
69: assertEquals(DESCRIPTION, crchk.getDescription());
70: assertEquals(DOC_HDR_ID, crchk.getDocumentNumber());
71: assertEquals(DEPOSIT_LINE_NUMBER, crchk
72: .getFinancialDocumentDepositLineNumber());
73: assertEquals(GUID, crchk.getObjectId());
74: assertEquals(SEQ_ID, crchk.getSequenceId());
75: assertEquals(VER_NBR, crchk.getVersionNumber());
76: assertEquals(DOCUMENT_TYPE, crchk
77: .getFinancialDocumentTypeCode());
78: assertEquals(CASHIERING_SOURCE, crchk
79: .getCashieringRecordSource());
80: }
81: }
|