FileDocCategorySizeDatePackage
PolicyMergerTest.javaAPI DocExample4103Tue May 29 16:57:36 BST 2007com.sun.xml.ws.policy

PolicyMergerTest

public class PolicyMergerTest extends TestCase
author
Marek Potociar

Fields Summary
private PolicyMerger
merger
Constructors Summary
public PolicyMergerTest(String testName)

    
       
        super(testName);
    
Methods Summary
protected voidsetUp()

    
protected voidtearDown()

    
public voidtestMergeEmtpyNonEmptyPolicies()

        Collection<Policy> policies = new LinkedList<Policy>();
        policies.add(PolicyResourceLoader.loadPolicy("merge/policy1.xml"));
        policies.add(PolicyResourceLoader.loadPolicy("merge/policy-empty-alt.xml"));
        
        Policy result = merger.merge(policies);
        Policy expected = PolicyResourceLoader.loadPolicy("merge/policy1.xml");
        
        assertEquals(expected, result);
    
public voidtestMergeNoAltPolicies()

        Collection<Policy> policies = new LinkedList<Policy>();
        policies.add(PolicyResourceLoader.loadPolicy("merge/policy1.xml"));
        policies.add(PolicyResourceLoader.loadPolicy("merge/policy-no-alt.xml"));
        
        Policy result = merger.merge(policies);
        Policy expected = PolicyResourceLoader.loadPolicy("merge/policy-no-alt.xml");
        
        assertEquals(expected, result);
    
public voidtestMergeTwoPolicies()

        Collection<Policy> policies = new LinkedList<Policy>();
        policies.add(PolicyResourceLoader.loadPolicy("merge/policy1.xml"));
        policies.add(PolicyResourceLoader.loadPolicy("merge/policy2.xml"));
        policies.add(PolicyResourceLoader.loadPolicy("merge/policy3.xml"));
        
        Policy result = merger.merge(policies);
        Policy expected = PolicyResourceLoader.loadPolicy("merge/merge_1-2-3.xml");
        
        assertEquals(expected, result);