DefaultValidator validator = new DefaultValidator();
EndpointInterface ei = new EndpointInterface(getDeclaration("org.codehaus.enunciate.samples.services.NoNamespaceWebService"));
ClassDeclaration declaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.services.NotAWebService");
EndpointImplementation impl = new EndpointImplementation(declaration, ei);
assertTrue("A class not annotated with @WebService shouldn't be seen as an endpoint implementation.", validator.validateEndpointImplementation(impl).hasErrors());
declaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.services.InvalidEIReference");
impl = new EndpointImplementation(declaration, ei);
assertTrue("A class referencing an ei should be required to implement it.", validator.validateEndpointImplementation(impl).hasErrors());
declaration = (EnumDeclaration) getDeclaration("org.codehaus.enunciate.samples.schema.EnumBeanOne");
impl = new EndpointImplementation(declaration, ei);
assertTrue("An enum declaration should not be a valid endpoint implementation.", validator.validateEndpointImplementation(impl).hasErrors());
declaration = (ClassDeclaration) getDeclaration("org.codehaus.enunciate.samples.services.NoNamespaceWebServiceImpl");
impl = new EndpointImplementation(declaration, ei);
assertFalse(validator.validateEndpointImplementation(impl).hasErrors());
}