Package net.sourceforge.cruisecontrol

Examples of net.sourceforge.cruisecontrol.CruiseControlException


            Process p = Runtime.getRuntime().exec(commandline);
            new Thread(new StreamPumper(p.getInputStream())).start();
            new Thread(new StreamPumper(p.getErrorStream())).start();
            p.waitFor();
        } catch (IOException e) {
            throw new CruiseControlException("Problem trying to execute command line process", e);
        } catch (InterruptedException e) {
            throw new CruiseControlException("Problem trying to execute command line process", e);
        }
    }
View Full Code Here


        LOG.info("Project name: " + projectName);
    }

    protected void validate() throws CruiseControlException {
        if (buildFile == null) {
            throw new CruiseControlException("No build file specified.");
        }
        if (propertiesFile == null) {
            throw new CruiseControlException("No properties file specified.");
        }
        if (configFile == null) {
            throw new CruiseControlException("No configuration file specified.");
        }
        if (projectName == null) {
            throw new CruiseControlException("No project name specified.");
        }

        if (!buildFile.exists()) {
            throw new CruiseControlException(
                "The specified build file: '"
                    + buildFile.getAbsolutePath()
                    + "' does not exist.");
        }
        if (!propertiesFile.exists()) {
            throw new CruiseControlException(
                "The specified properties file: '"
                    + propertiesFile.getAbsolutePath()
                    + "' does not exist.");
        }
        if (configFile.exists()) {
            throw new CruiseControlException(
                "The specified configuration file: '"
                    + configFile.getAbsolutePath()
                    + "' exists.  Delete and try again.");
        }
View Full Code Here

     *
     * @throws CruiseControlException
     */
    public void assertStdoutDoesNotContain(String string) throws CruiseControlException {
        if (stdout.indexOf(string) > -1) {
            throw new CruiseControlException(
                "The command \""
                    + this.toString()
                    + "\" returned the forbidden string \""
                    + string
                    + "\". \n"
View Full Code Here

        Properties properties = loadProperties(propertiesFile);
        Element buildFileElement = readFileToElement(buildFile);
        try {
            writeXMLFile(createXML(properties, findModificationSet(buildFileElement)));
        } catch (JDOMException e) {
            throw new CruiseControlException(e);
        } catch (IOException e) {
            throw new CruiseControlException(e);
        }
    }
View Full Code Here

     *
     * @throws CruiseControlException
     */
    public void assertStdoutContains(String string) throws CruiseControlException {
        if (stdout.indexOf(string) < 0) {
            throw new CruiseControlException(
                "The stdout of the command \""
                    + this.toString()
                    + "\" did not contain the required string \""
                    + string
                    + "\". \n"
View Full Code Here

                if (targetElement.getChild(elementName) != null) {
                    return targetElement.getChild(elementName).detach();
                }
            }
        }
        throw new CruiseControlException("Could not find a modification set.");
    }
View Full Code Here

     *
     * @throws CruiseControlException
     */
    public void assertStderrDoesNotContain(String string) throws CruiseControlException {
        if (stderr.indexOf(string) > -1) {
            throw new CruiseControlException(
                "The command \""
                    + this.toString()
                    + "\" returned the forbidden string \""
                    + string
                    + "\". \n"
View Full Code Here

            p.getInputStream().close();
            p.getOutputStream().close();
            p.getErrorStream().close();
        } catch (IOException ex) {
            LOG.debug("exception trying to exec ss.exe", ex);
            throw new CruiseControlException(ex);
        } catch (InterruptedException ex) {
            LOG.debug("interrupted during get", ex);
            throw new CruiseControlException(ex);
        }
    }
View Full Code Here

        }
    }

    public void validate() throws CruiseControlException {
        if (vssPath == null || localDirectory == null) {
            throw new CruiseControlException("VssBootstrapper has required attributes vssPath and localDirectory");
        }
        File localDirForFile = new File(localDirectory);
        boolean dirExists = localDirForFile.exists();
        if (!dirExists) {
            LOG.debug("local directory [" + localDirectory + "] does not exist");
            throw new CruiseControlException(
                "file path attribute value "
                    + localDirectory
                    + " must specify an existing directory.");
        }
        boolean isDir = localDirForFile.isDirectory();
        if (!isDir) {
            LOG.debug("local directory [" + localDirectory + "] is not a directory");
            throw new CruiseControlException(
                "file path attribute value "
                    + localDirectory
                    + " must specify an existing directory, not a file.");
        }
        setLocalDirectory(localDirForFile.getAbsolutePath());
View Full Code Here

     *
     * @throws CruiseControlException
     */
    public void assertExitCode(int code) throws CruiseControlException {
        if (exitCode != code) {
            throw new CruiseControlException(
                "The command \""
                    + this.toString()
                    + "\" returned exit code \""
                    + exitCode
                    + "\" when \""
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.CruiseControlException

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.