FileDocCategorySizeDatePackage
PolicyWSDLParserExtensionTest.javaAPI DocExample42209Thu Jul 12 10:19:04 BST 2007com.sun.xml.ws.policy.jaxws

PolicyWSDLParserExtensionTest

public class PolicyWSDLParserExtensionTest extends TestCase
author
Jakub Podlesak (jakub.podlesak at sun.com)

Fields Summary
private static final XMLInputFactory
XML_INPUT_FACTORY
Constructors Summary
public PolicyWSDLParserExtensionTest(String testName)

    
       
        super(testName);
    
Methods Summary
public static junit.framework.Testsuite()

        TestSuite suite = new TestSuite(PolicyWSDLParserExtensionTest.class);
        return suite;
    
public voidtestBindingAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrBinding-invalid.wsdl");
        assertNotNull(policyMap.getEndpointEffectivePolicy(policyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
    
public voidtestBindingElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemBinding.wsdl");
        assertNotNull(policyMap.getEndpointEffectivePolicy(policyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
    
public voidtestBindingHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocBinding.wsdl");
        assertNotNull(policyMap.getEndpointEffectivePolicy(policyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
    
public voidtestBindingOpFaultAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrBindingOpFault-invalid.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestBindingOpFaultElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemBindingOpFault.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestBindingOpFaultExternalFromAnonymousPolicyAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtExternalFromAnonBindingOpFault.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestBindingOpFaultExternalPolicyAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtExternalBindingOpFault.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestBindingOpFaultHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocBindingOpFault.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestBindingOpInAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrBindingOpIn-invalid.wsdl");
        assertNotNull(policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestBindingOpInElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemBindingOpIn.wsdl");
        assertNotNull(policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestBindingOpInHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocBindingOpIn.wsdl");
        assertNotNull(policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestBindingOpOutAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrBindingOpOut-invalid.wsdl");
        assertNotNull(policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestBindingOpOutElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemBindingOpOut.wsdl");
        assertNotNull(policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestBindingOpOutHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocBindingOpOut.wsdl");
        assertNotNull(policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestBindingOperationAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrBindingOperation-invalid.wsdl");
        assertNotNull(policyMap.getOperationEffectivePolicy(policyMap.createWsdlOperationScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestBindingOperationElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemBindingOperation.wsdl");
        assertNotNull(policyMap.getOperationEffectivePolicy(policyMap.createWsdlOperationScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestBindingOperationHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocBindingOperation.wsdl");
        assertNotNull(policyMap.getOperationEffectivePolicy(policyMap.createWsdlOperationScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestCircularReference()

        try {
            PolicyMap policyMap = getPolicyMap("parser/testPolicyCircularReferences.wsdl", false);
            fail("Parsing WSDL containing circular policy references should fail");
        } catch (WebServiceException e) {
            // ok - exception thrown as expected
        }
    
public voidtestClientParsingWithDifferentlyCreatedSDDocumentSource()

        InputStream configFileIS = null;
        final URL configFileUrl = PolicyResourceLoader.getResourceUrl("parser/wsit-client.xml");
        try {
            WSDLModel model = null;
            configFileIS = configFileUrl.openStream();
            final XMLStreamBuffer buffer = XMLStreamBuffer.createNewBufferFromXMLStreamReader(XML_INPUT_FACTORY.createXMLStreamReader(configFileIS));
            final SDDocumentSource doc = SDDocumentSource.create(configFileUrl, buffer);
            final XMLEntityResolver.Parser parser =  new XMLEntityResolver.Parser(doc);
            model = WSDLModel.WSDLParser.parse(
                    parser,
                    new PolicyConfigResolver(),
                    true,
                    new WSDLParserExtension[] { new PolicyWSDLParserExtension(true) }
            );
            
            assertNotNull(model);
        } finally {
            PolicyUtils.IO.closeResource(configFileIS);
        }
        
// What about when document source is created in a different way:
        
        WSDLModel model = null;
        final SDDocumentSource doc = SDDocumentSource.create(configFileUrl);
        final XMLEntityResolver.Parser parser =  new XMLEntityResolver.Parser(doc);
        model = WSDLModel.WSDLParser.parse(
                parser,
                new PolicyConfigResolver(),
                true,
                new WSDLParserExtension[] { new PolicyWSDLParserExtension(true) }
        );
        
        assertNotNull(model);
    
public voidtestComprehensive()

        PolicyMap policyMap = getPolicyMap("parser/testComprehensive.wsdl");
        
        // Test service scope
        
        Collection<PolicyMapKey> keys = policyMap.getAllServiceScopeKeys();
        assertEquals(1, keys.size());
        
        Policy policy = policyMap.getServiceEffectivePolicy(policyMap.createWsdlServiceScopeKey(
                new QName("http://wsit.test/","FaultServiceService")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        AssertionSet assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "ServiceMarker")));
        
        // Test endpoint scope

        keys = policyMap.getAllEndpointScopeKeys();
        assertEquals(1, keys.size());
        
        policy = policyMap.getEndpointEffectivePolicy(policyMap.createWsdlEndpointScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingMarker")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "PortMarker")));
        
        // Test operation scope

        keys = policyMap.getAllOperationScopeKeys();
        assertEquals(3, keys.size());
        
        policy = policyMap.getOperationEffectivePolicy(policyMap.createWsdlOperationScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort"),
                new QName("http://wsit.test/","echo")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingOperationEcho")));
        
        policy = policyMap.getOperationEffectivePolicy(policyMap.createWsdlOperationScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort"),
                new QName("http://wsit.test/","hello")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingOperationHello")));
        
        policy = policyMap.getOperationEffectivePolicy(policyMap.createWsdlOperationScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort"),
                new QName("http://wsit.test/","ping")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingOperationPing")));

        // Test input message scope

        keys = policyMap.getAllInputMessageScopeKeys();
        assertEquals(3, keys.size());
        
        policy = policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort"),
                new QName("http://wsit.test/","echo")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "MessageEcho")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingEchoInput")));
        
        policy = policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort"),
                new QName("http://wsit.test/","hello")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "MessageHello")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingHelloInput")));
        
        policy = policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort"),
                new QName("http://wsit.test/","ping")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "MessagePing")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingPingInput")));
        
        // Test output message scope

        keys = policyMap.getAllOutputMessageScopeKeys();
        assertEquals(3, keys.size());
        
        policy = policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort"),
                new QName("http://wsit.test/","echo")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "MessageEchoResponse")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingEchoOutput")));
        
        policy = policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort"),
                new QName("http://wsit.test/","hello")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "MessageHelloResponse")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingHelloOutput")));
        
        policy = policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://wsit.test/","FaultServiceService"),
                new QName("http://wsit.test/","FaultServicePort"),
                new QName("http://wsit.test/","ping")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingPingOutput")));
        
        // Test fault message scope

        keys = policyMap.getAllFaultMessageScopeKeys();
        assertEquals(6, keys.size());
        
        policy = policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://wsit.test/", "FaultServiceService"),
                new QName("http://wsit.test/", "FaultServicePort"),
                new QName("http://wsit.test/", "echo"),
                new QName("http://wsit.test/", "EchoException")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingEchoException")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "EchoException")));
        
        policy = policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://wsit.test/", "FaultServiceService"),
                new QName("http://wsit.test/", "FaultServicePort"),
                new QName("http://wsit.test/", "echo"),
                new QName("http://wsit.test/", "Echo2Exception")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingEcho2Exception")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "Echo2Exception")));
        
        policy = policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://wsit.test/", "FaultServiceService"),
                new QName("http://wsit.test/", "FaultServicePort"),
                new QName("http://wsit.test/", "hello"),
                new QName("http://wsit.test/", "HelloException")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingHelloException")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "HelloException")));
        
        policy = policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://wsit.test/", "FaultServiceService"),
                new QName("http://wsit.test/", "FaultServicePort"),
                new QName("http://wsit.test/", "hello"),
                new QName("http://wsit.test/", "Hello2Exception")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingHello2Exception")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "Hello2Exception")));
        
        policy = policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://wsit.test/", "FaultServiceService"),
                new QName("http://wsit.test/", "FaultServicePort"),
                new QName("http://wsit.test/", "ping"),
                new QName("http://wsit.test/", "EchoException")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingPingException")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingEchoException")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingEcho2Exception")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "EchoException")));
        assertFalse(assertionSet.contains(new QName("http://wsit.test/", "Echo2Exception")));
        
        policy = policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://wsit.test/", "FaultServiceService"),
                new QName("http://wsit.test/", "FaultServicePort"),
                new QName("http://wsit.test/", "ping"),
                new QName("http://wsit.test/", "Echo2Exception")));
        assertEquals(1, policy.getNumberOfAssertionSets());
        assertionSet = policy.iterator().next();
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "BindingPing2Exception")));
        assertFalse(assertionSet.contains(new QName("http://wsit.test/", "EchoException")));
        assertTrue(assertionSet.contains(new QName("http://wsit.test/", "Echo2Exception")));
        
    
public voidtestInvalidAssertionShouldCauseException()

        try {
            PolicyMap policyMap = getPolicyMap("parser/testInvalidAssertionError.wsdl", false);
            fail("WSDL validation should fail");
        } catch (WebServiceException e) {
            // ok - exception thrown as expected
        }
    
public voidtestMessageFaultAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrMessageFault-invalid.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestMessageFaultElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemMessageFault.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestMessageFaultHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocMessageFault.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestMessageInAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrMessageIn-invalid.wsdl");
        assertNotNull(policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestMessageInElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemMessageIn.wsdl");
        assertNotNull(policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestMessageInHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocMessageIn.wsdl");
        assertNotNull(policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestMessageOutAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrMessageOut-invalid.wsdl");
        assertNotNull(policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestMessageOutElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemMessageOut.wsdl");
        assertNotNull(policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestMessageOutHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocMessageOut.wsdl");
        assertNotNull(policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestPolicyReferences()

        PolicyMap map = getPolicyMap("parser/testPolicyReferences.wsdl");
        assertNotNull("PolicyMap can not be null", map);
        
        map = PolicyConfigParser.parse(PolicyResourceLoader.getResourceUrl("parser/testPolicyReferences.wsdl"), false);
        assertNotNull("PolicyMap can not be null", map);
    
public voidtestPortAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrPort-invalid.wsdl");
        assertNotNull(policyMap.getEndpointEffectivePolicy(policyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
    
public voidtestPortElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemPort.wsdl");
        assertNotNull(policyMap.getEndpointEffectivePolicy(PolicyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
    
public voidtestPortHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocPort.wsdl");
        assertNotNull(policyMap.getEndpointEffectivePolicy(policyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
    
public voidtestPortTypeAttrAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrPortType.wsdl");
        assertNotNull(policyMap.getEndpointEffectivePolicy(policyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
    
public voidtestPortTypeElementAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemPortType-invalid.wsdl");
        assertNotNull(policyMap.getEndpointEffectivePolicy(policyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
    
public voidtestPortTypeHeredocAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocPortType-invalid.wsdl");
        assertNotNull(policyMap.getEndpointEffectivePolicy(policyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
    
public voidtestPortTypeOpFaultAttrAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrPortTypeOpFault.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestPortTypeOpFaultElementAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemPortTypeOpFault-invalid.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestPortTypeOpFaultHeredocAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocPortTypeOpFault-invalid.wsdl");
        assertNotNull(policyMap.getFaultMessageEffectivePolicy(policyMap.createWsdlFaultMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation")
                ,new QName("http://example.org","Fault"))));
    
public voidtestPortTypeOpInAttrAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrPortTypeOpIn.wsdl");
        assertNotNull(policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestPortTypeOpInElementAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemPortTypeOpIn-invalid.wsdl");
        assertNotNull(policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestPortTypeOpInHeredocAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocPortTypeOpIn-invalid.wsdl");
        assertNotNull(policyMap.getInputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestPortTypeOpOutAttrAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrPortTypeOpOut.wsdl");
        assertNotNull(policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestPortTypeOpOutElementAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemPortTypeOpOut-invalid.wsdl");
        assertNotNull(policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestPortTypeOpOutHeredocAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocPortTypeOpOut-invalid.wsdl");
        assertNotNull(policyMap.getOutputMessageEffectivePolicy(policyMap.createWsdlMessageScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestPortTypeOperationAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrPortTypeOperation-invalid.wsdl");
        assertNotNull(policyMap.getOperationEffectivePolicy(policyMap.createWsdlOperationScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestPortTypeOperationElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemPortTypeOperation.wsdl");
        assertNotNull(policyMap.getOperationEffectivePolicy(policyMap.createWsdlOperationScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestPortTypeOperationHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocPortTypeOperation.wsdl");
        assertNotNull(policyMap.getOperationEffectivePolicy(policyMap.createWsdlOperationScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish")
                ,new QName("http://example.org","TranslateOperation"))));
    
public voidtestServiceAttrAttachment()
invalid wsdl on input

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtAttrService-invalid.wsdl");
        assertNotNull(policyMap.getServiceEffectivePolicy(policyMap.createWsdlServiceScopeKey(
                new QName("http://example.org","DictionaryService"))));
    
public voidtestServiceElementAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtElemService.wsdl");
        assertNotNull(policyMap.getServiceEffectivePolicy(PolicyMap.createWsdlServiceScopeKey(
                new QName("http://example.org","DictionaryService"))));
    
public voidtestServiceHeredocAttachment()

        PolicyMap policyMap = getPolicyMap("parser/testRuntimeWSExtHeredocService.wsdl");
        assertNotNull(policyMap.getServiceEffectivePolicy(policyMap.createWsdlServiceScopeKey(
                new QName("http://example.org","DictionaryService"))));
    
public voidtestWsdlParserBasics()

        assertNotNull("PolicyMap can not be null", getPolicyMap("parser/testWsdlParserBasics.wsdl"));
    
public voidtestWsdlParserImport()

        PolicyMap policyMap = getPolicyMap("parser/testWsdlImportMain.wsdl");
        Policy policy;
        assertNotNull("PolicyMap can not be null", policyMap);
        assertNotNull(policy = policyMap.getEndpointEffectivePolicy(PolicyMap.createWsdlEndpointScopeKey(
                new QName("http://example.org","DictionaryService")
                ,new QName("http://example.org","CzechToEnglish"))));
        assertTrue(policy.contains(new QName("http://example.org","dummyAssertion")));