1   
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  package org.kuali.rice.kim.test.service;
18  
19  import static org.junit.Assert.fail;
20  
21  import java.util.List;
22  
23  import javax.xml.namespace.QName;
24  
25  import org.kuali.rice.core.api.config.property.ConfigContext;
26  import org.kuali.rice.kim.api.KimApiConstants;
27  import org.kuali.rice.ksb.api.KsbApiServiceLocator;
28  import org.kuali.rice.ksb.api.bus.Endpoint;
29  import org.kuali.rice.ksb.api.bus.ServiceBus;
30  
31  
32  
33  
34  
35  
36  
37  public class PermissionServiceRemoteTest extends PermissionServiceTest {
38  
39  	public void setUp() throws Exception {
40  		super.setUp();
41  	}
42  
43  	
44  
45  
46  
47  	
48  	private int getConfigIntProp(String intPropKey) {
49  		return Integer.parseInt(getConfigProp(intPropKey));
50  	}
51  
52  	private String getConfigProp(String propKey) {
53  		return ConfigContext.getCurrentContextConfig().getProperty(propKey);
54  	}
55  	
56  	
57  
58  
59  
60  
61  
62  
63  	protected Object getKimService(String svcName) throws Exception {
64  		ServiceBus serviceBus = KsbApiServiceLocator.getServiceBus();
65  		List<Endpoint> endpoints = serviceBus.getRemoteEndpoints(
66                  new QName(KimApiConstants.Namespaces.KIM_NAMESPACE_2_0, svcName));
67  		if (endpoints.size() > 1) {
68  			fail("Found more than one RemotedServiceHolder for " + svcName);
69  		}
70  		Endpoint endpoint = endpoints.get(0);
71  		return endpoint.getService();
72  	}
73  }