KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > exoplatform > test > web > unit > ClickImageLinkWithAltTextUnit


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.unit;
6
7 import org.exoplatform.test.web.ExoWebClient;
8 import com.meterware.httpunit.*;
9 /**
10  * May 21, 2004
11  * @author: Tuan Nguyen
12  * @email: tuan08@users.sourceforge.net
13  * @version: $Id: ClickImageLinkWithAltTextUnit.java,v 1.2 2004/10/21 15:26:23 tuan08 Exp $
14  **/

15 public class ClickImageLinkWithAltTextUnit extends WebUnit {
16   private String JavaDoc altText_ ;
17
18   public ClickImageLinkWithAltTextUnit(String JavaDoc name, String JavaDoc description) {
19     super(name, description) ;
20   }
21   
22   public ClickImageLinkWithAltTextUnit setAltText(String JavaDoc text) {
23     altText_ = text ;
24     return this ;
25   }
26   
27   public WebResponse execute(WebResponse previousResponse, WebTable block,
28                                ExoWebClient client) throws Exception JavaDoc {
29     WebLink link = previousResponse.getLinkWithImageText(altText_);
30     return link.click() ;
31   }
32   
33   public String JavaDoc getActionDescription() {
34     return "This web unit look for the image link with alt text '" + altText_ + "' and click on it";
35   }
36 }
Popular Tags