01: // Copyright © 2006-2007 ASERT. Released under the Canoo Webtest license.
02: package com.canoo.webtest.plugins.exceltest;
03:
04: /**
05: * @author Rob Nielsen
06: * @webtest.step category="Excel"
07: * name="excelStoreCellValue"
08: * alias="storeCellValue"
09: * description="Provides the ability to store the value of a cell in a property for later checking. Note that this step tests the actual stored value of the cell, not what is displayed in the spreadsheet. In particular, formulas will not be evaluated."
10: */
11: public class ExcelStoreCellValue extends AbstractExcelCellStep {
12: private String fPropertyName;
13: private String fPropertyType;
14:
15: /**
16: * @param name The Property Name
17: * @webtest.parameter required="yes"
18: * description="The name of the property in which to store the value."
19: */
20: public void setProperty(final String name) {
21: fPropertyName = name;
22: }
23:
24: public String getProperty() {
25: return fPropertyName;
26: }
27:
28: /**
29: * @param type The Property type
30: * @webtest.parameter required="no"
31: * description="The type of the property in which to store the value. Either \"ant\" or \"dynamic\"."
32: * default="the \"defaultPropertyType\" as specified in the \"config\" element is used."
33: */
34: public void setPropertyType(final String type) {
35: fPropertyType = type;
36: }
37:
38: public String getPropertyType() {
39: return fPropertyType;
40: }
41:
42: protected void verifyParameters() {
43: super .verifyParameters();
44: nullParamCheck(fPropertyName, "property");
45: }
46:
47: public void doExecute() {
48: setWebtestProperty(getProperty(), getCellValue(),
49: getPropertyType());
50: }
51: }
|