Correct NullPointerException as fixture missing an ApplicationContext and attempting to publish an event.

This commit is contained in:
Ben Alex 2005-03-27 08:40:09 +00:00
parent 684d5bc10e
commit 798ebb1a3d
1 changed files with 6 additions and 1 deletions

View File

@ -37,7 +37,7 @@ import java.security.Principal;
public class ConcurrentSessionControllerImplTests extends TestCase {
//~ Instance fields ========================================================
ConcurrentSessionControllerImpl target = new ConcurrentSessionControllerImpl();
ConcurrentSessionControllerImpl target;
//~ Methods ================================================================
@ -244,6 +244,11 @@ public class ConcurrentSessionControllerImplTests extends TestCase {
target.removeSession("nothing to see here");
}
protected void setUp() throws Exception {
target = new ConcurrentSessionControllerImpl();
target.setApplicationContext(MockApplicationContext.getContext());
}
private Authentication createAuthentication(String user, String password,
String sessionId) {
UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(user,