Examples of InvalidFunctionUsageException


Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

     * @see com.consol.citrus.functions.Function#execute(java.util.List, com.consol.citrus.context.TestContext)
     * @throws InvalidFunctionUsageException
     */
    public String execute(List<String> parameterList, TestContext context) {
        if (parameterList == null || parameterList.size() < 2) {
            throw new InvalidFunctionUsageException("Insufficient function parameters - parameter usage: (targetString, beginIndex, [endIndex])");
        }

        String targetString = parameterList.get(0);

        String beginIndex = parameterList.get(1);
        String endIndex = null;

        if (!StringUtils.hasText(beginIndex)) {
            throw new InvalidFunctionUsageException("Invalid beginIndex - please check function parameters");
        }
       
        if (parameterList.size() > 2) {
            endIndex = parameterList.get(2);
        }
View Full Code Here

Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

     * @see com.consol.citrus.functions.Function#execute(java.util.List, com.consol.citrus.context.TestContext)
     * @throws InvalidFunctionUsageException
     */
    public String execute(List<String> parameterList, TestContext context) {
        if (CollectionUtils.isEmpty(parameterList)) {
            throw new InvalidFunctionUsageException("Function parameters must not be empty");
        }

        return String.valueOf(Math.ceil(Double.valueOf(parameterList.get(0))));
    }
View Full Code Here

Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

     * @see com.consol.citrus.functions.Function#execute(java.util.List, com.consol.citrus.context.TestContext)
     * @throws InvalidFunctionUsageException
     */
    public String execute(List<String> parameterList, TestContext context) {
        if (parameterList == null || parameterList.size() < 2) {
            throw new InvalidFunctionUsageException("Function parameters not set correctly");
        }

        String resultString = parameterList.get(0);

        if (parameterList.size()>1) {
View Full Code Here

Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

     * @see com.consol.citrus.functions.Function#execute(java.util.List, com.consol.citrus.context.TestContext)
     * @throws InvalidFunctionUsageException
     */
    public String execute(List<String> parameterList, TestContext context) {
        if (CollectionUtils.isEmpty(parameterList)) {
            throw new InvalidFunctionUsageException("Function parameters must not be empty");
        }

        return Long.valueOf(Math.round(Double.valueOf((parameterList.get(0))))).toString();
    }
View Full Code Here

Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

     * @see com.consol.citrus.functions.Function#execute(java.util.List, com.consol.citrus.context.TestContext)
     * @throws InvalidFunctionUsageException
     */
    public String execute(List<String> parameterList, TestContext context) {
        if (CollectionUtils.isEmpty(parameterList)) {
            throw new InvalidFunctionUsageException("Function parameters must not be empty");
        }

        return (parameterList.get(0)).toLowerCase();
    }
View Full Code Here

Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

    /**
      * {@inheritDoc}
      */
    public String execute(List<String> parameterList, TestContext context) {
        if (CollectionUtils.isEmpty(parameterList) || parameterList.size() != 1) {
            throw new InvalidFunctionUsageException("Invalid function parameter usage! Missing parameter!");
        }
       
        return StringEscapeUtils.escapeXml(parameterList.get(0));
    }
View Full Code Here

Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

        int numberOfLetters;
        String notationMethod = MIXED;
        boolean includeNumbers = false;

        if (CollectionUtils.isEmpty(parameterList)) {
            throw new InvalidFunctionUsageException("Function parameters must not be empty");
        }

        if (parameterList.size() > 3) {
            throw new InvalidFunctionUsageException("Too many parameters for function");
        }

        numberOfLetters = Integer.valueOf(parameterList.get(0));
        if (numberOfLetters < 0) {
            throw new InvalidFunctionUsageException("Invalid parameter definition. Number of letters must not be positive non-zero integer value");
        }

        if (parameterList.size() > 1) {
            notationMethod = parameterList.get(1);
        }
View Full Code Here

Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

     * @see com.consol.citrus.functions.Function#execute(java.util.List, com.consol.citrus.context.TestContext)
     * @throws InvalidFunctionUsageException
     */
    public String execute(List<String> parameterList, TestContext context) {
        if (CollectionUtils.isEmpty(parameterList)) {
            throw new InvalidFunctionUsageException("Function parameters must not be empty");
        }

        double result = 0.0;

        for (String token : parameterList) {
View Full Code Here

Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

    /**
     * {@inheritDoc}
     */
    public String execute(List<String> parameterList, TestContext context) {
        if (!parameterList.isEmpty()) {
            throw new InvalidFunctionUsageException("Unexpected parameter for function.");
        }
       
        try {
            return InetAddress.getLocalHost().getHostName();
        } catch (UnknownHostException e) {
View Full Code Here

Examples of com.consol.citrus.exceptions.InvalidFunctionUsageException

     * @see com.consol.citrus.functions.Function#execute(java.util.List, com.consol.citrus.context.TestContext)
     * @throws InvalidFunctionUsageException
     */
    public String execute(List<String> parameterList, TestContext context) {
        if (CollectionUtils.isEmpty(parameterList)) {
            throw new InvalidFunctionUsageException("Function parameters must not be empty");
        }

        double result = 0.0;

        for (String token : parameterList) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.