KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > test > web > condition > HaveLinkWithURLCondition


1 /***************************************************************************
2  * Copyright 2001-2003 The eXo Platform SARL All rights reserved. *
3  * Please look at license.txt in info directory for more license detail. *
4  **************************************************************************/

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 /**
12  * May 21, 2004
13  * @author: Tuan Nguyen
14  * @email: tuan08@users.sourceforge.net
15  * @version: $Id: HaveLinkWithURLCondition.java,v 1.1 2004/10/11 23:36:04 tuan08 Exp $
16  **/

17 public class HaveLinkWithURLCondition implements Condition {
18   private String JavaDoc partOfURL_ ;
19   
20   public HaveLinkWithURLCondition(String JavaDoc text) {
21     partOfURL_ = text ;
22   }
23   
24   public boolean checkCondition(WebResponse response, WebTable block, ExoWebClient client) throws Exception JavaDoc {
25     WebLink link = Util.findLinkWithURL(response, block,partOfURL_) ;
26     return link != null ;
27   }
28   
29   public String JavaDoc getName() { return "HaveLinkWithURLCondition" ; }
30   public String JavaDoc getDescription() {
31     return "This unit test should run only if the previous return response has the link with url '..." + partOfURL_ + "...'" ;
32   }
33 }
Popular Tags