}
}
public void testCustomizationReadAccess() throws Exception
{
Endpoint endpoint = deploymentModelFactory.newEndpoint(null);
JAXBBindingCustomization jaxbCustomization = new JAXBBindingCustomization();
jaxbCustomization.put(JAXBBindingCustomization.DEFAULT_NAMESPACE_REMAP, "http://org.jboss.bindingCustomization");
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
endpoint.setState(EndpointState.STARTED);
// read a single customization
BindingCustomization knownCustomization = endpoint.getAttachment(BindingCustomization.class);
assertNotNull(knownCustomization);
// however the iteratoion should be unmodifiable
try
{
endpoint.addAttachment(BindingCustomization.class, jaxbCustomization);
fail("Started Endpoints should only axpose read acccess to their binding customizations");
}
catch (Exception e)
{
// all fine, we'd expect this