*/
private void destroyApplicationContext(ServletContext servletContext)
{
//look for thread local
//this can be set by initRequestContext
ApplicationContext context = null;
//Looking the context from saved context
//This is used in real web applications
if(servletContext != null)
{
context = currentApplicationContexts.get(servletContext);
}
//using in tests
if(context == null)
{
context = this.sharedApplicationContext;
}
//Destroy context
if(context != null)
{
context.destroy();
}
//Remove from saved contexts
if(servletContext != null)
{