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