File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
org.springframework.web.servlet/src/test/java/org/springframework/web/context Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2009 the original author or authors.
2
+ * Copyright 2002-2010 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -61,6 +61,7 @@ public void testContextLoaderListenerWithDefaultContext() {
61
61
listener .contextInitialized (event );
62
62
WebApplicationContext context = (WebApplicationContext ) sc .getAttribute (WebApplicationContext .ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE );
63
63
assertTrue ("Correct WebApplicationContext exposed in ServletContext" , context instanceof XmlWebApplicationContext );
64
+ assertTrue (ContextLoader .getCurrentWebApplicationContext () instanceof XmlWebApplicationContext );
64
65
LifecycleBean lb = (LifecycleBean ) context .getBean ("lifecycle" );
65
66
assertTrue ("Has father" , context .containsBean ("father" ));
66
67
assertTrue ("Has rod" , context .containsBean ("rod" ));
@@ -70,6 +71,8 @@ public void testContextLoaderListenerWithDefaultContext() {
70
71
assertFalse (context .containsBean ("beans1.bean2" ));
71
72
listener .contextDestroyed (event );
72
73
assertTrue ("Destroyed" , lb .isDestroyed ());
74
+ assertNull (sc .getAttribute (WebApplicationContext .ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE ));
75
+ assertNull (ContextLoader .getCurrentWebApplicationContext ());
73
76
}
74
77
75
78
/**
You can’t perform that action at this time.
0 commit comments