01: // Copyright © 2002-2005 Canoo Engineering AG, Switzerland.
02: package com.canoo.webtest.steps.verify;
03:
04: import java.util.Map;
05:
06: import com.canoo.webtest.util.HtmlConstants;
07: import com.gargoylesoftware.htmlunit.html.HtmlElement;
08: import com.gargoylesoftware.htmlunit.html.HtmlTextArea;
09: import org.apache.log4j.Logger;
10:
11: /**
12: * Verify a textarea in the current response.
13: *
14: * @author Marc Guillemot
15: * @webtest.step
16: * category="Core"
17: * name="verifyTextarea"
18: * alias="verifytextarea"
19: * description="This step is a \"shortcut\" for <em><verifyElementText type=\"TEXTAREA\" ...></em>."
20: */
21: public class VerifyTextArea extends VerifyElementText {
22: private static final Logger LOG = Logger
23: .getLogger(VerifyTextArea.class);
24:
25: public VerifyTextArea() {
26: setType(HtmlConstants.TEXTAREA);
27: }
28:
29: /* (non-Javadoc)
30: * @see com.canoo.webtest.steps.verify.VerifyElementText#readText(com.gargoylesoftware.htmlunit.html.HtmlElement)
31: */
32: protected String readText(final HtmlElement elt) {
33: LOG.debug("Reading text for " + elt);
34: return ((HtmlTextArea) elt).getText();
35: }
36:
37: public Map getParameterDictionary() {
38: final Map map = super .getParameterDictionary();
39: map.remove("type"); // as it is fixed type here
40: return map;
41: }
42: }
|