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 org.junit.Ignore;
19  import org.kuali.rice.core.api.config.property.ConfigContext;
20  import org.kuali.rice.kim.api.KimApiConstants;
21  import org.kuali.rice.ksb.api.KsbApiServiceLocator;
22  import org.kuali.rice.ksb.api.bus.Endpoint;
23  import org.kuali.rice.ksb.api.bus.ServiceBus;
24  import org.kuali.rice.test.BaselineTestCase;
25  
26  import javax.xml.namespace.QName;
27  import java.util.List;
28  
29  import static org.junit.Assert.fail;
30  
31  
32  
33  
34  
35  
36  
37  @BaselineTestCase.BaselineMode(BaselineTestCase.Mode.ROLLBACK_CLEAR_DB)
38  public class GroupServiceRemoteTest extends GroupServiceTest {
39  
40  	public void setUp() throws Exception {
41  		super.setUp();
42  	}
43  
44  	
45  
46  
47  
48  	
49  	private int getConfigIntProp(String intPropKey) {
50  		return Integer.parseInt(getConfigProp(intPropKey));
51  	}
52  
53  	private String getConfigProp(String propKey) {
54  		return ConfigContext.getCurrentContextConfig().getProperty(propKey);
55  	}
56  	
57  	
58  
59  
60  
61  
62  
63  
64  	protected Object getKimService(String svcName) throws Exception {
65  		ServiceBus serviceBus = KsbApiServiceLocator.getServiceBus();
66  		List<Endpoint> endpoints = serviceBus.getRemoteEndpoints(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  }