1 package org.kuali.ole.deliver;
2
3 import org.junit.Before;
4 import org.junit.Test;
5 import org.junit.runner.RunWith;
6 import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader;
7 import org.kuali.rice.krad.service.BusinessObjectService;
8 import org.kuali.rice.krad.service.KRADServiceLocator;
9 import org.springframework.test.context.ContextConfiguration;
10 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
11 import org.springframework.test.context.transaction.TransactionConfiguration;
12
13 import java.util.Iterator;
14 import java.util.List;
15
16 import static junit.framework.Assert.assertNotNull;
17 import static junit.framework.Assert.assertTrue;
18
19
20
21
22
23
24
25
26 @ContextConfiguration(locations = {"classpath:/SpringBeans.xml"})
27 @RunWith(value = SpringJUnit4ClassRunner.class)
28 @TransactionConfiguration(defaultRollback = true)
29 public class LoadDefaultCirculationPoliciesBean_UT {
30 protected LoadDefaultCirculationPoliciesBean loadDefaultCirculationPoliciesBean;
31 private BusinessObjectService businessObjectService;
32
33 @Before
34 public void setUp() throws Exception {
35 businessObjectService = KRADServiceLocator.getBusinessObjectService();
36 loadDefaultCirculationPoliciesBean = GlobalResourceLoader.getService("loadDefaultCirculationPoliciesBean");
37 }
38
39 @Test
40 public void loadDefaultLocations() throws Exception {
41 List<String> policies = loadDefaultCirculationPoliciesBean.loadDefaultCircPolicies();
42 assertNotNull(policies);
43 assertTrue(!policies.isEmpty());
44 for (Iterator<String> iterator = policies.iterator(); iterator.hasNext(); ) {
45 String policy = iterator.next();
46 System.out.println(policy);
47 }
48 }
49 }