org.springframework.test
Class AbstractSpringContextTests

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.springframework.test.AbstractSpringContextTests
All Implemented Interfaces:
Test
Direct Known Subclasses:
AbstractDependencyInjectionSpringContextTests

public abstract class AbstractSpringContextTests
extends TestCase

Maintains a static cache of contexts by key.

Since:
1.1.1
Author:
Rod Johnson

Field Summary
protected  Log logger
          Logger available to subclasses.
 
Constructor Summary
AbstractSpringContextTests()
           
 
Method Summary
protected  String contextKeyString(Object contextKey)
          Subclasses can override this to return a String representation of their contextKey for use in logging
protected  ConfigurableApplicationContext getContext(Object key)
           
protected  boolean hasCachedContext(Object contextKey)
           
protected  ConfigurableApplicationContext loadContext(Object key)
           
protected  ConfigurableApplicationContext loadContextLocations(String[] locations)
          Subclasses can invoke this to get a context key for the given location.
protected  void setDirty(String[] locations)
          Set custom locations dirty.
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

protected final Log logger
Logger available to subclasses.

Constructor Detail

AbstractSpringContextTests

public AbstractSpringContextTests()
Method Detail

setDirty

protected void setDirty(String[] locations)
Set custom locations dirty.


hasCachedContext

protected boolean hasCachedContext(Object contextKey)

contextKeyString

protected String contextKeyString(Object contextKey)
Subclasses can override this to return a String representation of their contextKey for use in logging


getContext

protected ConfigurableApplicationContext getContext(Object key)

loadContextLocations

protected ConfigurableApplicationContext loadContextLocations(String[] locations)
Subclasses can invoke this to get a context key for the given location. This doesn't affect the applicationContext instance variable in this class. Dependency Injection cannot be applied from such contexts.


loadContext

protected ConfigurableApplicationContext loadContext(Object key)


Copyright (C) 2003-2004 The Spring Framework Project.