Package org.apache.cxf.test
Class AbstractCXFSpringTest
- java.lang.Object
-
- org.apache.cxf.test.AbstractCXFTest
-
- org.apache.cxf.test.AbstractCXFSpringTest
-
public abstract class AbstractCXFSpringTest extends AbstractCXFTest
Base class for tests that use a Spring bean specification to load up components for testing. Unlike the classes that come with Spring, it doesn't drag in the JUnit 3 hierarchy, and it doesn't inject into the test itself from the beans.
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.springframework.context.support.GenericApplicationContextapplicationContext-
Fields inherited from class org.apache.cxf.test.AbstractCXFTest
bus, testUtilities
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCXFSpringTest()Load up all the beans from the XML files returned by the getConfigLocations method.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidadditionalSpringConfiguration(org.springframework.context.support.GenericApplicationContext context)subclasses may override this.org.apache.cxf.BuscreateBus()protected org.springframework.context.ApplicationContextgetApplicationContext()protected <T> TgetBean(Class<T> type, String beanName)Convenience method for the common case of retrieving a bean from the context.protected abstract String[]getConfigLocations()Return an array of resource specifications.protected voidsetConfigContextClass(Class<?> configContextClass)voidsetupBeans()voidsetUpBus()voidteardownBeans()-
Methods inherited from class org.apache.cxf.test.AbstractCXFTest
addNamespace, assertInvalid, assertNoFault, assertValid, assertValidBoolean, assertXPathEquals, assertXPathEquals, getBasedir, getBus, getNamespaceContext, getNamespaces, getResourceAsReader, getResourceAsStream, getTestFile, getWSDLDocument, invoke, invokeBytes, shutdownBus
-
-
-
-
Method Detail
-
setUpBus
public void setUpBus() throws Exception- Overrides:
setUpBusin classAbstractCXFTest- Throws:
Exception
-
createBus
public org.apache.cxf.Bus createBus() throws org.apache.cxf.BusException- Overrides:
createBusin classAbstractCXFTest- Throws:
org.apache.cxf.BusException
-
teardownBeans
public void teardownBeans()
-
getConfigLocations
protected abstract String[] getConfigLocations()
Return an array of resource specifications.- Returns:
- array of resource specifications.
- See Also:
for the syntax.
-
getApplicationContext
protected org.springframework.context.ApplicationContext getApplicationContext()
-
additionalSpringConfiguration
protected void additionalSpringConfiguration(org.springframework.context.support.GenericApplicationContext context) throws Exceptionsubclasses may override this.- Parameters:
context-- Throws:
Exception
-
getBean
protected <T> T getBean(Class<T> type, String beanName)
Convenience method for the common case of retrieving a bean from the context. One would expect Spring to have this.- Type Parameters:
T- Type of the bean object.- Parameters:
type- Type of the bean object.beanName- ID of the bean.- Returns:
- The Bean.
-
setConfigContextClass
protected void setConfigContextClass(Class<?> configContextClass)
-
-