1 22 package org.jboss.test.cluster.test; 23 24 import junit.framework.Test; 25 import org.apache.commons.httpclient.HttpClient; 26 import org.apache.commons.httpclient.HttpMethod; 27 import org.apache.commons.httpclient.methods.GetMethod; 28 import org.jboss.test.JBossClusteredTestCase; 29 import org.jboss.test.cluster.web.BindingListener; 30 import org.jboss.test.cluster.web.SessionListener; 31 32 38 public class SessionEventTestCase 39 extends BaseTest 40 { 41 42 public SessionEventTestCase(String name) 43 { 44 super(name); 45 46 } 47 48 public static Test suite() throws Exception 49 { 50 Test t1 = JBossClusteredTestCase.getDeploySetup(SessionEventTestCase.class, 51 "http-sr.war"); 52 return t1; 53 } 54 55 public void testSessionBindingEvent() 56 throws Exception 57 { 58 String attr = ""; 59 getLog().debug("Enter testSessionBindingEvent"); 60 61 String setURLName = "/http-sr/bindSession.jsp" + "?Binding=true"; 62 String getURLName = "/http-sr/bindSession.jsp" + "?Binding=false"; 63 64 getLog().debug(setURLName + ":::::::" + getURLName); 65 66 HttpClient client = new HttpClient(); 68 69 attr = makeGet(client, baseURL0_ +setURLName); 71 System.out.println("*** Response is " +attr); 72 73 assertNotNull("Http session get", attr); 74 boolean isOK = false; 75 if( attr.indexOf("OK") >= 0 ) isOK = true; 76 assertTrue("Response for session bound event should be", isOK); 77 attr = makeGetWithState(client, baseURL0_ +getURLName); 78 if( attr.indexOf("OK") >= 0 ) isOK = true; 79 assertNotNull("Http session get", attr); 80 assertTrue("Response for session unbound event should be", isOK); 81 } 82 83 } 84 | Popular Tags |