Package org.arquillian.spacelift.execution

Examples of org.arquillian.spacelift.execution.ExecutionException


    protected File process(File input) throws Exception {
        try {
            ZipFile zipFile = new ZipFile(input);
            zipFile.extractAll(dest.getAbsolutePath());
        } catch (ZipException e) {
            throw new ExecutionException(e, "Unable to unzip {0} to {1}", input, dest);
        }
        return dest;
    }
View Full Code Here


                        fos.close();
                    }
                }
            }
        } catch (IOException e) {
            throw new ExecutionException(e, "Unable to download from {0} to {1}", url, output);
        }

        return output;
    }
View Full Code Here

    }

    private static ExecutionException unwrapException(Throwable cause, String messageFormat, Object... parameters) {
        Throwable current = cause;
        ExecutionException deepestCause = null;
        while (current != null) {
            if (current instanceof ExecutionException) {
                deepestCause = (ExecutionException) current;
            }
            current = current.getCause();
        }

        if (deepestCause != null) {
            return deepestCause.prependMessage(messageFormat, parameters);
        }

        return new ExecutionException(cause, messageFormat, parameters);
    }
View Full Code Here

        // wait for process to finish IO
        ProcessResult result = processConsumer.await();

        if (spawnedProcess.hasFailed()) {
            throw new ExecutionException("Invocation of \"{0}\" failed with {1}", new Object[] {
                command,
                result.exitValue() });
        }

        return result;
View Full Code Here

        try {
            process.waitFor();
        }
        // rewrap exception
        catch (InterruptedException e) {
            throw new ExecutionException(e.getCause() != null ? e.getCause() : e,
                "Execution of \"{0}\" was interrupted with: {1}",
                new Object[] {
                    programName, e.getMessage() });
        } finally {
            // cleanup
View Full Code Here

        return process != null;
    }

    public void setProcess(Process process) {
        if (process == null) {
            throw new ExecutionException("Unable to SET SET process object for {0}. This is a bug in Arquillian Spacelift.",
                processName);
        }
        this.process = process;
    }
View Full Code Here

    }

    public synchronized Process getProcess() throws ExecutionException {

        if (!isInitialized()) {
            throw new ExecutionException("Unable to get {0} process identifier in ref {1}. This is a bug in Arquillian Spacelift.",
                processName,
                hashCode());
        }

        return process;
View Full Code Here

     * @throws ExecutionException Thrown if object is null
     */
    public static void executionNotNull(final Object obj, final String messageFormat, Object... params)
        throws ExecutionException {
        if (obj == null) {
            throw new ExecutionException(messageFormat, params);
        }
    }
View Full Code Here

TOP

Related Classes of org.arquillian.spacelift.execution.ExecutionException

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.