Package org.codehaus.xharness.procutil

Examples of org.codehaus.xharness.procutil.BgProcess


    public void testExecute() throws Exception {
        KillTask kill = new KillTask();
        kill.setProject(project);
        kill.setProcessname(PROC_NAME);
        MockControl ctrl = MockControl.createControl(BgProcess.class);
        BgProcess proc = (BgProcess)ctrl.getMock();
        proc.kill();
       
        ctrl.replay();
        ProcessRegistry.registerProcess(PROC_NAME, proc);
        kill.execute();
        ctrl.verify();
View Full Code Here


    public void testExecuteFailingKill() throws Exception {
        KillTask kill = new KillTask();
        kill.setProject(project);
        kill.setProcessname(PROC_NAME);
        MockControl ctrl = MockControl.createControl(BgProcess.class);
        BgProcess proc = (BgProcess)ctrl.getMock();
        proc.kill();
        ctrl.setThrowable(new BuildException("blah"));
       
        ctrl.replay();
        ProcessRegistry.registerProcess(PROC_NAME, proc);
        try {
View Full Code Here

        KillTask kill = new KillTask();
        kill.setProject(project);
        kill.setProcessname(PROC_NAME);
        kill.setFailonerror(false);
        MockControl ctrl = MockControl.createControl(BgProcess.class);
        BgProcess proc = (BgProcess)ctrl.getMock();
        proc.kill();
        ctrl.setThrowable(new BuildException("blah"));
       
        ctrl.replay();
        ProcessRegistry.registerProcess(PROC_NAME, proc);
        kill.execute();
View Full Code Here

            throw new BuildException(
                    "You must provide a process name in order to use the KillProcess task");
        }

        try {
            BgProcess proc = ProcessRegistry.getProcess(procName);
            log("KillProcess: killing processname " + procName, Project.MSG_VERBOSE);
            proc.kill();
        } catch (BuildException b) {
            if (failonerror) {
                throw b;
            }
        }
View Full Code Here

        while (iter.hasNext()) {
            Object o = iter.next();
            if (o instanceof ProcessLogger) {
                ProcessLogger pLogger = (ProcessLogger)o;
                if (pLogger.getTask() instanceof BgProcess) {
                    BgProcess proc = (BgProcess)pLogger.getTask();
                    if (!proc.isRunning()) {
                        BuildException be = new BuildException(
                                "Process @" + pLogger.getFullName() + "@ has stopped running");
                        ((ServiceVerifyTask)task).setException(be);
                        return ret;
                    }
View Full Code Here

TOP

Related Classes of org.codehaus.xharness.procutil.BgProcess

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.