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