01: /*
02: * Copyright 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.batch;
17:
18: import java.io.File;
19:
20: import org.kuali.kfs.context.KualiTestBase;
21: import org.kuali.kfs.context.SpringContext;
22: import org.kuali.module.financial.batch.pcard.ProcurementCardInputFileType;
23: import org.kuali.test.ConfigureContext;
24:
25: /**
26: * Tests the PcdoLoadStep. DEPENDENCIES: Procurement card xml file transaction1.xml must be in /opt/kuali/dev/staging/PCDO/ this
27: * file can be obtained by running the project's ant dist-local, or copying from build/externalConfigDirectory/static/staging/PCDO/
28: */
29: @ConfigureContext
30: public class PcdoLoadStepTest extends KualiTestBase {
31: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
32: .getLogger(PcdoLoadStepTest.class);
33:
34: public PcdoLoadStepTest() {
35: super ();
36: }
37:
38: /**
39: * Creats .done file for test input file.
40: *
41: * @see junit.framework.TestCase#setUp()
42: */
43: @Override
44: protected void setUp() throws Exception {
45: super .setUp();
46:
47: String doneFileName = SpringContext.getBean(
48: ProcurementCardInputFileType.class).getDirectoryPath()
49: + "/transactions1.done";
50: File doneFile = new File(doneFileName);
51: if (!doneFile.exists()) {
52: LOG.info("Creating done file: "
53: + doneFile.getAbsolutePath());
54: doneFile.createNewFile();
55: }
56: }
57:
58: /**
59: * Tests the whole step completes successfully.
60: */
61: public void testAll() throws Exception {
62: assertTrue("hold until figure out staging dir!", true);
63: //
64: // PcdoLoadStep pcdoLoadStep = SpringContext.getBean(PcdoLoadStep.class);
65: // boolean goodExit = pcdoLoadStep.execute();
66: //
67: // assertTrue("pcdo load step did not exit with pass", goodExit);
68: //
69: // Collection loadedTransactions =
70: // SpringContext.getBean(BusinessObjectService.class).findAll(ProcurementCardTransaction.class);
71: // assertNotNull("no transactions loaded ", loadedTransactions);
72: // assertEquals("incorrect number of transactions loaded ",10,loadedTransactions.size());
73: }
74: }
|