Fixed SEC-395

This commit is contained in:
Ray Krueger
2006-11-20 19:09:45 +00:00
parent 9d2fe0e037
commit 74e8efc4e9
2 changed files with 6 additions and 29 deletions

View File

@@ -46,16 +46,6 @@ public class HttpSessionEventPublisherTests extends TestCase {
context.setServletContext(servletContext);
}
public void testGetContextThrowsExceptionIfContextNotSet() {
HttpSessionEventPublisher publisher = new HttpSessionEventPublisher();
publisher.contextInitialized(new ServletContextEvent(new MockServletContext()));
try {
publisher.getContext();
fail("IllegalStateException expected when no context set");
} catch (IllegalStateException expected) {}
}
/**
* It's not that complicated so we'll just run it straight through here.
*/
@@ -73,10 +63,11 @@ public class HttpSessionEventPublisherTests extends TestCase {
publisher.contextInitialized(new ServletContextEvent(servletContext));
MockHttpSession session = new MockHttpSession();
MockHttpSession session = new MockHttpSession(servletContext);
TestListener listener = (TestListener) context.getBean("listener");
HttpSessionEvent event = new HttpSessionEvent(session);
publisher.sessionCreated(event);
assertNotNull(listener.getCreatedEvent());