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.vendor.fixtures;
17:
18: import java.util.ArrayList;
19: import java.util.List;
20:
21: import org.kuali.module.vendor.bo.VendorAddress;
22: import org.kuali.module.vendor.fixtures.VendorTestConstants.FaxNumbers;
23:
24: public enum VendorRuleFaxNumberFixture {
25:
26: TWO_DEFAULT_FORMATS(FaxNumbers.defaultFormat,
27: FaxNumbers.defaultFormat), TWO_SHORT_FAXES(
28: FaxNumbers.shortFax, FaxNumbers.shortFax), ONE_DEFAULT_ONE_SHORT_FAX(
29: FaxNumbers.defaultFormat, FaxNumbers.shortFax), ;
30:
31: public final String fax1;
32: public final String fax2;
33:
34: VendorRuleFaxNumberFixture(String fax1, String fax2) {
35: this .fax1 = fax1;
36: this .fax2 = fax2;
37: }
38:
39: /**
40: * This method does the setup for the tests which examine the implementation of the requirement that the fax numbers in the
41: * VendorAddress collection must be of a valid format
42: *
43: * @param fax1 A fax number in String form
44: * @param fax2 Another fax number in String form
45: * @return A List<VendorAddress>, appropriately populated with fax numbers.
46: */
47: public List<VendorAddress> getAddresses() {
48: List<VendorAddress> addrList = new ArrayList();
49: VendorAddress addr1 = new VendorAddress();
50: VendorAddress addr2 = new VendorAddress();
51: addr1.setVendorFaxNumber(fax1);
52: addr2.setVendorFaxNumber(fax2);
53: addrList.add(addr1);
54: addrList.add(addr2);
55: return addrList;
56: }
57:
58: }
|