Package jsr181.jaxb.auth

Source Code of jsr181.jaxb.auth.AuthServiceTest

package jsr181.jaxb.auth;

import org.codehaus.xfire.XFire;
import org.codehaus.xfire.XFireFactory;
import org.codehaus.xfire.aegis.AbstractXFireAegisTest;
import org.codehaus.xfire.jaxb2.JaxbServiceFactory;
import org.codehaus.xfire.service.Service;

public class AuthServiceTest  
    extends AbstractXFireAegisTest
{
    private Service service;
   
    @Override
    protected void setUp()
        throws Exception
    {
        super.setUp();
        JaxbServiceFactory asf = new JaxbServiceFactory(getXFire().getTransportManager());
        service = asf.create(AuthServiceCustomImpl.class);

        getServiceRegistry().register(service);
    }

    @Override
    protected void tearDown()
        throws Exception
    {
        getServiceRegistry().unregister(service);
        super.tearDown();
    }
   
    @Override
    protected XFire getXFire()
    {
        return XFireFactory.newInstance().getXFire();
    }
   
    public void testEcho() throws Exception
    {  
        AuthServiceClient service = new AuthServiceClient();
       
        AuthServicePortType client = service.getAuthServicePortTypeLocalEndpoint();
       
        try
        {
            client.authenticate("foo", "bar");
            fail("Exception should've been thrown.");
        }
        catch (jsr181.jaxb.auth.AuthenticationFault e)
        {
        }
    }
}
TOP

Related Classes of jsr181.jaxb.auth.AuthServiceTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.