All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.codehaus.xfire.spring.AbstractXFireSpringTest Maven / Gradle / Ivy

There is a newer version: 1.2.6
Show newest version
package org.codehaus.xfire.spring;

import org.codehaus.xfire.XFire;
import org.codehaus.xfire.aegis.AbstractXFireAegisTest;
import org.codehaus.xfire.service.ServiceFactory;
import org.springframework.context.ApplicationContext;

/**
 * Provides test support for XFire spring web services. Simply supply your ApplicationContext by
 * implementing the createContext method.
 * 
 * @author Dan Diephouse
 */
public abstract class AbstractXFireSpringTest
    extends AbstractXFireAegisTest
{
    ApplicationContext context;
    
    public void setUp() 
        throws Exception
    {
        context = createContext();
        
        super.setUp();
    }

    protected abstract ApplicationContext createContext();

    protected ApplicationContext getContext()
    {
        return context;
    }
    
    public ServiceFactory getServiceFactory()
    {
        return (ServiceFactory) context.getBean("xfire.serviceFactory");
    }

    protected XFire getXFire()
    {
        return (XFire) context.getBean("xfire");
    }
    
    protected Object getBean(String id)
    {
        return context.getBean(id);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy