1 5 package org.exoplatform.test.web.validator; 6 7 import org.exoplatform.test.web.ExoWebClient; 8 import com.meterware.httpunit.*; 9 15 public class ExpectNoTextValidator implements Validator { 16 private String expectText_ ; 17 public ExpectNoTextValidator(String text) { 18 expectText_ = text ; 19 } 20 21 public boolean validate(WebResponse response, ExoWebClient client) throws Exception { 22 String text = response.getText() ; 23 boolean b = text.indexOf(expectText_) < 0 ; 24 return b ; 25 } 26 27 public String getName() { return "ExpectNoTextvalidator" ; } 28 29 public String getDescription() { 30 return "Make sure that the return xhtml do not have the following text '" + expectText_ + "'" ; 31 } 32 } | Popular Tags |