}
};
//test validation of JSR 181, secion 3.3
TypeDeclaration declaration = getDeclaration("org.codehaus.enunciate.samples.services.NotAWebService");
EndpointInterface ei = new EndpointInterface(declaration);
assertTrue("A class not annotated with @WebService shouldn't be a valid endpoint interface (jsr 181: 3.3).", validator.validateEndpointInterface(ei).hasErrors());
declaration = getDeclaration("org.codehaus.enunciate.samples.services.InvalidEIReference");
ei = new EndpointInterface(declaration);
assertTrue("An endpoint implementation with an ei reference to another class shouldn't be valid.", validator.validateEndpointInterface(ei).hasErrors());
declaration = getDeclaration("org.codehaus.enunciate.samples.services.UnknownEIReference");
ei = new EndpointInterface(declaration);
assertTrue("An endpoint implementation with an ei reference to something unknown shouldn't be valid.", validator.validateEndpointInterface(ei).hasErrors());
declaration = getDeclaration("org.codehaus.enunciate.samples.services.InterfaceSpecifiedAsImplementation");
//if an interface is specified as an implementation, it's still an endpoint interface, just not a valid one.
ei = new EndpointInterface(declaration);
assertTrue("An interface declaration shouldn't be allowed to specify another endpoint interface (jsr 181: 3.3).", validator.validateEndpointInterface(ei).hasErrors());
declaration = getDeclaration("org.codehaus.enunciate.samples.services.WebServiceWithoutUniqueMethodNames");
//an unknown ei reference is correct, but not valid.
ei = new EndpointInterface(declaration);
assertTrue("An endpoint without unique web method names shouldn't be valid.", validator.validateEndpointInterface(ei).hasErrors());
declaration = getDeclaration("org.codehaus.enunciate.samples.services.EncodedUseWebService");
ei = new EndpointInterface(declaration);
assertTrue("An encoded-use web wervice shouldn't be supported.", validator.validateEndpointInterface(ei).hasErrors());
implCounter.reset();
methodCounter.reset();
declaration = getDeclaration("org.codehaus.enunciate.samples.services.NamespacedWebService");
ei = new EndpointInterface(declaration);
assertFalse("An encoded-use web wervice shouldn't be supported.", validator.validateEndpointInterface(ei).hasErrors());
assertEquals(1, implCounter.getCount());
assertEquals(1, methodCounter.getCount());
}