()
| 395 | } |
| 396 | |
| 397 | public void loginDoGet() throws Exception |
| 398 | { |
| 399 | try |
| 400 | { |
| 401 | int expectedResponseCode = 302; |
| 402 | |
| 403 | log.debug("Creating Login Servlet Instance"); |
| 404 | Login servlet = new Login(); |
| 405 | servlet.init(new MockServletConfig("Login")); |
| 406 | |
| 407 | log.debug("Running doPost"); |
| 408 | servlet.doGet(request, response); |
| 409 | |
| 410 | if(response.getStatus() != expectedResponseCode) |
| 411 | fail("Login Servlet Returned " + response.getStatus() + " Code. 302 Expected"); |
| 412 | else |
| 413 | { |
| 414 | log.debug("302 OK Detected"); |
| 415 | String location = response.getHeader("Location"); |
| 416 | log.debug("302 pointing at: " + location); |
| 417 | if(!location.endsWith("index.jsp")) |
| 418 | { |
| 419 | throw new Exception("Login doGet not Redirecting to index.jsp. Login Proceedure Failed"); |
| 420 | } |
| 421 | } |
| 422 | } |
| 423 | catch(Exception e) |
| 424 | { |
| 425 | throw e; |
| 426 | } |
| 427 | } |
| 428 | |
| 429 | public void loginDoPost(String userName, String password, String theClass) throws Exception |
| 430 | { |
no test coverage detected