* Tests adding an endpoint interface.
*/
public void testAddEndpointInterface() throws Exception {
EnunciateFreemarkerModel model = new EnunciateFreemarkerModel();
int originalNSSize = model.getNamespacesToPrefixes().size();
EndpointInterface ei1 = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.NamespacedWebService"));
String targetNamespace = ei1.getTargetNamespace();
model.add(ei1);
assertNotNull(model.getNamespacesToPrefixes().get(targetNamespace));
WsdlInfo wsdlInfo = model.getNamespacesToWSDLs().get(targetNamespace);
assertNotNull("The model should have created a wsdl information associated with a new endpoint interface.", wsdlInfo);
assertTrue(model.endpointInterfaces.contains(ei1));
assertTrue(wsdlInfo.getEndpointInterfaces().contains(ei1));
assertEquals(targetNamespace, wsdlInfo.getTargetNamespace());
EndpointInterface ei2 = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.NoNamespaceWebServiceImpl"));
targetNamespace = ei2.getTargetNamespace();
model.add(ei2);
assertNotNull(model.getNamespacesToPrefixes().get(targetNamespace));
wsdlInfo = model.getNamespacesToWSDLs().get(targetNamespace);
assertNotNull("The model should have created a wsdl information associated with a new endpoint interface.", wsdlInfo);
assertTrue(model.endpointInterfaces.contains(ei2));
assertTrue(wsdlInfo.getEndpointInterfaces().contains(ei2));
assertEquals(targetNamespace, wsdlInfo.getTargetNamespace());
EndpointInterface ei3 = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.SuperNoNamespaceWebServiceImpl"));
targetNamespace = ei3.getTargetNamespace();
model.add(ei3);
assertNotNull(model.getNamespacesToPrefixes().get(targetNamespace));
wsdlInfo = model.getNamespacesToWSDLs().get(targetNamespace);
assertNotNull("The model should have created a wsdl information associated with a new endpoint interface.", wsdlInfo);
assertTrue(model.endpointInterfaces.contains(ei3));