View Javadoc
1   package org.kuali.ole;
2   
3   /**
4    * Created by IntelliJ IDEA.
5    * User: palanivel
6    * Date: 3/8/12
7    * Time: 7:31 PM
8    * To change this template use File | Settings | File Templates.
9    */
10  
11  import org.kuali.ole.pojo.edi.CurrencyDetailsSupplierInformation;
12  
13  public enum CurrencyDetailsSupplierInformationFixture {
14      CurrencyDetailsSupplierInformation("2",
15              "USD",
16              "9"
17      ),;
18  
19      private String defaultCurrency;
20      private String currencyType;
21      private String orderCurrency;
22  
23      private CurrencyDetailsSupplierInformationFixture(String defaultCurrency, String currencyType,
24                                                        String orderCurrency) {
25          this.defaultCurrency = defaultCurrency;
26          this.currencyType = currencyType;
27          this.orderCurrency = orderCurrency;
28      }
29  
30      public CurrencyDetailsSupplierInformation createCurrencyDetailsSupplierInformation(Class clazz) {
31          CurrencyDetailsSupplierInformation currencyDetailsSupplierInformation = null;
32          try {
33              currencyDetailsSupplierInformation = (CurrencyDetailsSupplierInformation) clazz.newInstance();
34          } catch (InstantiationException e) {
35              throw new RuntimeException("CurrencyDetailsSupplierInformation creation failed. class = " + clazz);
36          } catch (IllegalAccessException e) {
37              throw new RuntimeException("CurrencyDetailsSupplierInformation creation failed. class = " + clazz);
38          }
39          currencyDetailsSupplierInformation.setDefaultCurrency(defaultCurrency);
40          currencyDetailsSupplierInformation.setCurrencyType(currencyType);
41          currencyDetailsSupplierInformation.setOrderCurrency(orderCurrency);
42          return currencyDetailsSupplierInformation;
43      }
44  
45  }