FileDocCategorySizeDatePackage
MtomModelConfiguratorProviderTest.javaAPI DocExample4492Tue May 29 16:57:36 BST 2007com.sun.xml.ws.encoding.policy

MtomModelConfiguratorProviderTest

public class MtomModelConfiguratorProviderTest extends TestCase
author
japod

Fields Summary
Constructors Summary
Methods Summary
public voidtestConfigureMtomAssertionNotPresent()
Test of configure method, of class com.sun.xml.ws.policy.jaxws.encoding.MtomModelConfiguratorProvider. policy assertion not present

        WSDLModel model = getWSDLModel("jaxws-spi/testModelConfigProviderMtomPolicyNotPresent.wsdl");
        PolicyMap policyMap = model.getExtension(WSDLPolicyMapWrapper.class).getPolicyMap();
        
        WSDLService service = model.getService(new QName("http://example.org","DictionaryService"));
        assertNotNull(service);
        
        WSDLPort port = service.getFirstPort();
        assertNotNull(port);
        
        WSDLBoundPortType binding = port.getBinding();
        assertNotNull(binding);
        
        WebServiceFeature feature = binding.getFeature(MTOMFeature.class);
        assertNull(feature);
    
public voidtestConfigureMtomAssertionPresent()
Test of configure method, of class com.sun.xml.ws.policy.jaxws.encoding.MtomModelConfiguratorProvider. policy assertion present

        WSDLModel model = getWSDLModel("jaxws-spi/testModelConfigProviderMtom.wsdl");
        PolicyMap policyMap = model.getExtension(WSDLPolicyMapWrapper.class).getPolicyMap();

        WSDLService service = model.getService(new QName("http://example.org","DictionaryService"));
        assertNotNull(service);
        
        WSDLPort port = service.getFirstPort();
        assertNotNull(port);
        
        WSDLBoundPortType binding = port.getBinding();
        assertNotNull(binding);
        
        WebServiceFeature feature = binding.getFeature(MTOMFeature.class);
        assertNotNull(feature);
        
        assertTrue(feature.isEnabled());