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.kfs.batch;
17:
18: import static org.kuali.test.fixtures.UserNameFixture.KULUSER;
19:
20: import org.kuali.core.document.Document;
21: import org.kuali.core.service.DocumentService;
22: import org.kuali.kfs.context.KualiTestBase;
23: import org.kuali.kfs.context.SpringContext;
24: import org.kuali.test.ConfigureContext;
25:
26: import edu.iu.uis.eden.exception.WorkflowException;
27:
28: /**
29: * This class tests the class {@link PurgeDocumentContentsStep}
30: */
31: @ConfigureContext(session=KULUSER)
32: public class PurgeDocumentContentsStepTest extends KualiTestBase {
33: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
34: .getLogger(PurgeDocumentContentsStepTest.class);
35:
36: private static final String INTERNAL_BILLING_DOCUMENT_TYPE_NAME = "InternalBillingDocument";
37: private static final String MAINTENANCE_DOCUMENT_TYPENAME = "AccountMaintenanceDocument";
38:
39: /**
40: * Constructs a PurgeDocumentContentStepTest.java.
41: */
42: public PurgeDocumentContentsStepTest() {
43: super ();
44: }
45:
46: public final void testSetDocumentContent() throws Exception {
47: PurgeDocumentContentsStep purgeDocumentContentsStep = SpringContext
48: .getBean(PurgeDocumentContentsStep.class);
49: Document document = SpringContext
50: .getBean(DocumentService.class).getNewDocument(
51: INTERNAL_BILLING_DOCUMENT_TYPE_NAME);
52: try {
53: purgeDocumentContentsStep
54: .setFinalDocumentDocumentContent(document
55: .getDocumentHeader());
56: } catch (WorkflowException e) {
57: LOG.error("Caught WorkflowException", e);
58: fail();
59: }
60: }
61:
62: }
|