}
public void testAddWsdlWithEndpoints() throws Exception {
WsdlManager wsdlManager = new WsdlManager(registry);
Wsdl wsdl = wsdlManager.newWsdl("http://svn.wso2.org/repos/wso2/trunk/carbon/components/governance/org.wso2.carbon.governance.api/src/test/resources/test-resources/wsdl/BizService.wsdl");
wsdlManager.addWsdl(wsdl);
Endpoint[] endpoints = wsdl.getAttachedEndpoints();
assertEquals(1, endpoints.length);
assertEquals("http://localhost:8080/axis2/services/BizService", endpoints[0].getUrl());
assertEquals(1, endpoints[0].getAttributeKeys().length);
assertEquals("true", endpoints[0].getAttribute(CommonConstants.SOAP11_ENDPOINT_ATTRIBUTE));
// now we are trying to remove the endpoint
EndpointManager endpointManager = new EndpointManager(registry);
try {
endpointManager.removeEndpoint(endpoints[0].getId());
assertTrue(false);
} catch (Exception e) {
assertTrue(true);
}
GovernanceArtifact[] artifacts = wsdl.getDependents();
// delete the wsdl
wsdlManager.removeWsdl(wsdl.getId());
ServiceManager serviceManager = new ServiceManager(registry);
for (GovernanceArtifact artifact: artifacts) {
if (artifact instanceof Service) {