FileDocCategorySizeDatePackage
PolicyConfigResolverTest.javaAPI DocExample4133Tue May 29 16:57:38 BST 2007com.sun.xml.ws.policy.jaxws

PolicyConfigResolverTest

public class PolicyConfigResolverTest extends TestCase

Fields Summary
Constructors Summary
public PolicyConfigResolverTest(String testName)

        super(testName);
    
Methods Summary
protected voidsetUp()

    
protected voidtearDown()

    
public voidtestResolveEntity()
Test of resolveEntity method, of class com.sun.xml.ws.policy.jaxws.PolicyConfigResolver.

        String publicId = null;
        String systemId = null;
        PolicyConfigResolver resolver = new PolicyConfigResolver();
        
        try {
            XMLEntityResolver.Parser result = resolver.resolveEntity(publicId, systemId);
            fail("Expected MalformedURLException");
        } catch (MalformedURLException e) {
        }
        
        publicId = "someString";
        systemId = null;
        XMLEntityResolver.Parser result = null;

        try {
            result = resolver.resolveEntity(publicId, systemId);
            fail("Expected MalformedURLException");
        } catch (MalformedURLException e) {
        }

        publicId = null;
        systemId = "http://test.invalid/";
        
        try {
            result = resolver.resolveEntity(publicId, systemId);
            fail("Expected IOException after connect to non-existent HTTP URL");
        } catch (IOException e) {
        }
        
        publicId = "http://example.org/";
        systemId = "http://test.invalid/";
        
        try {
            result = resolver.resolveEntity(publicId, systemId);
            fail("Expected IOException after connect to non-existent HTTP URL");
        } catch (IOException e) {
        }