1 23 package org.objectweb.clif.isac.plugins.httpinjector10.actions; 24 25 import org.apache.commons.httpclient.Header; 26 import org.objectweb.clif.isac.plugins.httpinjector10.SessionObject; 27 import org.objectweb.clif.scenario.util.isac.engine.IsacScenarioEngine; 28 import org.objectweb.util.monolog.api.Logger; 29 30 36 public class HttpInjectorTests { 37 38 static protected Logger log = IsacScenarioEngine.logger 40 .getLogger(HttpInjectorTests.class.getName()); 41 49 50 public static boolean is404Response(SessionObject sessionObject) { 51 return (sessionObject.getLastStatusCode() == 404); 52 } 53 54 65 public static boolean isStatusCodeResponse(SessionObject sessionObject, 66 int statusCode) { 67 68 return (sessionObject.getLastStatusCode() == statusCode); 69 } 70 71 84 public static boolean isHeaderValue(SessionObject sessionObject, 85 String headerParameterType, String headerParameterValue) { 86 Header[] headers = sessionObject.getLastHeader(); 87 for (int i = 0; i < headers.length; i++) { 88 if (headers[i].getName().equals(headerParameterType)) { 89 return (headers[i].getValue().equals(headerParameterValue)); 90 } 91 } 92 return false; 93 } 94 } | Popular Tags |