1 5 package org.exoplatform.test.web.condition; 6 7 import org.exoplatform.test.web.ExoWebClient; 8 import com.meterware.httpunit.*; 9 10 16 public class HaveLinkWithTextCondition implements Condition { 17 private String text_ ; 18 19 public HaveLinkWithTextCondition(String text) { 20 text_ = text ; 21 } 22 23 public boolean checkCondition(WebResponse response, WebTable block, ExoWebClient client) throws Exception { 24 WebLink link = response.getLinkWith(text_) ; 25 return link != null ; 26 } 27 28 public String getName() { return "HaveLinkWithTextCondition" ; } 29 public String getDescription() { 30 return "This unit test should run only if the previous return response has the the text '" + text_ + "'" ; 31 } 32 } | Popular Tags |