Package net.sourceforge.cruisecontrol.util

Examples of net.sourceforge.cruisecontrol.util.Commandline


    assertEquals("accurev keep -m -t \"" + d1.toString() + "-" + d2.toString() + "\" -c \"Automatic keep\"",
        cmdKeep.toString());
    AccurevCommandline cmdHist = AccurevCommand.HIST.create();
    cmdHist.setTransactionRange(d1, d2);
    assertEquals("accurev hist -t \"" + d1.toString() + "-" + d2.toString() + "\"", cmdHist.toString());
    Commandline cmdUpdate = AccurevCommand.UPDATE.create();
    assertEquals("accurev update", cmdUpdate.toString());
    Commandline cmdSynctime = AccurevCommand.SYNCTIME.create();
    assertEquals("accurev synctime", cmdSynctime.toString());
  }
View Full Code Here


        P4 p4 = new MockP4(0);
        p4.setView("foo");

        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
        Date date = dateFormat.parse("12/30/2004");
        Commandline cmdLine = p4.buildChangesCommand(date, date, true);

        String[] args = cmdLine.getCommandline();
        StringBuffer cmd = new StringBuffer();
        cmd.append(args[ 0 ]);
        for (int i = 1; i < args.length; i++) {
            cmd.append(" " + args[ i ]);
        }
View Full Code Here

        P4 p4 = new MockP4(0);
        p4.setView("foo");

        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy");
        Date date = dateFormat.parse("12/30/2004");
        Commandline cmdLine = p4.buildChangesCommand(date, date, false);

        String[] args = cmdLine.getCommandline();
        StringBuffer cmd = new StringBuffer();
        cmd.append(args[ 0 ]);
        for (int i = 1; i < args.length; i++) {
            cmd.append(" " + args[ i ]);
        }
View Full Code Here

    /**
     *  Update the specified file.
     */
    public void bootstrap() {
        Commandline commandLine = buildUpdateCommand();
       
        if (LOG.isDebugEnabled()) {
            LOG.debug("Executing: " + commandLine.toString());
        }
        try {
            Process p = Runtime.getRuntime().exec(commandLine.getCommandline());
            StreamPumper errorPumper =
                new StreamPumper(p.getErrorStream(), new PrintWriter(System.err, true));
            new Thread(errorPumper).start();
            p.waitFor();
            p.getInputStream().close();
View Full Code Here

            throw new CruiseControlException("'file' is required for SnapshotCMBootstrapper");
        }
    }

    protected Commandline buildUpdateCommand() {
        Commandline commandLine = new Commandline();
        commandLine.setExecutable("wco");

        commandLine.createArgument().setValue("-fR");
        commandLine.createArgument().setValue(filename);

        return commandLine;
    }
View Full Code Here

    /**
     *  Update the specified file.
     */
    public void bootstrap() {
        try {
            Commandline commandLine = buildUpdateCommand();
            Process p = commandLine.execute();
            final boolean autoFlushOn = true;
            StreamPumper errorPumper =
                new StreamPumper(p.getErrorStream(), new PrintWriter(System.err, autoFlushOn));
            StreamPumper outPumper = new StreamPumper(p.getInputStream(), new PrintWriter(System.out, autoFlushOn));
            Thread errorPumperThread = new Thread(errorPumper);
View Full Code Here

    /**
     * Update the specified file from the subversion repository.
     */
    public void bootstrap() {
        try {
            Commandline commandLine = buildUpdateCommand();
            execUpdateCommand(commandLine);
        } catch (Exception e) {
            LOG.error("Error executing svn update command", e);
        }
    }
View Full Code Here

            }
        }
    }

    protected Commandline buildUpdateCommand() throws CruiseControlException {
        Commandline commandLine = new Commandline();

        if (localWorkingCopy != null) {
            commandLine.setWorkingDirectory(localWorkingCopy);
        }       

        commandLine.setExecutable("cvs");

        if (cvsroot != null) {
            commandLine.createArgument().setValue("-d");
            commandLine.createArgument().setValue(cvsroot);
        }
        commandLine.createArgument().setValue("update");
        commandLine.createArgument().setValue("-dP");

        if (filename != null) {
            commandLine.createArgument().setValue(filename);
        }

        return commandLine;
    }
View Full Code Here

     * For example:
     *
     * 'svn update --non-interactive filename'
     */
    Commandline buildUpdateCommand() throws CruiseControlException {
        Commandline command = new Commandline();
        command.setExecutable("svn");

        if (localWorkingCopy != null) {
            command.setWorkingDirectory(localWorkingCopy);
        }

        command.createArgument().setValue("update");
        command.createArgument().setValue("--non-interactive");
        if (userName != null) {
            command.createArgument().setValue("--username");
            command.createArgument().setValue(userName);
        }
        if (password != null) {
            command.createArgument().setValue("--password");
            command.createArgument().setValue(password);
        }
        if (fileName != null) {
            command.createArgument().setValue(fileName);
        }

        LOG.debug("SVNBootstrapper: Executing command = " + command);

        return command;
View Full Code Here

    /**
     *  Update the specified file.
     */
    public void bootstrap() {
        Commandline commandLine = buildUpdateCommand();
        Process p = null;

        log.debug("Executing: " + commandLine.toString());
        try {
            p = Runtime.getRuntime().exec(commandLine.getCommandline());
            StreamPumper errorPumper =
                new StreamPumper(p.getErrorStream(), new PrintWriter(System.err, true));
            new Thread(errorPumper).start();
            p.waitFor();
            p.getInputStream().close();
View Full Code Here

TOP

Related Classes of net.sourceforge.cruisecontrol.util.Commandline

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.