AbstractVerifyValuePdfStep.java :  » Testing » webtest » com » canoo » webtest » plugins » pdftest » Java Open Source

Java Open Source » Testing » webtest 
webtest » com » canoo » webtest » plugins » pdftest » AbstractVerifyValuePdfStep.java
// Copyright  2002-2005 Canoo Engineering AG, Switzerland.
package com.canoo.webtest.plugins.pdftest;

/**
 * @author Paul King
 */
public abstract class AbstractVerifyValuePdfStep extends AbstractVerifyPdfStep
{
    private String fExists;
    private String fRegex;
    private String fValue;

    protected AbstractVerifyValuePdfStep() {
        fRegex = null;
        fValue = null;
        fExists = null;
    }

    /**
     * @param exists
     * @webtest.parameter required="yes/no"
     * description="Specifies whether the property/field of interest is expected to exist or not. 
     * Must not be set if 'value' attribute is set."
     */
    public void setExists(String exists) {
        fExists = exists;
    }

    public String getExists() {
        return fExists;
    }

    /**
     * @param regex
     * @webtest.parameter required="no"
     * default="'false'"
     * description="Specifies whether the value represents a <key>regex</key>."
     */
    public void setRegex(String regex) {
        fRegex = regex;
    }

    public String getRegex() {
        return fRegex;
    }

    /**
     * @param value
     * @webtest.parameter required="yes/no"
     * description="The text/<key>regex</key> required to match the property/field of interest. 
     * Must not be set if 'exists' attribute is set."
     */
    public void setValue(String value) {
        fValue = value;
    }

    public String getValue() {
        return fValue;
    }

    protected void verifyParameters() {
        super.verifyParameters();
        paramCheck(fExists == null && fValue == null, "Parameter 'exists' or 'value' is required.");
        paramCheck(fExists != null && fValue != null, "Parameter 'exists' and 'value' are not both allowed.");
    }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.