| org.springframework.test.ConditionalTestCase org.springframework.test.AbstractSpringContextTests org.springframework.test.AbstractSingleSpringContextTests
All known Subclasses: org.springframework.test.AbstractDependencyInjectionSpringContextTests,
Method Summary | |
protected Object | contextKey() Return a key for this context. | protected ConfigurableApplicationContext | createApplicationContext(String[] locations) Create a Spring ApplicationContext for use by this test.
The default implementation creates a standard GenericApplicationContext
instance, populates it from the specified config locations through a
org.springframework.beans.factory.xml.XmlBeanDefinitionReader ,
and calls
AbstractSingleSpringContextTests.customizeBeanFactory to allow for customizing the
context's DefaultListableBeanFactory.
Parameters: locations - the config locations (as Spring resource locations,e.g. | protected void | customizeBeanFactory(DefaultListableBeanFactory beanFactory) Customize the internal bean factory of the ApplicationContext used by this test.
The default implementation is empty. | final public ConfigurableApplicationContext | getApplicationContext() Return the ApplicationContext that this base class manages. | protected String[] | getConfigLocations() Subclasses can override this method to return the locations of their
config files, unless they override
AbstractSingleSpringContextTests.contextKey() and
AbstractSingleSpringContextTests.loadContext(Object) instead.
A plain path will be treated as class path location, e.g.:
"org/springframework/whatever/foo.xml". | protected String | getConfigPath() Subclasses can override this method to return a single path to a
config file, relative to the concrete test class.
A plain path, e.g. | protected String[] | getConfigPaths() Subclasses can override this method to return paths to their
config files, relative to the concrete test class.
A plain path, e.g. | final public int | getLoadCount() Return the current number of context load attempts. | protected ConfigurableApplicationContext | loadContext(Object key) This implementation assumes a key of type String array and loads
a context from the given locations. | protected ConfigurableApplicationContext | loadContextLocations(String[] locations) Load a Spring ApplicationContext from the given config locations.
The default implementation creates a standard
AbstractSingleSpringContextTests.createApplicationContext GenericApplicationContext ,
allowing for customizing the internal bean factory through
AbstractSingleSpringContextTests.customizeBeanFactory .
Parameters: locations - the config locations (as Spring resource locations,e.g. | protected void | onSetUp() Subclasses can override this method in place of the
setUp() method, which is final in this class. | protected void | onTearDown() Subclasses can override this to add custom behavior on teardown. | protected void | prepareTestInstance() Prepare this test instance, for example populating its fields. | protected void | setDirty() Called to say that the "applicationContext" instance variable is dirty and
should be reloaded. | final protected void | setUp() This implementation is final. | final protected void | tearDown() This implementation is final. |
AbstractSingleSpringContextTests | public AbstractSingleSpringContextTests()(Code) | | Default constructor for AbstractDependencyInjectionSpringContextTests.
|
AbstractSingleSpringContextTests | public AbstractSingleSpringContextTests(String name)(Code) | | Constructor for AbstractDependencyInjectionSpringContextTests with a JUnit name.
Parameters: name - the name of this text fixture |
getConfigPath | protected String getConfigPath()(Code) | | Subclasses can override this method to return a single path to a
config file, relative to the concrete test class.
A plain path, e.g. "context.xml", will be loaded as classpath resource
from the same package that the concrete test class is defined in.
A path starting with a slash is treated as fully qualified class path
location, e.g.: "/org/springframework/whatever/foo.xml".
The default implementation simply returns null .
an array of config locations See Also: AbstractSingleSpringContextTests.getConfigPath() See Also: java.lang.Class.getResource(String) |
getLoadCount | final public int getLoadCount()(Code) | | Return the current number of context load attempts.
|
onSetUp | protected void onSetUp() throws Exception(Code) | | Subclasses can override this method in place of the
setUp() method, which is final in this class.
This implementation does nothing.
throws: Exception - simply let any exception propagate |
onTearDown | protected void onTearDown() throws Exception(Code) | | Subclasses can override this to add custom behavior on teardown.
throws: Exception - simply let any exception propagate |
prepareTestInstance | protected void prepareTestInstance() throws Exception(Code) | | Prepare this test instance, for example populating its fields.
The context has already been loaded at the time of this callback.
The default implementation does nothing.
throws: Exception - in case of preparation failure |
setDirty | protected void setDirty()(Code) | | Called to say that the "applicationContext" instance variable is dirty and
should be reloaded. We need to do this if a test has modified the context
(for example, by replacing a bean definition).
|
Fields inherited from org.springframework.test.ConditionalTestCase | final protected Log logger(Code)(Java Doc)
|
|
|