1 20 package org.apache.cactus.sample.servlet.unit; 21 22 import org.apache.cactus.HttpSessionCookie; 23 import org.apache.cactus.ServletTestCase; 24 import org.apache.cactus.WebRequest; 25 import org.apache.cactus.WebResponse; 26 27 32 public class TestHttpSession extends ServletTestCase 33 { 34 41 public void beginNoAutomaticSessionCreation(WebRequest theRequest) 42 { 43 theRequest.setAutomaticSession(false); 44 } 45 46 50 public void testNoAutomaticSessionCreation() 51 { 52 assertNull("A valid session has been found when no session should " 53 + "exist", session); 54 } 55 56 58 62 public void testVerifyJsessionid() 63 { 64 } 66 67 73 public void endVerifyJsessionid(WebResponse theResponse) 74 { 75 assertNotNull(theResponse.getCookieIgnoreCase("jsessionid")); 76 } 77 78 80 86 public void beginCreateSessionCookie(WebRequest theRequest) 87 { 88 HttpSessionCookie sessionCookie = theRequest.getSessionCookie(); 89 assertNotNull("Session cookie should not be null", sessionCookie); 90 theRequest.addCookie(sessionCookie); 91 } 92 93 96 public void testCreateSessionCookie() 97 { 98 assertTrue("A session should have been created prior to " 99 + "this request", !session.isNew()); 100 } 101 102 } 103 | Popular Tags |