Package org.apache.tools.ant.taskdefs

Examples of org.apache.tools.ant.taskdefs.ExecuteWatchdog


        int exitValue = JDependTask.ERRORS;
        boolean wasKilled = false;
        if (!getFork()) {
            exitValue = executeInVM(commandline);
        } else {
            ExecuteWatchdog watchdog = createWatchdog();
            exitValue = executeAsForked(commandline, watchdog);
            // null watchdog means no timeout, you'd better not check with null
            if (watchdog != null) {
                //info will be used in later version do nothing for now
                //wasKilled = watchdog.killedProcess();
View Full Code Here


        // add user arguments
        if (args != null) {
            cmdLine.addAll(args);
        }
       
        ExecuteWatchdog watchdog = new ExecuteWatchdog( timeout );
        ExecuteStreamHandler streamHandler = new PumpStreamHandler( out, out, in );
        Execute exec = new Execute( streamHandler, watchdog );
        exec.setCommandline( cmdLine.toArray(new String[] {}) );
        List<String> env = getCommandEnvironment(command);
        if (!env.isEmpty()) {
View Full Code Here

        int exitValue = JUnitTestRunner.ERRORS;
        boolean wasKilled = false;
        if (!test.getFork()) {
            exitValue = executeInVM(test);
        } else {
            ExecuteWatchdog watchdog = createWatchdog();
            exitValue = executeAsForked(test, watchdog);
            // null watchdog means no timeout, you'd better not check with null
            if (watchdog != null) {
                wasKilled = watchdog.killedProcess();
            }
        }

        // if there is an error/failure and that it should halt, stop
        // everything otherwise just log a statement
View Full Code Here

     */
    protected ExecuteWatchdog createWatchdog() throws BuildException {
        if (timeout == null) {
            return null;
        }
        return new ExecuteWatchdog(timeout.intValue());
    }
View Full Code Here

        int exitValue = JDependTask.ERRORS;
        boolean wasKilled = false;
        if (!getFork()) {
            exitValue = executeInVM(commandline);
        } else {
            ExecuteWatchdog watchdog = createWatchdog();
            exitValue = executeAsForked(commandline, watchdog);
            // null watchdog means no timeout, you'd better not check with null
            if (watchdog != null) {
                wasKilled = watchdog.killedProcess();
            }
        }

        // if there is an error/failure and that it should halt, stop
        // everything otherwise just log a statement
View Full Code Here

     */
    protected ExecuteWatchdog createWatchdog() throws BuildException {
        if (getTimeout() == null) {
            return null;
        }
        return new ExecuteWatchdog(getTimeout().longValue());
    }
View Full Code Here

   
    public void testCreateWatchdog() throws Exception {
        Project project = new Project();
        XhExecTask task = new XhExecTask();
        task.setProject(project);
        ExecuteWatchdog dog = task.createWatchdog();
        assertEquals("Wrong watchdog",
                     KillableExecuteWatchdog.class.getName(),
                     dog.getClass().getName());
        assertEquals("Wrong watchdog", dog, task.getWatchdog());
    }
View Full Code Here

    public void testCreateWatchdog() throws Exception {
        Project project = new Project();
        XhJavaTask task = new XhJavaTask();
        task.setProject(project);
        ExecuteWatchdog dog = task.createWatchdog();
        assertEquals("Wrong watchdog",
                     KillableExecuteWatchdog.class.getName(),
                     dog.getClass().getName());
        assertEquals("Wrong watchdog", dog, task.getWatchdog());
    }
View Full Code Here

    createClasspath().setLocation(findJar());

    cmd.createArgument().setValue("@" + fileName);

    ExecuteWatchdog watchdog= createWatchdog();
    boolean wasKilled= false;
    int exitValue= executeAsForked(cmd, watchdog);
    if(null != watchdog) {
      wasKilled= watchdog.killedProcess();
    }

    actOnResult(exitValue, wasKilled);
  }
View Full Code Here

  protected ExecuteWatchdog createWatchdog() /*throws BuildException*/ {
    if(m_timeout == null) {
      return null;
    }

    return new ExecuteWatchdog(m_timeout.longValue());
  }
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.taskdefs.ExecuteWatchdog

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.