Package com.canoo.webtest.engine

Examples of com.canoo.webtest.engine.StepExecutionException


            ois = new ObjectInputStream(fis);
            message = "reading from";
            return StreamBoundary.tryReadObject(ois, step);
        } catch (IOException e) {
            LOG.error(e.getMessage(), e);
            throw new StepExecutionException("Error " + message + " file: " + e.getMessage(), step);
        } finally {
            IOUtils.closeQuietly(ois);
            IOUtils.closeQuietly(fis);
        }
    }
View Full Code Here


            oos.writeObject(object);
            success = true;
        } catch (IOException e) {
            LOG.error("Error during write: " + e.getMessage(), e);
            if (step != null) {
                throw new StepExecutionException("Error " + message + " file: " + e.getMessage(), step);
            }
        } finally {
            StreamBoundary.closeOutputStream(oos);
            StreamBoundary.closeOutputStream(fos);
        }
View Full Code Here

        final File tmpFile;
        try {
            tmpFile = File.createTempFile(prefix, suffix);
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
            throw new StepExecutionException("Error creating temporary file " + e.getMessage(), step);
        }
        tmpFile.deleteOnExit();
        return tmpFile;
    }
View Full Code Here

  }

    protected void verifyParameters() {
        super.verifyParameters();
        if (getStep() < 1) {
            throw new StepExecutionException("Step must be greater than or equal to 1!", this);
        }
        if (getCount() != null) {
            if (getCount().intValue() < 0) {
                throw new StepExecutionException("Repeat count must be greater than or equal to 0!", this);
            }
        }
        else if (getEndCount() != null) {
            if (getEndCount().intValue() < fStartCount) {
                throw new StepExecutionException("endCount ("+fEndCount+") must be greater than or equal to startCount (" + fStartCount + ")!", this);
            }
        }
        else if (getXpath() == null) {
            throw new StepExecutionException("You must specify a count, a endCount or a XPath attribute.", this);
        }
    }
View Full Code Here

     */
    public static int convertToIntOrReject(final String property, final String value, Step step) throws StepExecutionException {
        try {
            return Integer.parseInt(value);
        } catch (final NumberFormatException nfe) {
            throw new StepExecutionException(
                    "Can't parse \"" + value + "\" as an int for property \"" + property + "\"",
                    step);
        }
    }
View Full Code Here

    protected void verifyParameters() {
        super.verifyParameters();
        nullParamCheck(getRange(), "range");
        if (!getRange().matches("[A-Za-z]+[0-9]+:[A-Za-z]+[0-9]+")) {
            throw new StepExecutionException("Cannot parse \""+getRange()+"\" as a spreadsheet range. eg \"A10:A20\"", this);
        }
    }
View Full Code Here

                    catch(NumberFormatException e) {
                        if (colStr.matches("[A-Z]+")) {
                           return new CellReference(colStr + rowStr);
                        }
                    }
                    throw new StepExecutionException("Can't parse '"+colStr +"' as a column reference (eg. 'A' or '1')", step);

                }
            } catch (NumberFormatException e) {
                // fallthrough
            }
            throw new StepExecutionException("Can't parse '"+rowStr +"' as a integer row reference.", step);
        }
    }
View Full Code Here

        }
    }

    public static CellReference getCellReference(final Step step, final String cell) {
        if (!cell.matches("[A-Z]+[0-9]+")) {
            throw new StepExecutionException("Invalid cell reference: " + cell, step);
        }
        return new CellReference(cell);
    }
View Full Code Here

    public static URL tryCreateUrlWithError(final URL resource, final String urlStr, final Step step) {
        try {
            return new URL(resource, urlStr);
        } catch (MalformedURLException e) {
            LOG.error("Creating URL '" + urlStr + "' failed: " + e.getMessage());
            throw new StepExecutionException(e.getMessage(), step);
        }
    }
View Full Code Here

    public static URL tryCreateUrlFromFileWithError(final File urlFile, final Step step) {
        try {
            return urlFile.toURI().toURL();
        } catch (MalformedURLException e) {
            LOG.error("Creating URL for File '" + urlFile.getName() + "' failed: " + e.getMessage());
            throw new StepExecutionException(e.getMessage(), step);
        }
    }
View Full Code Here

TOP

Related Classes of com.canoo.webtest.engine.StepExecutionException

Copyright © 2018 www.massapicom. 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.