1 5 package org.exoplatform.test.web.validator; 6 7 import org.exoplatform.test.web.*; 8 import com.meterware.httpunit.*; 9 15 public class ExpectFormNameValidator implements Validator { 16 private String formName_ ; 17 18 public ExpectFormNameValidator(String formName) { 19 formName_ = formName ; 20 } 21 22 public boolean validate(WebResponse response, ExoWebClient client) throws Exception { 23 WebForm form = Util.findFormWithName(response, null, formName_) ; 24 if(form == null) return false ; 25 return true ; 26 } 27 28 public String getName() { return "ExpectFormNameValidator" ; } 29 30 public String getDescription() { 31 return "Make sure that the return xhtml has the form with the name '" + formName_ + "'" ; 32 } 33 } | Popular Tags |