FileDocCategorySizeDatePackage
XmlPolicyModelUnmarshallerTest.javaAPI DocExample5007Tue May 29 16:57:40 BST 2007com.sun.xml.ws.policy.sourcemodel

XmlPolicyModelUnmarshallerTest

public class XmlPolicyModelUnmarshallerTest extends TestCase
author
Marek Potociar

Fields Summary
private static final PolicyModelUnmarshaller
xmlUnmarshaller
Constructors Summary
public XmlPolicyModelUnmarshallerTest(String testName)

    
       
        super(testName);
    
Methods Summary
protected voidsetUp()

    
protected voidtearDown()

    
public voidtestUnmarshallComplexPolicyModelWithAssertionParameters()

        PolicySourceModel model = unmarshallModel("complex_policy/assertion_parameters1.xml");
    
public voidtestUnmarshallComplexPolicyModelWithAssertionParametersWithValues()

        PolicySourceModel model = unmarshallModel("bug_reproduction/assertion_parameter_value_unmarshalling.xml");
    
public voidtestUnmarshallPolicyModelWithPolicyReference()

        PolicySourceModel model = unmarshallModel("bug_reproduction/policy_reference1.xml");
    
public voidtestUnmarshallPolicyModelWithWsuId()

        PolicySourceModel model = unmarshallModel("complex_policy/policy_with_wsuid.xml");
        assertEquals("Unmarshalled wsu:Id is not the same as expected", "testWsuId", model.getPolicyId());
    
public voidtestUnmarshallPolicyModelWithXmlId()

        PolicySourceModel model = unmarshallModel("complex_policy/policy_with_xmlid.xml");
        assertEquals("Unmarshalled xml:id is not the same as expected", "testXmlId", model.getPolicyId());
    
public voidtestUnmarshallPolicyModelWithXmlIdAndWsuId()

        try {
            PolicySourceModel model = unmarshallModel("complex_policy/policy_with_xmlid_and_wsuid.xml");
            fail("Should throw an exception");
        } catch (PolicyException e) {
            // ok.
        } catch (Exception e) {
            fail("Should throw PolicyException instead: " + e);
        }
    
public voidtestUnmarshallSingleComplexPolicyModel()

        PolicySourceModel model = unmarshallModel("complex_policy/nested_assertions_with_alternatives.xml");
    
public voidtestUnmarshallSingleSimplePolicyModel()

        PolicySourceModel model = unmarshallModel("single_alternative_policy/policy5.xml");
    
private PolicySourceModelunmarshallModel(java.lang.String resource)

        Reader reader = PolicyResourceLoader.getResourceReader(resource);
        PolicySourceModel model = xmlUnmarshaller.unmarshalModel(reader);
        reader.close();
        return model;