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.gl.bo;
17:
18: import org.kuali.kfs.context.KualiTestBase;
19: import org.kuali.test.ConfigureContext;
20:
21: /**
22: * A basic test of origin entry, making sure that line parsing works as expected
23: */
24: @ConfigureContext
25: public class OriginEntryTest extends KualiTestBase {
26:
27: /**
28: * Constructs a OriginEntryTest instance
29: */
30: public OriginEntryTest() {
31: super ();
32: }
33:
34: /**
35: * Tests that converting String-formatted origin entries to origin entries to String-formatted entries again
36: * has the expected format
37: *
38: * @throws Exception thrown if the parsing of the entry went really really bad? It's doubtful this exception will ever be thrown for this test
39: */
40: public void testGetLine() throws Exception {
41:
42: String line = null;
43:
44: line = "2007BL4131407-----4100---ACEX07TOPSLGEXPIRCGAC CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ";
45: String convertedLine = "2007BL4131407-----4100---ACEX07TOPSLGEXPIRCGAC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ";
46: assertEquals(convertedLine, new OriginEntryFull(line).getLine());
47:
48: line = "2007BL4131407-----4100---ACEX07TOPSLGEXPIRCGAC 00000CONCERTO OFFICE PRODUCTS 48.53C2006-01-05 ---------- ";
49: assertEquals(line, new OriginEntryFull(line).getLine());
50:
51: line = "2007BL4131407-----9041---ACLI07TOPSLGEXPIRCGAC 12345CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- ";
52: assertEquals(line, new OriginEntryFull(line).getLine());
53:
54: line = "2007BL4131407-----9041---ACLI07TOPSLGEXPIRCGAC 00045CONCERTO OFFICE PRODUCTS 48.53D2006-01-05 ---------- ";
55: assertEquals(line, new OriginEntryFull(line).getLine());
56:
57: }
58:
59: }
|