### Question:
Wsdl11AttachmentPolicyProvider extends AbstractPolicyProvider { Policy getElementPolicy(AbstractDescriptionElement adh) { return getElementPolicy(adh, false); } Wsdl11AttachmentPolicyProvider();  Wsdl11AttachmentPolicyProvider(Bus bus); Policy getEffectivePolicy(ServiceInfo si, Message m); Policy getEffectivePolicy(EndpointInfo ei, Message m); Policy getEffectivePolicy(BindingOperationInfo bi, Message m); Policy getEffectivePolicy(BindingMessageInfo bmi, Message m); Policy getEffectivePolicy(BindingFaultInfo bfi, Message m);  }### Answer:
@Test public void testElementPolicies() throws WSDLException { Policy p; p = app.getElementPolicy(services[0]); assertTrue(p == null || p.isEmpty()); p = app.getElementPolicy(services[1]); assertTrue(p == null || p.isEmpty()); try { p = app.getElementPolicy(services[2]); fail("Expected PolicyException not thrown."); } catch (PolicyException ex) { } p = app.getElementPolicy(services[3]); assertNotNull(p); assertFalse(p.isEmpty()); verifyAssertionsOnly(p, 2); p = app.getElementPolicy(services[4]); assertNotNull(p); assertFalse(p.isEmpty()); verifyAssertionsOnly(p, 3); EndpointInfo ei = new EndpointInfo(); assertNull(app.getElementPolicy(ei)); }
@Test public void testResolveExternal() { Policy p = app.getElementPolicy(services[17]); verifyAssertionsOnly(p, 2); try { app.getElementPolicy(endpoints[17]); fail("Expected PolicyException not thrown."); } catch (PolicyException ex) { } try { app.getElementPolicy(endpoints[17].getBinding()); fail("Expected PolicyException not thrown."); } catch (PolicyException ex) { } }